CBT HOOK not called sometimes

Hi,

I have a hook dll to implement a CBT global hook which help us identify some specific type of windows creation.
Lets assume the dll is called "a.dll" and that it is is installed by process "a.exe" using SetWindowsHookEx.
Due to performance considerations, the hook should only be installed on processes with name "b.exe".

In the DllMain of "a.dll", when dwReason == DLL_PROCESS_ATTACH I check for the hosting process name and ensure it is either "a.exe" or "b.exe", otherwise I return 0, which ensures the dll is not loaded to that process.

This works great 99% of the time, but seldom we see glitches, where the cbt hook is not being called, and we miss the creation of some of the windows.

Are you familiar with this issue? Can you think of something we are doing wrong?
Do you have a better/fully consistent solution for identifying windows creation?

10x

Dani
Topic archived. No new replies allowed.