Pepcid  

dbgPrintf in NT User-mode driver

Jan 29, 1997
Web posted at: 11:30 p.m. EDT

This information is provided "as is", there is no support or guarantee!

Subject: printf() in a User-mode driver

Up

Go to Menu page

Back to J&K Home Page

  // // Add to your SOURCES file-

C_DEFINES=-DUNICODE -DSTRICT

// debug.h

//

#if DBG

#define dbgPrintf( _x_ ) dbgPrintf _x_

#else

#define dbgPrintf( _x_ )

#endif

// debug.c

//

#if DBG

void

dbgPrintf( PCHAR szFormat, ... )

{

char buf[128];

va_list va;

va_start(va, szFormat);

vsprintf(buf, szFormat, va);

va_end(va);

OutputDebugStringA(buf); // NOTE: we use the ASCII, not Unicode version.

}

#endif