user32: Call window procedure even if we're out of winproc handles.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2016-03-09 13:51:37 +01:00 committed by Alexandre Julliard
parent 55a5bac500
commit c9ae38e4c7
1 changed files with 14 additions and 6 deletions

View File

@ -876,6 +876,7 @@ BOOL WINPROC_call_window( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
WND *wndPtr; WND *wndPtr;
WNDPROC func; WNDPROC func;
WINDOWPROC *proc; WINDOWPROC *proc;
BOOL unicode_win;
if (!(wndPtr = WIN_GetPtr( hwnd ))) return FALSE; if (!(wndPtr = WIN_GetPtr( hwnd ))) return FALSE;
if (wndPtr == WND_OTHER_PROCESS || wndPtr == WND_DESKTOP) return FALSE; if (wndPtr == WND_OTHER_PROCESS || wndPtr == WND_DESKTOP) return FALSE;
@ -886,10 +887,9 @@ BOOL WINPROC_call_window( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
} }
func = wndPtr->winproc; func = wndPtr->winproc;
proc = handle_to_proc( wndPtr->winproc ); proc = handle_to_proc( wndPtr->winproc );
unicode_win = wndPtr->flags & WIN_ISUNICODE;
WIN_ReleasePtr( wndPtr ); WIN_ReleasePtr( wndPtr );
if (!proc) return TRUE;
if (thread_info->recursion_count > MAX_WINPROC_RECURSION) return FALSE; if (thread_info->recursion_count > MAX_WINPROC_RECURSION) return FALSE;
thread_info->recursion_count++; thread_info->recursion_count++;
@ -897,19 +897,27 @@ BOOL WINPROC_call_window( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,
{ {
if (proc == WINPROC_PROC16) if (proc == WINPROC_PROC16)
WINPROC_CallProcWtoA( wow_handlers.call_window_proc, hwnd, msg, wParam, lParam, result, func ); WINPROC_CallProcWtoA( wow_handlers.call_window_proc, hwnd, msg, wParam, lParam, result, func );
else if (proc->procW) else if (proc && proc->procW)
call_window_proc( hwnd, msg, wParam, lParam, result, proc->procW ); call_window_proc( hwnd, msg, wParam, lParam, result, proc->procW );
else else if (proc)
WINPROC_CallProcWtoA( call_window_proc, hwnd, msg, wParam, lParam, result, proc->procA ); WINPROC_CallProcWtoA( call_window_proc, hwnd, msg, wParam, lParam, result, proc->procA );
else if (unicode_win)
call_window_proc( hwnd, msg, wParam, lParam, result, func );
else
WINPROC_CallProcWtoA( call_window_proc, hwnd, msg, wParam, lParam, result, func );
} }
else else
{ {
if (proc == WINPROC_PROC16) if (proc == WINPROC_PROC16)
wow_handlers.call_window_proc( hwnd, msg, wParam, lParam, result, func ); wow_handlers.call_window_proc( hwnd, msg, wParam, lParam, result, func );
else if (proc->procA) else if (proc && proc->procA)
call_window_proc( hwnd, msg, wParam, lParam, result, proc->procA ); call_window_proc( hwnd, msg, wParam, lParam, result, proc->procA );
else else if (proc)
WINPROC_CallProcAtoW( call_window_proc, hwnd, msg, wParam, lParam, result, proc->procW, mapping ); WINPROC_CallProcAtoW( call_window_proc, hwnd, msg, wParam, lParam, result, proc->procW, mapping );
else if (unicode_win)
WINPROC_CallProcAtoW( call_window_proc, hwnd, msg, wParam, lParam, result, func, mapping );
else
call_window_proc( hwnd, msg, wParam, lParam, result, func );
} }
thread_info->recursion_count--; thread_info->recursion_count--;
return TRUE; return TRUE;