| Previous | Next |
| ERROR_INVALID_HOOK_FILTER | ERROR_HOOK_NEEDS_HMOD |
ERROR_INVALID_FILTER_PROC
The hook callback is invalid
A Windows hook requires a HOOKPROC-compatible callback with code lifetime that covers the installed hook. Depending on scope, the procedure may need to reside in a DLL so it can execute in the context required by the hook mechanism.
This status is a strong signal to inspect the procedure pointer and module lifetime before debugging event traffic. Unloaded DLL code, incorrect calling conventions/signatures in foreign-function interfaces, or passing a data pointer as the callback can all make the procedure invalid.
What to check
- Confirm the callback address is executable code with the documented hook procedure signature.
- Keep the containing module loaded for the complete hook lifetime.
- For cross-process or global scope, satisfy the DLL placement rules of
SetWindowsHookEx. - Check FFI/delegate pinning so managed or dynamic callbacks cannot move or be collected.
If the callback is valid but a required module handle was omitted, ERROR_HOOK_NEEDS_HMOD is the more specific scope/configuration failure.
References
Looking for a different code? Search another status or error code.