WPP препроцессор для трассировки UMDF драйвера

см. файл sources в каталоге любого проекта из WinDDK

там есть строки включающие препроцессор для трассировки

RUN_WPP= $(SOURCES) -dll -scan:internal.h
-scan:internal.h a single Scan Configuration Data file
-dll Defines the WPP_DLL macro, which causes the WPP data structures to be initialized whenever WPP_INIT_TRACING is called.

в начале каждого c(cpp) файла можно наблюдать следующие строки :

#include "internal.h"
#include "ваш файл.tmh"

собственно после этого и будет работать Trace

Trace(TRACE_LEVEL_INFORMATION,L" тут ваш текст  %s",s);

по-видимому инфп ниже помогает как-то настраивать уровень трассировки :


#define TRACE_LEVEL_NONE        0   // Tracing is not on
#define TRACE_LEVEL_FATAL       1   // Abnormal exit or termination
#define TRACE_LEVEL_ERROR       2   // Severe errors that need logging
#define TRACE_LEVEL_WARNING     3   // Warnings such as allocation failure
#define TRACE_LEVEL_INFORMATION 4   // Includes non-error cases(for example, Entry-Exit)
#define TRACE_LEVEL_VERBOSE     5   // Detailed traces from intermediate steps
#define TRACE_LEVEL_RESERVED6   6
#define TRACE_LEVEL_RESERVED7   7
#define TRACE_LEVEL_RESERVED8   8
#define TRACE_LEVEL_RESERVED9   9