Windows error 0x000000E2, 226

Detailed Error Information

VIRUS_DELETED[1]

MessageThis file contains a virus or potentially unwanted software and cannot be opened. Due to the nature of this virus or potentially unwanted software, the file has been removed from this location.
Declared inwinerror.h

This appears to be a raw Win32 error. More information may be available in error 0x800700E2.

MANUALLY_INITIATED_CRASH[2]

This is a Blue Screen of Death stop code. More information is available in the Knowledge Base article Bug Check 0xE2: MANUALLY_INITIATED_CRASH.

HRESULT analysis[3]

This is probably not the correct interpretation of this error. The Win32 error above is more likely to indicate the actual problem.
FlagsSeveritySuccess

This code indicates success, rather than an error. This may not be the correct interpretation of this code, or possibly the program is handling errors incorrectly.

Reserved (R)false
OriginMicrosoft
NTSTATUSfalse
Reserved (X)false
FacilityCode0 (0x000)
NameFACILITY_NULL[3][1]
DescriptionThe default facility code.[3][1]
Error Code226 (0x00e2)

Possible solutions

8

LoadLibrary cannot find ntoskrnl

c++
windows
winapi
visual-c++
loadlibrary

KeBugCheck is a kernel function. That means you can't call it from user-mode code, like the application you're trying to write.

There is also no user-mode wrapper provided for this function because user-mode code is not supposed to be able to bring down the entire system.

You will have to write your own kernel-mode driver to do this. To get started, download the Windows Driver Development Kit (DDK). And in that case, there will be no need for the whole LoadLibrary and GetProcAddress dance, since the function declaration is in the public Ntddk.h header and will be linked in automatically from the Ntoskrnl.lib file.


As for the problem you're having here, with LoadLibrary returning ERROR_MOD_NOT_FOUND, that is unrelated. The code you have is wrong, quite obvious from the explicit cast to LPCWSTR that you're having to perform in order to shut the compiler up.

You're compiling a Unicode application, so the call to LoadLibrary is automatically resolved to LoadLibraryW, which accepts a wide (Unicode) string with the type LPCWSTR. You're trying to pass it a narrow string literal, which generates a type mismatch error. Except that you've inserted the cast, which effectively tells the compiler to shut up because you know better than it. Except that you don't. You should listen to the compiler; it can save you from a lot of bugs.

The fix is simple: remove all the superfluous casts from your code and use a wide string literal instead. (The GetProcAddress function, however, is unique: it always requires a narrow string, regardless of whether or not you're compiling for Unicode.)

HMODULE bcLib = LoadLibrary(L"ntoskrnl.exe");
void* fnc = (void*)GetProcAddress(bcLib, "KeBugCheck");

Of course, once you fix this, you'll want to see the first part of my answer.

answered on Stack Overflow Aug 4, 2013 by Cody Gray • edited Sep 27, 2017 by Cody Gray
0

Workaround Reserved Words

sql
ado
ms-access-2013
delphi-xe8

Your have two choise if you are using SQL Server or MySQL on all other there must be one:

SELECT Fieldname as "Name" ...

This ist ANSI

OR

SELECT Fieldname as [Name]

This ist SQL Server and MS Access

On MySQL you can use:

SELECT Fieldname as ┬┤Name┬┤

But is it possible that you get the error in .NET and not in SQL? Normaly you don't get this error if you rename a column to "name", only if you want to access a column with a reserved name in some cases.

So in ADO.NET you can try:

rst![Name]
rst.Fields("Name")

Or the best think: Give us a sample of your code. And please try the SQL in SSMS.

answered on Stack Overflow Oct 5, 2015 by Frank
0

Workaround Reserved Words

sql
ado
ms-access-2013
delphi-xe8

You should wrap any reserved words in square brackets as follows:

[Name] instead of Name

answered on Stack Overflow Oct 5, 2015 by Laurence Frost
0

Excel-VBA with C++ DLL sometimes crashes

c++
excel
vba
excel-vba
dll

Integer in VBA is from -32768 to 32767. In C++ it is a way bigger, equivalent to the VBA Long. Thus, try declaring like this:

Private Declare PtrSafe Function foo Lib "MyLibrary.dll" (ByRef arr As Double) As Long


Let me show what I did so far, which worked for me (if this was the way you wanted it). Anyhow, I have changed a few things, it will be better to use some text comparer to see a bit).


int __stdcall SimpleSlowMath(double *source)
{
    return 0;
}

The *.def looks like this:

LIBRARY "SomeLibrary"
EXPORTS
SimpleSlowMath

The VBA:

Option Explicit

Public Const myPathDll = "C:\Users\your-own-path\Debug\vityata051217.dll"

Private Declare PtrSafe Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" _
    (ByVal lpLibFileName As String) As Long
Private Declare PtrSafe Function FreeLibrary Lib "kernel32" _
    (ByVal hLibModule As LongPtr) As Long
Private Declare PtrSafe Function SimpleSlowMath Lib "vityata051217.dll" _
    (ByRef arr() As Double) As Long

Sub Try(n As Long)

    Dim i                   As Long
    Dim library_address     As Long
    Dim library_path        As String
    library_path = myPathDll
    library_address = LoadLibrary(library_path)

    Dim arr() As Double
    ReDim arr(1 To n) As Double

    For i = 1 To n
        arr(i) = CDbl(Cells(i, 1).Value)
    Next

    Debug.Print SimpleSlowMath(arr)

End Sub

Public Sub TestMe()        
    Dim n As Long        
    For n = 1 To 50
        Try n
        Debug.Print n
    Next n        
End Sub

As you see, the difference is that I declare the array with () here - ByRef arr() As Double, but there are some other as well. Give it a try, for me it was working for 2000 samples.

answered on Stack Overflow Nov 30, 2017 by Vityata • edited Jul 12, 2018 by Vityata

Comments

Leave a comment

(plain text only)

Sources

  1. winerror.h from Windows SDK 10.0.14393.0
  2. https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/bug-check-code-reference2
  3. https://msdn.microsoft.com/en-us/library/cc231198.aspx

User contributions licensed under CC BY-SA 3.0