Suspend window locks before calling hook procedure.

This commit is contained in:
Ulrich Weigand 1999-05-17 14:55:30 +00:00 committed by Alexandre Julliard
parent 9c3b18fa38
commit 4b6b1c3fc8
1 changed files with 7 additions and 0 deletions

View File

@ -18,6 +18,7 @@
#include "wine/winuser16.h"
#include "wine/winbase16.h"
#include "hook.h"
#include "win.h"
#include "queue.h"
#include "task.h"
#include "user.h"
@ -977,6 +978,7 @@ static LRESULT HOOK_CallHook( HANDLE16 hook, INT fromtype, INT code,
HANDLE16 prevHook;
HOOKDATA *data = (HOOKDATA *)USER_HEAP_LIN_ADDR(hook);
LRESULT ret;
int iWndsLocks;
WPARAM wParamOrig = wParam;
LPARAM lParamOrig = lParam;
@ -999,6 +1001,9 @@ static LRESULT HOOK_CallHook( HANDLE16 hook, INT fromtype, INT code,
TRACE(hook, "Calling hook %04x: %d %08x %08lx\n",
hook, code, wParam, lParam );
/* Suspend window structure locks before calling user code */
iWndsLocks = WIN_SuspendWndsLock();
ret = data->proc(code, wParam, lParam);
/* Grrr. While the hook procedure is supposed to have an LRESULT return
@ -1010,6 +1015,8 @@ static LRESULT HOOK_CallHook( HANDLE16 hook, INT fromtype, INT code,
&& data->id != WH_JOURNALPLAYBACK )
ret = LOWORD( ret );
WIN_RestoreWndsLock(iWndsLocks);
TRACE(hook, "Ret hook %04x = %08lx\n", hook, ret );
data->flags &= ~HOOK_INUSE;