comctl32: Skip restoring window proc if it has been modified.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=43073
This commit is contained in:
Rémi Bernon 2023-01-26 15:40:43 +01:00 committed by Alexandre Julliard
parent 8387d2feff
commit 078c6e5ab2
2 changed files with 4 additions and 2 deletions

View file

@ -1243,7 +1243,9 @@ BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR u
if (!stack->SubclassProcs && !stack->running) {
TRACE("Last Subclass removed, cleaning up\n");
/* clean up our heap and reset the original window procedure */
if (stack->is_unicode)
if ((WNDPROC)GetWindowLongPtrW (hWnd, GWLP_WNDPROC) != COMCTL32_SubclassProc)
WARN("Window procedure has been modified, skipping restore\n");
else if (stack->is_unicode)
SetWindowLongPtrW (hWnd, GWLP_WNDPROC, (DWORD_PTR)stack->origproc);
else
SetWindowLongPtrA (hWnd, GWLP_WNDPROC, (DWORD_PTR)stack->origproc);

View file

@ -192,7 +192,7 @@ static void check_unicode_(int line, HWND hwnd, DWORD flags)
else if (flags & EXPECT_WNDPROC_1)
ok_(__FILE__, line)(proc == wnd_proc_1, "got proc %p\n", proc);
else if (flags & EXPECT_WNDPROC_3)
todo_wine_if(proc == wnd_proc_1) ok_(__FILE__, line)(proc == wnd_proc_3, "got proc %p\n", proc);
ok_(__FILE__, line)(proc == wnd_proc_3, "got proc %p\n", proc);
else
ok_(__FILE__, line)(!IS_WNDPROC_HANDLE(proc), "got proc %p\n", proc);
}