ReactOS 0.4.16-dev-250-g3ecd236
fxtrace.h File Reference

Go to the source code of this file.

Macros

#define WDF_FX_TRACE_WPPGUID   (544d4c9d,942c,46d5,bf50,df5cd9524a50)
 
#define WDF_FRAMEWORKS_TRACE_FLAGS
 
#define WPP_CONTROL_GUIDS    WDF_FRAMEWORKS_TRACE_FLAGS
 
#define WPP_GLOBALS_LEVEL_FLAGS_LOGGER(globals, lvl, flags)   WPP_LEVEL_LOGGER(flags)
 
#define WPP_GLOBALS_LEVEL_FLAGS_ENABLED(globals, lvl, flags)   (WPP_LEVEL_ENABLED(flags) && WPP_CONTROL(WPP_BIT_ ## flags).Level >= lvl)
 
#define IFR_GLOBALS_LEVEL_FLAGS_FILTER(globals, lvl, flags)   (lvl < TRACE_LEVEL_VERBOSE || globals->FxVerboseOn)
 

Typedefs

typedef struct _WDF_DRIVER_CONFIGPWDF_DRIVER_CONFIG
 

Functions

_Must_inspect_result_ NTSTATUS FxTraceInitialize (VOID)
 
VOID TraceUninitialize (VOID)
 
VOID FxIFRStart (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PCUNICODE_STRING RegistryPath, __in MdDriverObject DriverObject)
 
VOID FxIFRStop (__in PFX_DRIVER_GLOBALS FxDriverGlobals)
 

Macro Definition Documentation

◆ IFR_GLOBALS_LEVEL_FLAGS_FILTER

#define IFR_GLOBALS_LEVEL_FLAGS_FILTER (   globals,
  lvl,
  flags 
)    (lvl < TRACE_LEVEL_VERBOSE || globals->FxVerboseOn)

Definition at line 85 of file fxtrace.h.

◆ WDF_FRAMEWORKS_TRACE_FLAGS

#define WDF_FRAMEWORKS_TRACE_FLAGS
Value:
WPP_DEFINE_WDF_CONTROL_GUID( \
KmdfTraceGuid, \
WPP_DEFINE_BIT(TRACINGFULL) \
WPP_DEFINE_BIT(TRACINGERROR) \
WPP_DEFINE_BIT(TRACINGDBGPRINT) \
WPP_DEFINE_BIT(TRACINGFRAMEWORKS) \
WPP_DEFINE_BIT(TRACINGAPI) \
WPP_DEFINE_BIT(TRACINGAPIERROR) \
WPP_DEFINE_BIT(TRACINGRESOURCES) \
WPP_DEFINE_BIT(TRACINGLOCKING) \
WPP_DEFINE_BIT(TRACINGCONTEXT) \
WPP_DEFINE_BIT(TRACINGPOOL) \
WPP_DEFINE_BIT(TRACINGHANDLE) \
WPP_DEFINE_BIT(TRACINGPNP) \
WPP_DEFINE_BIT(TRACINGIO) \
WPP_DEFINE_BIT(TRACINGIOTARGET) \
WPP_DEFINE_BIT(TRACINGDMA) \
WPP_DEFINE_BIT(TRACINGREQUEST) \
WPP_DEFINE_BIT(TRACINGDRIVER) \
WPP_DEFINE_BIT(TRACINGDEVICE) \
WPP_DEFINE_BIT(TRACINGUSEROBJECT) \
WPP_DEFINE_BIT(TRACINGOBJECT) \
WPP_DEFINE_BIT(TRACINGPNPPOWERSTATES) \
)
#define TRACINGIOTARGET
Definition: dbgtrace.h:72
#define TRACINGPNPPOWERSTATES
Definition: dbgtrace.h:69
#define TRACINGPOOL
Definition: dbgtrace.h:62
#define TRACINGOBJECT
Definition: dbgtrace.h:59
#define TRACINGERROR
Definition: dbgtrace.h:63
#define TRACINGDRIVER
Definition: dbgtrace.h:68
#define TRACINGHANDLE
Definition: dbgtrace.h:61
#define TRACINGIO
Definition: dbgtrace.h:66
#define TRACINGREQUEST
Definition: dbgtrace.h:65
#define TRACINGPNP
Definition: dbgtrace.h:67
#define TRACINGDMA
Definition: dbgtrace.h:71
#define TRACINGDEVICE
Definition: dbgtrace.h:58
#define TRACINGAPIERROR
Definition: dbgtrace.h:60
#define TRACINGUSEROBJECT
Definition: dbgtrace.h:64
#define WDF_FX_TRACE_WPPGUID
Definition: fxtrace.h:37

Definition at line 42 of file fxtrace.h.

◆ WDF_FX_TRACE_WPPGUID

#define WDF_FX_TRACE_WPPGUID   (544d4c9d,942c,46d5,bf50,df5cd9524a50)

Tracing Definitions:

Definition at line 37 of file fxtrace.h.

◆ WPP_CONTROL_GUIDS

#define WPP_CONTROL_GUIDS    WDF_FRAMEWORKS_TRACE_FLAGS

Definition at line 69 of file fxtrace.h.

◆ WPP_GLOBALS_LEVEL_FLAGS_ENABLED

