Commit 078c6e5a authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

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

parent 8387d2fe
......@@ -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);
......
......@@ -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);
}
......
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