Hi,
I am trying to get WPP Trace functionality added to a NDIS miniport driver
written for Windows 2000 in C++? Does any one have any samples? Since my code
was not compiliing I tried putting the WPP macros in a .C file. Then I called
these function from the C++ code. The code compiles but I don't see any
messages. I know I have the traceview configured properly. In addition, when
I try to check if WPP is activated using WPP_LEVEL_ENABLED macro, it returns
false. Any ideas?

I call WPP_SYSCONTROL first in driver entry then WPP_INIT_TRACE in my
initialize function. I use the PDEVICE_OBJECT returned from
NdisMRegisterDevice function.

Shreyash

Re: Ndis Miniport Driver with WPP by Eliyas

Eliyas
Sun Sep 11 21:57:24 CDT 2005

Event tracing on Windows 2000 is not as straight forward as it's on XP and
later OSes. If you go thru the toaster/feature2 function driver, you will
reallize that you have to jump thru few hoops to get the tracing. To list
few: you have to use a device object to init tracing as opposed to
DriverObject; initialization has to happen in the context of start device as
opposed to DriverEntry; have to handle WMI irps to enable/disable tracing
events. Now doing all this in a NDIS miniport driver is not easy, especially
handling WMI irps unless you override the dispatch routines set by NDIS -
not a good thing to do.

I tried out tracing in one of my NDIS miniport drivers and got it to work on
XP. The steps to implement tracing in a NDIS miniport driver is no different
from a WDM driver when it comes to XP and later OSes.

> I call WPP_SYSCONTROL first in driver entry then WPP_INIT_TRACE in my
> initialize function. I use the PDEVICE_OBJECT returned from
> NdisMRegisterDevice function.
>

I don't have access to DDK now but I think WPP_SYSCONTROL sets it own
routine for handling sys-control irps. Now after calling this macro, if you
call NDIS to register your miniport, it's going to override what ever is set
in the DriverObject's dispatch handler with it's own handler. May be that
the tracing is not working in your case.
--
--
-Eliyas
This posting is provided "AS IS" with no warranties, and confers no rights.
http://www.microsoft.com/whdc/driver/default.mspx
http://www.microsoft.com/whdc/driver/kernel/KB-drv.mspx