5.5. WD_Debug()

Purpose

Sets debugging level for collecting debug messages.

Prototype
DWORD WD_Debug(
    HANDLE hWD,
    WD_DEBUG *pDebug);
Parameters
NameTypeInput/Output
hWDHANDLEInput
pDebugWD_DEBUG*Input
• dwCmdDWORDInput
• dwLevelDWORDInput
• dwSectionDWORDInput
• dwLevelMessageBoxDWORDInput
• dwBufferSizeDWORDInput
Description
NameDescription
hWDHandle to WinDriver's kernel-mode driver as received from WD_Open() [5.2]
pDebugPointer to a debug information structure:
• dwCmd Debug command: Set filter, Clear buffer, etc.
For more details please refer to DEBUG_COMMAND in windrvr.h.
• dwLevel Used for dwCmd=DEBUG_SET_FILTER. Sets the debugging level to collect: Error, Warning, Info, Trace.
For more details please refer to DEBUG_LEVEL in windrvr.h.
• dwSection Used for dwCmd=DEBUG_SET_FILTER. Sets the sections to collect: I/O, Memory, Interrupt, etc. Use S_ALL for all.
For more details please refer to DEBUG_SECTION in windrvr.h.
• dwLevelMessageBox Used for dwCmd=DEBUG_SET_FILTER. Sets the debugging level to print in a message box.
For more details please refer to DEBUG_LEVEL in windrvr.h.
• dwBufferSize Used for dwCmd=DEBUG_SET_BUFFER. The size of buffer in the kernel.
Return Value

Returns WD_STATUS_SUCCESS (0) on success, or an appropriate error code otherwise [A].

Example
WD_DEBUG dbg;

BZERO(dbg);
dbg.dwCmd = DEBUG_SET_FILTER;
dbg.dwLevel = D_ERROR;
dbg.dwSection = S_ALL;
dbg.dwLevelMessageBox = D_ERROR;

WD_Debug(hWD, &dbg);