Janu Sasi
Janu Sasi

Reputation: 11

using fprintf in windows kernel device driver

I need to make a dump of certain structure in a file in Windows driver. So for the file pointer, I used void pointer and use it in the place of file pointer in fprintf.

The source also build successfully without any compilation error. But when I load the driver, the value stored on that pointer is not printing.

How I should make use of fprintf in Windows driver.

Upvotes: 0

Views: 543

Answers (1)

EFraim
EFraim

Reputation: 13028

You should be using DbgPrintEx inside your device driver.

printf won't be working for you in kernel mode.

DbgPrintEx prints to the kernel's DbgPrint buffer, which can be watched with a kernel debugger like WinDbg or Kd, or, if you want to watch it on the local system, DebugView.

Most of the messages you print to this buffer are filtered out by default, so you want to adjust the filtering, as described in MSDN

Upvotes: 4

Related Questions