next up previous contents
Next: 5.6 WD_DebugAdd() Up: 5. General WD_xxx Functions Previous: 5.4 WD_Close()   Contents


5.5 WD_Debug()


PURPOSE

$\bullet$Sets debugging level for collecting debug messages.


PROTOTYPE

DWORD WD_Debug(
    HANDLE hWD,
    WD_DEBUG *pDebug);


PARAMETERS

Name Type Input/Output
$\bullet$hWD HANDLE Input
$\bullet$pDebug WD_DEBUG* Input
$\gg$dwCmd DWORD Input
$\gg$dwLevel DWORD Input
$\gg$dwSection DWORD Input
$\gg$dwLevelMessageBox DWORD Input
$\gg$dwBufferSize DWORD Input


DESCRIPTION

Name Description
hWD The handle to WinDriver's kernel-mode driver received from WD_Open() [5.2]
pDebug Pointer 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);