5.6.WD_DebugAdd()

Purpose

Sends debug messages to the debug log. Used by the driver code.

Prototype
DWORD WD_DebugAdd(
    HANDLE hWD,
    WD_DEBUG_ADD *pData);
Parameters
NameTypeInput/Output
hWDHANDLEInput
pDataWD_DEBUG_ADD*
dwLevelDWORDInput
dwSectionDWORDInput
pcBufferCHAR[256]Input
Description
NameDescription
hWDHandle to WinDriver's kernel-mode driver as received from WD_Open()[5.2]
pData Pointer to an additional debug information structure:
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.
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.
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);