ReactOS 0.4.15-dev-8116-gf69e256
dbgtrace.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TRACE_LEVEL_NONE   0
 
#define TRACE_LEVEL_CRITICAL   1
 
#define TRACE_LEVEL_FATAL   1
 
#define TRACE_LEVEL_ERROR   2
 
#define TRACE_LEVEL_WARNING   3
 
#define TRACE_LEVEL_INFORMATION   4
 
#define TRACE_LEVEL_VERBOSE   5
 
#define TRACE_LEVEL_RESERVED6   6
 
#define TRACE_LEVEL_RESERVED7   7
 
#define TRACE_LEVEL_RESERVED8   8
 
#define TRACE_LEVEL_RESERVED9   9
 
#define TRACINGDEVICE   0x00000001
 
#define TRACINGOBJECT   0x00000002
 
#define TRACINGAPIERROR   0x00000004
 
#define TRACINGHANDLE   0x00000008
 
#define TRACINGPOOL   0x00000010
 
#define TRACINGERROR   0x00000020
 
#define TRACINGUSEROBJECT   0x00000040
 
#define TRACINGREQUEST   0x00000080
 
#define TRACINGIO   0x00000100
 
#define TRACINGPNP   0x00000200
 
#define TRACINGDRIVER   0x00001000
 
#define TRACINGPNPPOWERSTATES   0x00002000
 
#define TRACINGDMA   0x00004000
 
#define TRACINGIOTARGET   0x00008000
 
#define WPP_INIT_TRACING(DriverObject, RegistryPath)
 
#define WPP_CLEANUP(DriverObject)
 

Functions

void __cdecl DoTraceLevelMessage (__in PVOID FxDriverGlobals, __in ULONG DebugPrintLevel, __in ULONG DebugPrintFlag, __drv_formatString(FormatMessage) __in PCSTR DebugMessage,...)
 

Variables

ULONG DebugLevel
 
ULONG DebugFlag
 

Macro Definition Documentation

◆ TRACE_LEVEL_CRITICAL

#define TRACE_LEVEL_CRITICAL   1

Definition at line 42 of file dbgtrace.h.

◆ TRACE_LEVEL_ERROR

#define TRACE_LEVEL_ERROR   2

Definition at line 44 of file dbgtrace.h.

◆ TRACE_LEVEL_FATAL

#define TRACE_LEVEL_FATAL   1

Definition at line 43 of file dbgtrace.h.

◆ TRACE_LEVEL_INFORMATION

#define TRACE_LEVEL_INFORMATION   4

Definition at line 46 of file dbgtrace.h.

◆ TRACE_LEVEL_NONE

#define TRACE_LEVEL_NONE   0

Definition at line 41 of file dbgtrace.h.

◆ TRACE_LEVEL_RESERVED6

#define TRACE_LEVEL_RESERVED6   6

Definition at line 48 of file dbgtrace.h.

◆ TRACE_LEVEL_RESERVED7

#define TRACE_LEVEL_RESERVED7   7

Definition at line 49 of file dbgtrace.h.

◆ TRACE_LEVEL_RESERVED8

#define TRACE_LEVEL_RESERVED8   8

Definition at line 50 of file dbgtrace.h.

◆ TRACE_LEVEL_RESERVED9

#define TRACE_LEVEL_RESERVED9   9

Definition at line 51 of file dbgtrace.h.

◆ TRACE_LEVEL_VERBOSE

#define TRACE_LEVEL_VERBOSE   5

Definition at line 47 of file dbgtrace.h.

◆ TRACE_LEVEL_WARNING

#define TRACE_LEVEL_WARNING   3

Definition at line 45 of file dbgtrace.h.

◆ TRACINGAPIERROR

#define TRACINGAPIERROR   0x00000004

Definition at line 60 of file dbgtrace.h.

◆ TRACINGDEVICE

#define TRACINGDEVICE   0x00000001

Definition at line 58 of file dbgtrace.h.

◆ TRACINGDMA

#define TRACINGDMA   0x00004000

Definition at line 71 of file dbgtrace.h.

◆ TRACINGDRIVER

#define TRACINGDRIVER   0x00001000

Definition at line 68 of file dbgtrace.h.

◆ TRACINGERROR

#define TRACINGERROR   0x00000020

Definition at line 63 of file dbgtrace.h.

◆ TRACINGHANDLE

#define TRACINGHANDLE   0x00000008

Definition at line 61 of file dbgtrace.h.

◆ TRACINGIO

#define TRACINGIO   0x00000100

Definition at line 66 of file dbgtrace.h.

◆ TRACINGIOTARGET

#define TRACINGIOTARGET   0x00008000

Definition at line 72 of file dbgtrace.h.

◆ TRACINGOBJECT

#define TRACINGOBJECT   0x00000002

Definition at line 59 of file dbgtrace.h.

◆ TRACINGPNP

#define TRACINGPNP   0x00000200

Definition at line 67 of file dbgtrace.h.

◆ TRACINGPNPPOWERSTATES

