Debian Codegraph @

src/gallium/frontends/mediafoundation/wppconfig/rev1/header.tpl

raw
1 `**********************************************************************`
2 `* This is an include template file for the tracewpp preprocessor. *`
3 `* *`
4 `* Copyright (c) Microsoft Corporation. All rights reserved. *`
5 `**********************************************************************`
6 // template `TemplateFile`
7
8 `* Dump definitions specified via -D on the command line to WPP *`
9 `FORALL def IN MacroDefinitions`
10 #define `def.Name` `def.Alias`
11 `ENDFOR`
12
13 #define WPP_THIS_FILE `SourceFile.CanonicalName`
14
15 #ifndef WPP_IsValidSid
16 #define WPP_IsValidSid IsValidSid
17 #endif
18 #ifndef WPP_GetLengthSid
19 #define WPP_GetLengthSid GetLengthSid
20 #endif
21
22 #if !defined(WPP_KERNEL_MODE)
23 # include <windows.h>
24 # pragma warning(disable: 4201)
25 # include <wmistr.h>
26 # include <evntrace.h>
27 # define WPP_TRACE TraceMessage
28 #else
29 #define WPP_TRACE WmiTraceMessage
30 #endif
31
32 #if !defined(WPP_PRIVATE)
33 # define WPP_INLINE __inline
34 # define WPP_SELECT_ANY extern "C" __declspec(selectany)
35 #else
36 # define WPP_INLINE static
37 # define WPP_SELECT_ANY static
38 #endif
39
40 __inline TRACEHANDLE WppQueryLogger(_In_opt_ PCWSTR LoggerName)
41 {
42 {
43 #if defined(WPP_KERNEL_MODE)
44 ULONG ReturnLength ;
45 NTSTATUS Status ;
46 TRACEHANDLE TraceHandle ;
47 UNICODE_STRING Buffer ;
48
49 RtlInitUnicodeString(&Buffer, LoggerName ? LoggerName : L"stdout");
50
51 if ((Status = WmiQueryTraceInformation(TraceHandleByNameClass,
52 (PVOID)&TraceHandle,
53 sizeof(TraceHandle),
54 &ReturnLength,
55 (PVOID)&Buffer)) == STATUS_SUCCESS) {
56 return TraceHandle ;
57 }
58 #else
59 ULONG status;
60 EVENT_TRACE_PROPERTIES LoggerInfo;
61
62 ZeroMemory(&LoggerInfo, sizeof(LoggerInfo));
63 LoggerInfo.Wnode.BufferSize = sizeof(LoggerInfo);
64 LoggerInfo.Wnode.Flags = WNODE_FLAG_TRACED_GUID;
65
66 status = QueryTraceW(0, LoggerName ? LoggerName : L"stdout", &LoggerInfo);
67 if (status == ERROR_SUCCESS || status == ERROR_MORE_DATA) {
68 return (TRACEHANDLE) LoggerInfo.Wnode.HistoricalContext;
69 }
70 #endif
71 }
72 return 0;
73 }