HWND GetMainWnd(HINSTANCE hInstance){
static HWND hWnd = NULL;
if (hWnd)
return hWnd;
RETURN_AT_ERROR(hInstance, NULL);
WNDCLASSEX wcex = {sizeof(WNDCLASSEX) };
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = MainWndProc;
wcex.hInstance = hInstance;
wcex.hCursor = ::LoadCursorW(NULL, IDC_ARROW);< br />wcex.lpszClassName = g_config->GetWndClass();
ATOM atom = ::RegisterClassExW(&wcex);
RETURN_AT_ERROR(atom != 0, NULL);
hWnd = ::CreateWindowExW(WS_EX_LEFT, g_config->GetWndClass(), 0, WS_POPUP | WS_MINIMIZEBOX | WS_CLIPCHILDREN, 0, 0, 0, 0, 0, 0, hInstance, 0);
return hWnd;}
On this string
hWnd = ::CreateWindowExW(WS_EX_LEFT, g_config->GetWndClass(), 0, WS_POPUP | WS_MINIMIZEBOX | WS_CLIPCHILDREN, 0, 0, 0, 0, 0, 0, hInstance, 0);
There is a warning message box
Windows has triggered a breakpoint in drm.exe. This may be due to a
corruption of the heap, which indicates a bug in drm.exe or any of the
DLLs it has loaded. This may also be due to the user pressing F12
while drm.exe has focus. The output window may have more diagnostic
information.
I press “Continue” and it displays
Unhandled exception at 0x77dae753 in app.exe: 0xC0000374: A heap has been corrupted.
However, CreateWindowExW returns a non-zero value and creates the window , Because it should…
http://advancedwindowsdebugging.com /ch06.pdf
I have some heap corruption issues. Warnings can be observed when using the CreateWindowExW function. I know this is usually a memory error, but how can I Search it in this case? There is no new variable before calling CreateWindowExW and I cannot enter this function. Here is the code.
HWND GetMainWnd(HINSTANCE hInstance){
static HWND hWnd = NULL;
if (hWnd)
return hWnd;
RETURN_AT_ERROR(hInstance, NULL);
WNDCLASSEX wcex = {sizeof(WNDCLASSEX) };
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = MainWndProc;
wcex.hInstance = hInstance;
wcex.hCursor = ::LoadCursorW(NULL, IDC_ARROW);< br />wcex.lpszClassName = g_config->GetWndClass();
ATOM atom = ::RegisterClassExW(&wcex);
RETURN_AT_ERROR(atom != 0, NULL);
hWnd = ::CreateWindowExW(WS_EX_LEFT, g_config->GetWndClass(), 0, WS_POPUP | WS_MINIMIZEBOX | WS_CLIPCHILDREN, 0, 0, 0, 0, 0, 0, hInstance, 0);
return hWnd;}
On this string
hWnd = ::CreateWindowExW(WS_EX_LEFT, g_config->GetWndClass(), 0, WS_POPUP | WS_MINIMIZEBOX | WS_CLIPCHILDREN, 0, 0, 0, 0, 0, 0, hInstance, 0);
There is a warning message box
Wi ndows has triggered a breakpoint in drm.exe. This may be due to a
corruption of the heap, which indicates a bug in drm.exe or any of the
DLLs it has loaded. This may also be due to the user pressing F12
while drm.exe has focus. The output window may have more diagnostic
information.
I press “Continue” and it displays
< p>
Unhandled exception at 0x77dae753 in app.exe: 0xC0000374: A heap has been corrupted.
However, CreateWindowExW returns a non-zero value and creates the window because it should…
As mentioned above, after some DLLs/modules loaded in your process have actually become corrupted, heap corruption is usually detected. From Your post looks like this problem is specific to the Windows platform, so I suggest you use WinDBG/Pageheap and find out where the actual memory corruption occurs. A very good article on heap memory corruption analysis can be found in “Advanced Windows Debugging , Author: Author: Mario Hewardt; Daniel Pravat” found in the book.
http://advancedwindowsdebugging.com/ch06.pdf
p>