#define TRACINGPNPPOWERSTATES   0x00002000

Definition at line 69 of file dbgtrace.h.

◆ TRACINGPOOL

#define TRACINGPOOL   0x00000010

Definition at line 62 of file dbgtrace.h.

◆ TRACINGREQUEST

#define TRACINGREQUEST   0x00000080

Definition at line 65 of file dbgtrace.h.

◆ TRACINGUSEROBJECT

#define TRACINGUSEROBJECT   0x00000040

Definition at line 64 of file dbgtrace.h.

◆ WPP_CLEANUP

#define WPP_CLEANUP (   DriverObject)

Definition at line 96 of file dbgtrace.h.

◆ WPP_INIT_TRACING

#define WPP_INIT_TRACING (   DriverObject,
  RegistryPath 
)

Definition at line 95 of file dbgtrace.h.

Function Documentation

◆ DoTraceLevelMessage()

void __cdecl DoTraceLevelMessage ( __in PVOID  FxDriverGlobals,
__in ULONG  DebugPrintLevel,
__in ULONG  DebugPrintFlag,
__drv_formatString(FormatMessage) __in PCSTR  DebugMessage,
  ... 
)

Definition at line 34 of file dbgtrace.cpp.

58 {
59#if DBG
60 UNREFERENCED_PARAMETER(FxDriverGlobals);
61
62#define TEMP_BUFFER_SIZE 1024
64 CHAR debugMessageBuffer[TEMP_BUFFER_SIZE];
66
67 va_start(list, DebugMessage);
68
69 if (DebugMessage) {
70
71 //
72 // Using new safe string functions instead of _vsnprintf.
73 // This function takes care of NULL terminating if the message
74 // is longer than the buffer.
75 //
76#if FX_CORE_MODE==FX_CORE_KERNEL_MODE
77 status = RtlStringCbVPrintfA( debugMessageBuffer,
78 sizeof(debugMessageBuffer),
79 DebugMessage,
80 list );
81#else
82 HRESULT hr;
83 hr = StringCbVPrintfA( debugMessageBuffer,
84 sizeof(debugMessageBuffer),
85 DebugMessage,
86 list );
87
88
90 {
92 }
93 else
94 {
96 }
97#endif
98 if(!NT_SUCCESS(status)) {
99
100#if FX_CORE_MODE==FX_CORE_KERNEL_MODE
101 DbgPrint ("WDFTrace: RtlStringCbVPrintfA failed 0x%x\n", status);
102#else
103 OutputDebugString("WDFTrace: Unable to expand: ");
104 OutputDebugString(DebugMessage);
105#endif
106 return;
107 }
108 if (DebugPrintLevel <= TRACE_LEVEL_ERROR ||
109 (DebugPrintLevel <= DebugLevel &&
110 ((DebugPrintFlag & DebugFlag) == DebugPrintFlag))) {
111#if FX_CORE_MODE==FX_CORE_KERNEL_MODE
112 DbgPrint("WDFTrace: %s\n", debugMessageBuffer);
113#else
114 OutputDebugString("WDFTrace: ");
115 OutputDebugString(DebugMessage);
116#endif
117 }
118 }
119 va_end(list);
120
121 return;
122#else
123 UNREFERENCED_PARAMETER(FxDriverGlobals);
124 UNREFERENCED_PARAMETER(DebugPrintLevel);
125 UNREFERENCED_PARAMETER(DebugPrintFlag);
126 UNREFERENCED_PARAMETER(DebugMessage);
127#endif
128}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
LONG NTSTATUS
Definition: precomp.h:26
Definition: list.h:37
ULONG DebugFlag
Definition: fxobject.cpp:44
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSTATUS WinErrorToNtStatus(__in ULONG WinError)
Definition: errtostatus.cpp:60
ULONG DebugLevel
Definition: fbtusb.c:26
#define DbgPrint
Definition: hal.h:12
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define TEMP_BUFFER_SIZE
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
NTSTRSAFEAPI RtlStringCbVPrintfA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat, _In_ va_list argList)
Definition: ntstrsafe.h:1034
#define list
Definition: rosglue.h:35
#define STATUS_SUCCESS
Definition: shellext.h:65
HRESULT hr
Definition: shlfolder.c:183
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
STRSAFEAPI StringCbVPrintfA(STRSAFE_LPSTR pszDest, size_t cbDest, STRSAFE_LPCSTR pszFormat, va_list argList)
Definition: strsafe.h:502
Definition: ps.c:97
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define OutputDebugString
Definition: winbase.h:3890
#define HRESULT_FACILITY(hr)
Definition: winerror.h:79
#define FACILITY_WIN32
Definition: winerror.h:27
#define HRESULT_CODE(hr)
Definition: winerror.h:76
char CHAR
Definition: xmlstorage.h:175

Variable Documentation

◆ DebugFlag

ULONG DebugFlag
extern

Definition at line 44 of file fxobject.cpp.

Referenced by _main(), DoTraceLevelMessage(), and SmExecPgm().

◆ DebugLevel