Dmitry Timoshkov wrote:
On Wed, 2006-01-25 at 17:32 -0500, Alex Villacís Lasso wrote:
- if (This == NULL) {
ERR("mouse hook called with no current lock!\n");
return 0;
- }
- if (code != HC_ACTION) return CallNextHookEx( This->hook, code,
wparam, lparam );
You need to call CallNextHookEx in any case, otherwise it might break other hooks in the chain. Probably just add a check for This being NULL in the same place as the code checks for HC_ACTION.
The problem is that if (This == NULL), then This->hook cannot be evaluated (for CallNextHookEx) without generating a segmentation fault. This is the very situation the patch is trying to prevent.
Alex Villacís Lasso