comctl32: Set reference data to zero on failure for GetWindowSubclass().

This commit is contained in:
Zhiyi Zhang 2022-08-16 11:42:31 +08:00 committed by Alexandre Julliard
parent 9b9fef2e11
commit 3aefc3a422
2 changed files with 4 additions and 4 deletions

View file

@ -1173,7 +1173,7 @@ BOOL WINAPI GetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass,
/* See if we have been called for this window */
stack = GetPropW (hWnd, COMCTL32_wSubclass);
if (!stack)
return FALSE;
goto done;
proc = stack->SubclassProcs;
while (proc) {
@ -1186,6 +1186,9 @@ BOOL WINAPI GetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass,
proc = proc->next;
}
done:
if (pdwRef)
*pdwRef = 0;
return FALSE;
}

View file

@ -356,19 +356,16 @@ static void test_GetWindowSubclass(void)
data = 0xdeadbeef;
ret = pGetWindowSubclass(NULL, wnd_proc_sub, 2, &data);
ok(!ret, "GetWindowSubclass succeeded.\n");
todo_wine
ok(data == 0, "Got unexpected data %#Ix.\n", data);
data = 0xdeadbeef;
ret = pGetWindowSubclass(hwnd, NULL, 2, &data);
ok(!ret, "GetWindowSubclass succeeded.\n");
todo_wine
ok(data == 0, "Got unexpected data %#Ix.\n", data);
data = 0xdeadbeef;
ret = pGetWindowSubclass(hwnd, wnd_proc_sub, 0, &data);
ok(!ret, "GetWindowSubclass succeeded.\n");
todo_wine
ok(data == 0, "Got unexpected data %#Ix.\n", data);
ret = pGetWindowSubclass(hwnd, wnd_proc_sub, 2, NULL);