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

Alexandre Julliard julliard at winehq.org
Tue Aug 16 16:00:59 CDT 2022


Module: wine
Branch: master
Commit: 3aefc3a4225c6a5c9419f9f8405d91758aefd694
URL:    https://gitlab.winehq.org/wine/wine/-/commit/3aefc3a4225c6a5c9419f9f8405d91758aefd694

Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date:   Tue Aug 16 11:42:31 2022 +0800

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

---

 dlls/comctl32/commctrl.c       | 5 ++++-
 dlls/comctl32/tests/subclass.c | 3 ---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c
index 14b148d591d..c5910b40869 100644
--- a/dlls/comctl32/commctrl.c
+++ b/dlls/comctl32/commctrl.c
@@ -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;
 }
 
diff --git a/dlls/comctl32/tests/subclass.c b/dlls/comctl32/tests/subclass.c
index 9f1955c4258..e2e8573f4c0 100644
--- a/dlls/comctl32/tests/subclass.c
+++ b/dlls/comctl32/tests/subclass.c
@@ -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);




More information about the wine-cvs mailing list