#define WPP_GLOBALS_LEVEL_FLAGS_ENABLED (   globals,
  lvl,
  flags 
)    (WPP_LEVEL_ENABLED(flags) && WPP_CONTROL(WPP_BIT_ ## flags).Level >= lvl)

Definition at line 83 of file fxtrace.h.

◆ WPP_GLOBALS_LEVEL_FLAGS_LOGGER

#define WPP_GLOBALS_LEVEL_FLAGS_LOGGER (   globals,
  lvl,
  flags 
)    WPP_LEVEL_LOGGER(flags)

Definition at line 82 of file fxtrace.h.

Typedef Documentation

◆ PWDF_DRIVER_CONFIG

Definition at line 30 of file fxtrace.h.

Function Documentation

◆ FxIFRStart()

VOID FxIFRStart ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals,
__in PCUNICODE_STRING  RegistryPath,
__in MdDriverObject  DriverObject 
)

Definition at line 220 of file tracing.cpp.

237{
239 ULONG size;
240
242
244
245 //
246 // Return early if IFR is disabled.
247 //
249 ASSERT(FxDriverGlobals->WdfLogHeader == NULL);
250 return;
251 }
252
253 if (FxDriverGlobals == NULL || FxDriverGlobals->WdfLogHeader != NULL) {
254 return;
255 }
256
257 size = FxIFRGetSize(FxDriverGlobals, RegistryPath);
258
260 size,
262 if (pHeader == NULL) {
263 return;
264 }
265
267
268 //
269 // Initialize the header.
270 // Base will be where the IFR records are placed.
271 // WPP_ThisDir_CTLGUID_FrameworksTraceGuid
272 //
273 RtlCopyMemory(&pHeader->Guid, (PVOID) &WdfTraceGuid, sizeof(GUID));
274
275 pHeader->Base = (PUCHAR) &pHeader[1];
276 pHeader->Size = size - sizeof(WDF_IFR_HEADER);
277
278 pHeader->Offset.u.s.Current = 0;
279 pHeader->Offset.u.s.Previous = 0;
280 RtlStringCchCopyA(pHeader->DriverName, WDF_IFR_HEADER_NAME_LEN, FxDriverGlobals->Public.DriverName);
281
282 FxDriverGlobals->WdfLogHeader = pHeader;
283
285 "FxIFR logging started" );
286
287 if (size > FxIFRMinLogSize) {
289 FxDriverGlobals, TRACE_LEVEL_INFORMATION, TRACINGDRIVER,
290 "FxIFR has been started with a size override: size 0x%x bytes, "
291 "# Pages %d. An extended IFR size may not be written to a minidump!",
293 }
294}
#define NULL
Definition: types.h:112
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PAGE_SIZE
Definition: env_spec_w32.h:49
#define NonPagedPool
Definition: env_spec_w32.h:307
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define WDF_IFR_LOG_TAG
Definition: fxifr.h:88
struct _WDF_IFR_HEADER * PWDF_IFR_HEADER
#define WDF_IFR_RECORD_SIGNATURE
Definition: fxifr.h:109
struct _WDF_IFR_HEADER WDF_IFR_HEADER
#define WDF_IFR_HEADER_NAME_LEN
Definition: fxifr.h:42
@ FxIFRMinLogSize
Definition: fxifrkm.h:23
@ FxIFRRecordSignature
Definition: fxifrkm.h:29
GLsizeiptr size
Definition: glext.h:5919
FxContextHeader * pHeader
Definition: handleapi.cpp:604
#define ASSERT(a)
Definition: mode.c:44
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:325
NTSTRSAFEAPI RtlStringCchCopyA(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCSTR pszSrc)
Definition: ntstrsafe.h:110
FxLibraryGlobalsType FxLibraryGlobals
Definition: globals.cpp:95
#define TRACE_LEVEL_INFORMATION
Definition: storswtr.h:29
ULONG FxIFRGetSize(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PCUNICODE_STRING RegistryPath)
Definition: tracing.cpp:134
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define WDFCASSERT(c)
Definition: wdfassert.h:93
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213

◆ FxIFRStop()

VOID FxIFRStop ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals)

Definition at line 297 of file tracing.cpp.

310{
311 //
312 // Return early if IFR is disabled.
313 //
315 ASSERT(FxDriverGlobals->WdfLogHeader == NULL);
316 return;
317 }
318
319 if (FxDriverGlobals == NULL || FxDriverGlobals->WdfLogHeader == NULL) {
320 return;
321 }
322
323 //
324 // Free the Log buffer.
325 //
326 ExFreePoolWithTag( FxDriverGlobals->WdfLogHeader, WDF_IFR_LOG_TAG );
327 FxDriverGlobals->WdfLogHeader = NULL;
328}
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109

◆ FxTraceInitialize()

_Must_inspect_result_ NTSTATUS FxTraceInitialize ( VOID  )

Definition at line 47 of file tracing.cpp.

69{
70 //
71 // Initialize the tracing package: Vista or later
72 //
74
75 return STATUS_SUCCESS;
76}
#define WPP_INIT_TRACING(a, b)
Definition: kdebugprint.h:56
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by FxLibraryCommonCommission().

◆ TraceUninitialize()

VOID TraceUninitialize ( VOID  )

Definition at line 79 of file tracing.cpp.

95{
96 //
97 // Vista and later
98 //
100}
#define WPP_CLEANUP(a)
Definition: kdebugprint.h:57

Referenced by FxLibraryCommonDecommission().