Commit d753a999 authored by Francois Boisvert's avatar Francois Boisvert Committed by Alexandre Julliard

Fixed a wrong usage of WIN_FindWndPtr/WIN_ReleaseWndPtr in

TranslateMDISysAccel16.
parent e85220dd
...@@ -1840,21 +1840,22 @@ BOOL WINAPI TranslateMDISysAccel( HWND hwndClient, LPMSG msg ) ...@@ -1840,21 +1840,22 @@ BOOL WINAPI TranslateMDISysAccel( HWND hwndClient, LPMSG msg )
*/ */
BOOL16 WINAPI TranslateMDISysAccel16( HWND16 hwndClient, LPMSG16 msg ) BOOL16 WINAPI TranslateMDISysAccel16( HWND16 hwndClient, LPMSG16 msg )
{ {
WND* clientWnd = WIN_FindWndPtr( hwndClient);
if( clientWnd && (msg->message == WM_KEYDOWN || msg->message == WM_SYSKEYDOWN)) if( IsWindow(hwndClient) && (msg->message == WM_KEYDOWN || msg->message == WM_SYSKEYDOWN))
{ {
MDICLIENTINFO *ci = NULL; MDICLIENTINFO *ci = NULL;
WND* wnd; HWND wnd;
WND *clientWnd = WIN_FindWndPtr(hwndClient);
ci = (MDICLIENTINFO*) clientWnd->wExtra; ci = (MDICLIENTINFO*) clientWnd->wExtra;
wnd = ci->hwndActiveChild;
WIN_ReleaseWndPtr(clientWnd); WIN_ReleaseWndPtr(clientWnd);
wnd = WIN_FindWndPtr(ci->hwndActiveChild);
if( wnd && !(wnd->dwStyle & WS_DISABLED) ) if( IsWindow(wnd) && !(GetWindowLongA(wnd,GWL_STYLE) & WS_DISABLED) )
{ {
WPARAM16 wParam = 0; WPARAM16 wParam = 0;
WIN_ReleaseWndPtr(wnd);
/* translate if the Ctrl key is down and Alt not. */ /* translate if the Ctrl key is down and Alt not. */
if( (GetKeyState(VK_CONTROL) & 0x8000) && if( (GetKeyState(VK_CONTROL) & 0x8000) &&
...@@ -1880,9 +1881,7 @@ BOOL16 WINAPI TranslateMDISysAccel16( HWND16 hwndClient, LPMSG16 msg ) ...@@ -1880,9 +1881,7 @@ BOOL16 WINAPI TranslateMDISysAccel16( HWND16 hwndClient, LPMSG16 msg )
return 1; return 1;
} }
} }
WIN_ReleaseWndPtr(wnd);
} }
WIN_ReleaseWndPtr(clientWnd);
return 0; /* failure */ return 0; /* failure */
} }
......
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