From 5b803350e90028279e1dbd0013125550f19c84c5 Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Tue, 16 Mar 1999 10:29:55 +0000 Subject: [PATCH] Ignore HIWORD of boolean return values of 16-bit hook procedures, to match buggy Windows behaviour. --- windows/hook.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/windows/hook.c b/windows/hook.c index 81feb35b664..3fa7db8be46 100644 --- a/windows/hook.c +++ b/windows/hook.c @@ -995,6 +995,15 @@ static LRESULT HOOK_CallHook( HANDLE16 hook, INT fromtype, INT code, ret = data->proc(code, wParam, lParam); + /* Grrr. While the hook procedure is supposed to have an LRESULT return + value even in Win16, it seems that for those hook types where the + return value is interpreted as BOOL, Windows doesn't actually check + the HIWORD ... Some buggy Win16 programs, notably WINFILE, rely on + that, because they neglect to clear DX ... */ + if ( (data->flags & HOOK_MAPTYPE) == HOOK_WIN16 + && data->id != WH_JOURNALPLAYBACK ) + ret = LOWORD( ret ); + TRACE(hook, "Ret hook %04x = %08lx\n", hook, ret ); data->flags &= ~HOOK_INUSE;