DebugProc

3.1

  LRESULT CALLBACK DebugProc(code, wParam, lParam)    
  int code; /* hook code */
  WPARAM wParam; /* type of hook about to be called */
  LPARAM lParam; /* address of structure with debugging information */

The DebugProc function is a library-defined callback function that the system calls before calling any other filter installed by the SetWindowsHookEx function. The system passes information about the filter about to be called to the DebugProc callback function. The callback function can examine the information and determine whether to allow the filter to be called.

Parameters

code

Specifies the hook code. Currently, HC_ACTION is the only positive valid value. If this parameter is less than zero, the callback function must call the CallNextHookEx function without any further processing.

wParam

Specifies the task handle of the task that installed the filter about to be called.

lParam

Contains a long pointer to a DEBUGHOOKINFO structure. The DEBUGHOOKINFO structure has the following form:

typedef struct tagDEBUGHOOKINFO {
    HMODULE hModuleHook;
    LPARAM  reserved;
    LPARAM  lParam;
    WPARAM  wParam;
    int     code;
} DEBUGHOOKINFO;

For a full description of this structure, see the Microsoft Windows Programmer's Reference, Volume 3.

Return Value

The callback function should return TRUE to prevent the system from calling another filter. Otherwise, the callback function must pass the filter information to the CallNextHookEx function.

Comments

An application must install this callback function by specifying the WH_DEBUG filter type and the procedure-instance address of the callback function in a call to the SetWindowsHookEx function.

CallWndProc is a placeholder for the library-defined function name. The actual name must be exported by including it in an EXPORTS statement in the library's module-definition file.

See Also

CallNextHookEx, SetWindowsHookEx