next up previous contents
Next: 5.7 WD_DebugDump() Up: 5. General WD_xxx Functions Previous: 5.5 WD_Debug()   Contents


5.6 WD_DebugAdd()


PURPOSE

$\bullet$Sends debug messages to the debug log. Used by the driver code.


PROTOTYPE

DWORD WD_DebugAdd(
    HANDLE hWD,
    WD_DEBUG_ADD *pData);


PARAMETERS

Name Type Input/Output
$\bullet$hWD HANDLE Input
$\bullet$pData WD_DEBUG_ADD*  
$\gg$dwLevel DWORD Input
$\gg$dwSection DWORD Input
$\gg$pcBuffer CHAR [256] Input


DESCRIPTION

Name Description
hWD Handle to WinDriver's kernel-mode driver as received from WD_Open() [5.2]
pData Pointer to an additional debug information structure:
$\bullet$ dwLevel Assigns the level in the Debug Monitor, in which the data will be declared.
If dwLevel is zero, D_ERROR will be declared.
For more details please refer to DEBUG_LEVEL in windrvr.h.
$\bullet$ dwSection Assigns the section in the Debug Monitor, in which the data will be declared.
If dwSection is zero, S_MISC section will be declared.
For more details please refer to DEBUG_SECTION in windrvr.h.
$\bullet$ pcBuffer The string to copy into the message log.


RETURN VALUE

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


EXAMPLE

WD_DEBUG_ADD add;

BZERO(add);
add.dwLevel = D_WARN;
add.dwSection = S_MISC;
sprintf(add.pcBuffer, "This message will be displayed in "
    "the debug monitor\n");
WD_DebugAdd(hWD, &add);