Hello,
while trying to convert HHOOK to a void* i found this strangeness: CallNextHookEx16 expects its first parameter to be a real HHOOK, that means it checks the HIWORD of the HHOOK to see it it contains 'HK' if (HIWORD(hhook) != HOOK_MAGIC) return 0; /* Not a new format hook */
In wine there are only 2 functions that call CallNextHookEx16, one is DefHookProc16, the other is ShellHookProc16. The first one calls CallNextHookEx16 with first parameter queue->hCurHook (an HANDLE16), the second one with WH_SHELL (the number 10). This parameters gets implicitly transformed to a HHOOK and will have their HIWORD set to 0, thus CallNextHookEx16 will always fail and return 0.
I don't know what the right fix would be, I'm seeing two possibilities: - remove in CallNextHookEx16 the check if (HIWORD(hhook) != HOOK_MAGIC) return 0; - or transform in DefHookProc16 and ShellHookProc16 the first parameter passed to CallNextHookEx16 to a real HHOOK with the HIWORD set to 'HC'
Comments? bye michael