Does the 32-bit hook get installed
I added debug messages to hook dlls.
I see that both - 32-bit and 64-bit - dlls are loaded into corresponding 32-bit and 64-bit process. I see message: "DLL_PROCESS_ATTACH".
I don't see message: "DLL_PROCESS_DETACH". That means that both - 32-bit and 64-bit - dlls continue to stay loaded into corresponding 32-bit and 64-bit process.
But only 32-bit dll reports about F8/F9 key pressing. 64-bit dll doesn't see that pressing. That means hook procedure is not called.
Following will be interesting for you.
===== Experiment 1 =================================
- I run EasyType.exe;
- I press F9 one time in 32-bit application;
- I close EasyType.exe.
Behavior of 32-bit process is correct. It sees pressing of F9. Code is executed in this 32-bit process. The keyboard layout is correctly activated.
The strange: 12 milliseconds later pressing of this F9 appears in the report of Hook.Controller.64.exe. ?? Hook.64.dll is loaded into Hook.Controller.64.exe and Keyboard_Procedure() is executed in process Hook.Controller.64.exe. Can you explain this? It must be hook chain.
I don't understand why at all this 64-bit Keyboard_Procedure() is executed in another process by another thread. When keyboard input is dedicated for this 32-bit application only. That is not input for Hook.Controller.64.exe.
===== Experiment 2 =================================
- I run EasyType.exe;
- I press F9 one time in 64-bit application;
- I close EasyType.exe.
Keyboard_Procedure() in this 64-bit application is not called.
Keyboard_Procedure() is called in Hook.Controller.32.exe and in Hook.Controller.64.exe. ?? And pressing of F9 appears twice in both of them. ?? Report says: F9 is pressed and 44 milliseconds later - it is pressed again. When I pressed it only once.
Reports of Hook.Controller.32.exe and Hook.Controller.64.exe are identical. Pressing in Hook.Controller.64.exe appears few milliseconds later. Must be, 64-bit Controller is called later in a hook chain.
===============================================
That's all. Can you explain why the behavior is so strange?