How to Support Software Tracing in a Driver

To instrument a driver for software tracing, you must:

  • Modify the Sources file to run the WPP preprocessor.

  • Include TMH files.

  • Define the control GUID and message trace flags.

  • Add macros to initialize and clean up tracing.

  • Instrument the driver code to generate trace messages at appropriate points.

This section examines the mechanics of implementing WPP software tracing in a WDF driver. Both UMDF and KMDF drivers require essentially the same procedures, although some of the WPP macros are defined differently for user mode than for kernel mode.

Modify Sources to Run the WPP Preprocessor

WPP is integrated into the WDK build environment, but you must explicitly instruct the WDK build utility to run the WPP preprocessor. ...

Get Developing Drivers with the Windows® Driver Foundation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.