Commit 9b9fef2e authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

comctl32: Check reference data pointer before using it.

Fix the crash when opening notepad++ v8.4.4 preference dialog before e52e42b8.
parent f7443102
...@@ -1179,6 +1179,7 @@ BOOL WINAPI GetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass, ...@@ -1179,6 +1179,7 @@ BOOL WINAPI GetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass,
while (proc) { while (proc) {
if ((proc->id == uID) && if ((proc->id == uID) &&
(proc->subproc == pfnSubclass)) { (proc->subproc == pfnSubclass)) {
if (pdwRef)
*pdwRef = proc->ref; *pdwRef = proc->ref;
return TRUE; return TRUE;
} }
......
...@@ -371,12 +371,8 @@ static void test_GetWindowSubclass(void) ...@@ -371,12 +371,8 @@ static void test_GetWindowSubclass(void)
todo_wine todo_wine
ok(data == 0, "Got unexpected data %#Ix.\n", data); ok(data == 0, "Got unexpected data %#Ix.\n", data);
/* Crash on Wine */
if (strcmp(winetest_platform, "wine"))
{
ret = pGetWindowSubclass(hwnd, wnd_proc_sub, 2, NULL); ret = pGetWindowSubclass(hwnd, wnd_proc_sub, 2, NULL);
ok(ret, "GetWindowSubclass failed.\n"); ok(ret, "GetWindowSubclass failed.\n");
}
data = 0xdeadbeef; data = 0xdeadbeef;
ret = pGetWindowSubclass(hwnd, wnd_proc_sub, 2, &data); ret = pGetWindowSubclass(hwnd, wnd_proc_sub, 2, &data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment