I am new to writing drivers. I have just begun on the work of writing
a NDIS protocol driver. As a starting point I am using the sample
protocol driver NDISUIO provided with WINDDK 2600.1106. I have
modified NDISUIO and put some DbgPrint() statements to understand its
behaviour. I build the driver using the build environment provided
with WINDDK on a windows XP sp1 box. I install the driver using
snetcfg utility and load it using net start <driver> command. All this
is successful. I have written a user level program (DriverTest.exe)
that opens the driver using "CreateFile" call and then communicates
with the driver through "DeviceIoControl" calls. All calls are running
perfectly without any problem. The problem is when I try to debug I
cannot see the messages that I am passing through DbgPrint()
statements in my driver. Here is how I am trying to Debug the driver
locally (target and host machine are the same):
1. type kd -kl at the command prompt (symbols are loaded properly, no
error messages)
2. open windbg.exe from Start > Programs > Debugging Tools for Windows
3. open my user level program DriverTest.exe from File > Open
Executable in WindDbg GUI
4. I don't get any error messages, I can press F5 (Go) and get the
program to complete and do intended task but cannot see any messages
in the debugger neither in WinDbg nor in kd
Is there a fundamental mistake in my debugging approach? Where are the
debugging messages sent by DbgPrint() supposed to appear, in kd or
WinDbg? Any help would be appreciated.
Thanks in advance,
James