KWDF driver tracing

I’m trying to update an existing PCI device driver (for Win-XP, 32-bit)
that I originally wrote in 2004 so that it will work also for 64-bit
systems and for Windows7. I’m using the WDF structure as a basis for
this work. So far, I’ve been able to create a driver that can be built,
signed, installed, opened and closed on a 64-bit Windows7 system. The
open (CreateFile) and close calls are apparently working fine. The
ioctls supported by the driver are all returning error code 1 (which I
believe indicates an illegal I/O request code).

Since the ioctls within the driver do not work correctly yet, I’m trying
to use WPP-based tracing to provide visibility in support of the
remaining debug. It has turned out that the use of WPP and tracing has
turned out to be more difficult (for me at least) than writing the
driver in the first place! At the present time I am using
TraceEvents(level,flag,formatstring,…) as the tracing call within the
driver. I have followed the WPP documentation on MSDN and the examples
within the PCIDRV example given in the WDK.

I’ve spent several days on this and at this point I do not understand
what I’m doing wrong. I try using traceview to enable a real-time trace
but I never get any messages to come out. The traceview program
correctly understands my provider (by CTL guid). I specify the path to
the TMH files as well. Then I exercise the driver … which should
generate from traces. Nothing. If, instead, I use tracelog I am able
to “-start” a trace and also set the level and the flags. This method
does produce a small (i.e. 64Kb) trace file but when I view it I see
only a single message … a header. I have never seen anything coming
from my driver. I tried enabling the log before running my driver and
also during a timespan while my driver was active. I seem to always get
a header but nothing else. It seems as if the level and/or flags args
aren’t being processed correctly.

From what I’ve read on the web, there *are* folks using this method
successfully. Are there some updates after the WDF v7.1.0 that are
needed? If not, what must I check to figure out what is (or is not)
going on?

Thanks for any pointers or advice …

Steve B

After endless battle scars from trying to get WPP to work for us, we’ve
essentially given up on it here at OSR…

I’d suggest asking this over on NTDEV, you’re more likely to get the answer
there.

-scott


Scott Noone
Consulting Associate and Chief System Problem Analyst
OSR Open Systems Resources, Inc.
http://www.osronline.com

“Steven Butner” wrote in message news:xxxxx@windbg…

I’m trying to update an existing PCI device driver (for Win-XP, 32-bit)
that I originally wrote in 2004 so that it will work also for 64-bit
systems and for Windows7. I’m using the WDF structure as a basis for
this work. So far, I’ve been able to create a driver that can be built,
signed, installed, opened and closed on a 64-bit Windows7 system. The
open (CreateFile) and close calls are apparently working fine. The
ioctls supported by the driver are all returning error code 1 (which I
believe indicates an illegal I/O request code).

Since the ioctls within the driver do not work correctly yet, I’m trying
to use WPP-based tracing to provide visibility in support of the
remaining debug. It has turned out that the use of WPP and tracing has
turned out to be more difficult (for me at least) than writing the
driver in the first place! At the present time I am using
TraceEvents(level,flag,formatstring,…) as the tracing call within the
driver. I have followed the WPP documentation on MSDN and the examples
within the PCIDRV example given in the WDK.

I’ve spent several days on this and at this point I do not understand
what I’m doing wrong. I try using traceview to enable a real-time trace
but I never get any messages to come out. The traceview program
correctly understands my provider (by CTL guid). I specify the path to
the TMH files as well. Then I exercise the driver … which should
generate from traces. Nothing. If, instead, I use tracelog I am able
to “-start” a trace and also set the level and the flags. This method
does produce a small (i.e. 64Kb) trace file but when I view it I see
only a single message … a header. I have never seen anything coming
from my driver. I tried enabling the log before running my driver and
also during a timespan while my driver was active. I seem to always get
a header but nothing else. It seems as if the level and/or flags args
aren’t being processed correctly.

From what I’ve read on the web, there *are* folks using this method
successfully. Are there some updates after the WDF v7.1.0 that are
needed? If not, what must I check to figure out what is (or is not)
going on?

Thanks for any pointers or advice …

Steve B