Windows error 0x00000092, 146

Detailed Error Information


MessageThe path specified is being used in a substitute.
Declared inwinerror.h

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


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

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.

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
Reserved (X)false
FacilityCode0 (0x000)
DescriptionThe default facility code.[3][1]
Error Code146 (0x0092)

Possible solutions


Memory leak due to marshalling managed delegate?


Just declare your native method with a delegate parameter instead of IntPtr. The marshaler will do all this stuff for you.

answered on Stack Overflow Sep 13, 2012 by Anton Tykhyy

How to diagnose a corrupted suffix pattern in a mixed managed/unmanaged x32 .NET application


I finally resolved this, and found that I had made one crucial mistake. With a corrupted suffix pattern, the error will come on a free attempt, which led me to believe that it was unlikely that the allocation would have come right before the free. This was not accurate. When dealing with corruption that occurs on free, barring further information, any allocation point is equally likely. In this case, the verifier halt was coming on freeing a parameter which had been incorrectly defined as a struct of shorts instead of as a struct of ints.

Here's the offending code:

    [DllImport("gdi32.dll", CharSet = CharSet.Unicode)]
    [return: MarshalAs(UnmanagedType.Bool)]
    static extern bool GetCharABCWidths(IntPtr hdc, uint uFirstChar, uint uLastChar, [Out] ABC[] lpabc);

(This declaration is okay)

    public struct ABC
        public short A;
        public ushort B;
        public short C;

(This is not okay, per the MSDN article on the ABC struct : )

So, if you find yourself debugging memory corruption that halts on free, keep in mind: never discount the possibility that the memory being freed was incorrectly allocated to begin with... and mind those [Out] parameters on unmanaged calls!

answered on Stack Overflow Feb 14, 2014 by ianschol

Memory leak due to marshalling managed delegate?


As far as I know delegate is a list of function pointers in C#. Passing that to a parameter of function pointer in C++ makes me feels there will be a problem. You should consider adding a native function to report status and pool this one in a separate thread or background worker in C#. Such that you do not need to pass a delegate any more.

answered on Stack Overflow Sep 13, 2012 by Mahmoud Fayez


Leave a comment

(plain text only)


  1. winerror.h from Windows SDK 10.0.14393.0

User contributions licensed under CC BY-SA 3.0