On Tue, Jul 23, 2002 at 03:18:04PM -0700, Alexandre Julliard wrote:
Michael Stefaniuc mstefani@redhat.de writes:
It seems that we don't have an implicit transformation of a HHOOK to a HANDLE16. Most of the internal HOOK_* functions are using HANDLE16's and the few functions that accepts as parameter a HHOOK are checking for the presence of the HOOK_MAGIC and are doing the conversion to a HANDLE16 with LOWORD(hhook).
Well yes, the hook functions are mostly using HANDLE16 internally, but it would be much better to change them to use HHOOK. There isn't much point in making HHOOK work with -DSTRICT if we don't use it anywhere.
Hmm ... looking at windows/hook.c i guess that we have to keep using with HOOKDATA, MESSAGEQUEUE, USER_HEAP_LIN_ADDR, etc. and this ones are using HANDLE16. HOOK_systemHooks could be changed to HHOOK, but this would introduce a lot of conversions. I've changed all internal HOOK_* functions to pass only HHOOK's to each other. I've kept the use of HANDLE16 in functions that make extensive use of HOOKDATA and MESSAGEQUEUE but changed the variables name from hook to handle to not produce confusion.
- return CallNextHookEx16( WH_SHELL, code, wParam, lParam );
- return CallNextHookEx16( (HHOOK)MAKELONG(WH_SHELL, HOOK_MAGIC), code,
wParam, lParam );
WH_SHELL is not a valid hook handle, this code is broken (of course it was broken before too).
ShellHookProc is only a win < win95 function and I couldn't find any documentation for it (searching on msdn revealed nothing) so i've made a separat patch for it, but it's a pure guesstimation.
License: LGPL, X11 Changelog: Michael Stefaniuc mstefani@redhat.com - converted HHOOK to a void* - changed the internal HOOK_* functions to pass only HHOOK's between them - fixed wrong HHOOK <-> HANDLE16 conversions
bye michael