ReactOS  0.4.15-dev-3698-gce6da82
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 TRACINGPOOL
Definition: dbgtrace.h:62
#define TRACINGDRIVER
Definition: dbgtrace.h:68
#define TRACINGAPIERROR
Definition: dbgtrace.h:60
#define TRACINGPNPPOWERSTATES
Definition: dbgtrace.h:69
#define TRACINGREQUEST
Definition: dbgtrace.h:65
#define TRACINGDMA
Definition: dbgtrace.h:71
#define TRACINGOBJECT
Definition: dbgtrace.h:59
#define TRACINGDEVICE
Definition: dbgtrace.h:58
#define WDF_FX_TRACE_WPPGUID
Definition: fxtrace.h:37
#define TRACINGPNP
Definition: dbgtrace.h:67
#define TRACINGHANDLE
Definition: dbgtrace.h:61
#define TRACINGUSEROBJECT
Definition: dbgtrace.h:64
#define TRACINGIO
Definition: dbgtrace.h:66
#define TRACINGERROR
Definition: dbgtrace.h:63
#define TRACINGIOTARGET
Definition: dbgtrace.h:72

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,
261  WDF_IFR_LOG_TAG );
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!",
292  size, size/PAGE_SIZE);
293  }
294 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
WDFCASSERT(sizeof(WDF_DRIVER_CONFIG_V1_0)==sizeof(WDF_DRIVER_CONFIG_V1_1))
unsigned char * PUCHAR
Definition: retypes.h:3
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:213
#define TRACINGDRIVER
Definition: dbgtrace.h:68
#define TRACE_LEVEL_INFORMATION
Definition: storswtr.h:29
struct _WDF_IFR_HEADER WDF_IFR_HEADER
FxContextHeader * pHeader
Definition: handleapi.cpp:604
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
struct _WDF_IFR_HEADER * PWDF_IFR_HEADER
GLsizeiptr size
Definition: glext.h:5919
#define ASSERT(a)
Definition: mode.c:44
ULONG FxIFRGetSize(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PCUNICODE_STRING RegistryPath)
Definition: tracing.cpp:134
#define WDF_IFR_LOG_TAG
Definition: fxifr.h:88
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PAGE_SIZE
Definition: env_spec_w32.h:49
FxLibraryGlobalsType FxLibraryGlobals
Definition: globals.cpp:95
#define WDF_IFR_HEADER_NAME_LEN
Definition: fxifr.h:42
#define WDF_IFR_RECORD_SIGNATURE
Definition: fxifr.h:109
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
NTSTRSAFEAPI RtlStringCchCopyA(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCSTR pszSrc)
Definition: ntstrsafe.h:110

◆ 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 ASSERT(a)
Definition: mode.c:44
#define WDF_IFR_LOG_TAG
Definition: fxifr.h:88
FxLibraryGlobalsType FxLibraryGlobals
Definition: globals.cpp:95
#define NULL
Definition: types.h:112
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099

◆ 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 NULL
Definition: types.h:112
#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
#define NULL
Definition: types.h:112

Referenced by FxLibraryCommonDecommission().