ReactOS 0.4.15-dev-7842-g558ab78
evntprov.h
Go to the documentation of this file.
1/*
2 * evntprov.h
3 *
4 * This file is part of the ReactOS PSDK package.
5 *
6 * Contributors:
7 * Created by Amine Khaldi.
8 *
9 * THIS SOFTWARE IS NOT COPYRIGHTED
10 *
11 * This source code is offered for use in the public domain. You may
12 * use, modify or distribute it freely.
13 *
14 * This code is distributed in the hope that it will be useful but
15 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
16 * DISCLAIMED. This includes but is not limited to warranties of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 *
19 */
20
21#pragma once
22
23#define _EVNTPROV_
24
25#ifndef EVNTAPI
26#ifndef MIDL_PASS
27#ifdef _EVNT_SOURCE_
28#define EVNTAPI __stdcall
29#else
30#define EVNTAPI DECLSPEC_IMPORT __stdcall
31#endif /* _EVNT_SOURCE_ */
32#endif /* MIDL_PASS */
33#endif /* EVNTAPI */
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
39#define EVENT_MIN_LEVEL (0)
40#define EVENT_MAX_LEVEL (0xff)
41
42#define EVENT_ACTIVITY_CTRL_GET_ID (1)
43#define EVENT_ACTIVITY_CTRL_SET_ID (2)
44#define EVENT_ACTIVITY_CTRL_CREATE_ID (3)
45#define EVENT_ACTIVITY_CTRL_GET_SET_ID (4)
46#define EVENT_ACTIVITY_CTRL_CREATE_SET_ID (5)
47
49
50#define MAX_EVENT_DATA_DESCRIPTORS (128)
51#define MAX_EVENT_FILTER_DATA_SIZE (1024)
52
53#define EVENT_FILTER_TYPE_SCHEMATIZED (0x80000000)
54
55typedef struct _EVENT_DATA_DESCRIPTOR {
60
61typedef struct _EVENT_DESCRIPTOR {
71
72#ifndef _EVNTRACE_
78#endif
79
80typedef struct _EVENT_FILTER_HEADER {
88
89#ifndef _ETW_KM_
90
91typedef VOID
93 _In_ LPCGUID SourceId,
100
101#if (WINVER >= _WIN32_WINNT_VISTA)
102ULONG
105 _In_ LPCGUID ProviderId,
109
110ULONG
114
120
127
128ULONG
135
136ULONG
145
146ULONG
153
154ULONG
159
160#endif /* (WINVER >= _WIN32_WINNT_VISTA) */
161
162#if (WINVER >= _WIN32_WINNT_WIN7)
163ULONG
174#endif
175
176#endif // _ETW_KM_
177
179VOID
181 _Out_ PEVENT_DATA_DESCRIPTOR EventDataDescriptor,
182 _In_reads_bytes_(DataSize) const VOID* DataPtr,
184{
185 EventDataDescriptor->Ptr = (ULONGLONG)(ULONG_PTR)DataPtr;
186 EventDataDescriptor->Size = DataSize;
187 EventDataDescriptor->Reserved = 0;
188}
189
191VOID
194 _In_ USHORT Id,
196 _In_ UCHAR Channel,
198 _In_ USHORT Task,
201{
204 EventDescriptor->Channel = Channel;
206 EventDescriptor->Task = Task;
209}
210
212VOID
215{
217}
218
220USHORT
223{
224 return (EventDescriptor->Id);
225}
226
228UCHAR
231{
232 return (EventDescriptor->Version);
233}
234
236USHORT
239{
240 return (EventDescriptor->Task);
241}
242
244UCHAR
247{
248 return (EventDescriptor->Opcode);
249}
250
252UCHAR
255{
256 return (EventDescriptor->Channel);
257}
258
260UCHAR
263{
264 return (EventDescriptor->Level);
265}
266
271{
272 return (EventDescriptor->Keyword);
273}
274
279 _In_ USHORT Id)
280{
282 return (EventDescriptor);
283}
284
290{
292 return (EventDescriptor);
293}
294
299 _In_ USHORT Task)
300{
301 EventDescriptor->Task = Task;
302 return (EventDescriptor);
303}
304
310{
312 return (EventDescriptor);
313}
314
320{
322 return (EventDescriptor);
323}
324
329 _In_ UCHAR Channel)
330{
331 EventDescriptor->Channel = Channel;
332 return (EventDescriptor);
333}
334
340{
342 return (EventDescriptor);
343}
344
345
351{
353 return (EventDescriptor);
354}
355
356#ifdef __cplusplus
357}
358#endif
DWORD Id
unsigned char BOOLEAN
#define VOID
Definition: acefi.h:82
ULONGLONG REGHANDLE
Definition: evntprov.h:48
FORCEINLINE PEVENT_DESCRIPTOR EventDescSetTask(_In_ PEVENT_DESCRIPTOR EventDescriptor, _In_ USHORT Task)
Definition: evntprov.h:297
FORCEINLINE PEVENT_DESCRIPTOR EventDescSetLevel(_In_ PEVENT_DESCRIPTOR EventDescriptor, _In_ UCHAR Level)
Definition: evntprov.h:317
FORCEINLINE PEVENT_DESCRIPTOR EventDescOrKeyword(_In_ PEVENT_DESCRIPTOR EventDescriptor, _In_ ULONGLONG Keyword)
Definition: evntprov.h:348
FORCEINLINE PEVENT_DESCRIPTOR EventDescSetKeyword(_In_ PEVENT_DESCRIPTOR EventDescriptor, _In_ ULONGLONG Keyword)
Definition: evntprov.h:337
FORCEINLINE PEVENT_DESCRIPTOR EventDescSetId(_In_ PEVENT_DESCRIPTOR EventDescriptor, _In_ USHORT Id)
Definition: evntprov.h:277
#define EVNTAPI
Definition: evntprov.h:30
BOOLEAN EVNTAPI EventProviderEnabled(_In_ REGHANDLE RegHandle, _In_ UCHAR Level, _In_ ULONGLONG Keyword)
FORCEINLINE VOID EventDescCreate(_Out_ PEVENT_DESCRIPTOR EventDescriptor, _In_ USHORT Id, _In_ UCHAR Version, _In_ UCHAR Channel, _In_ UCHAR Level, _In_ USHORT Task, _In_ UCHAR Opcode, _In_ ULONGLONG Keyword)
Definition: evntprov.h:192
VOID(NTAPI * PENABLECALLBACK)(_In_ LPCGUID SourceId, _In_ ULONG IsEnabled, _In_ UCHAR Level, _In_ ULONGLONG MatchAnyKeyword, _In_ ULONGLONG MatchAllKeyword, _In_opt_ PEVENT_FILTER_DESCRIPTOR FilterData, _Inout_opt_ PVOID CallbackContext)
Definition: evntprov.h:92
FORCEINLINE UCHAR EventDescGetLevel(_In_ PCEVENT_DESCRIPTOR EventDescriptor)
Definition: evntprov.h:261
ULONG EVNTAPI EventUnregister(_In_ REGHANDLE RegHandle)
FORCEINLINE USHORT EventDescGetId(_In_ PCEVENT_DESCRIPTOR EventDescriptor)
Definition: evntprov.h:221
ULONG EVNTAPI EventWrite(_In_ REGHANDLE RegHandle, _In_ PCEVENT_DESCRIPTOR EventDescriptor, _In_ ULONG UserDataCount, _In_reads_opt_(UserDataCount) PEVENT_DATA_DESCRIPTOR UserData)
FORCEINLINE PEVENT_DESCRIPTOR EventDescSetOpcode(_In_ PEVENT_DESCRIPTOR EventDescriptor, _In_ UCHAR Opcode)
Definition: evntprov.h:307
FORCEINLINE UCHAR EventDescGetOpcode(_In_ PCEVENT_DESCRIPTOR EventDescriptor)
Definition: evntprov.h:245
FORCEINLINE UCHAR EventDescGetChannel(_In_ PCEVENT_DESCRIPTOR EventDescriptor)
Definition: evntprov.h:253
FORCEINLINE VOID EventDataDescCreate(_Out_ PEVENT_DATA_DESCRIPTOR EventDataDescriptor, _In_reads_bytes_(DataSize) const VOID *DataPtr, _In_ ULONG DataSize)
Definition: evntprov.h:180
ULONGLONG * PREGHANDLE
Definition: evntprov.h:48
ULONG EVNTAPI EventWriteString(_In_ REGHANDLE RegHandle, _In_ UCHAR Level, _In_ ULONGLONG Keyword, _In_ PCWSTR String)
FORCEINLINE USHORT EventDescGetTask(_In_ PCEVENT_DESCRIPTOR EventDescriptor)
Definition: evntprov.h:237
struct _EVENT_DATA_DESCRIPTOR * PEVENT_DATA_DESCRIPTOR
struct _EVENT_FILTER_DESCRIPTOR EVENT_FILTER_DESCRIPTOR
struct _EVENT_DESCRIPTOR * PEVENT_DESCRIPTOR
struct _EVENT_FILTER_HEADER * PEVENT_FILTER_HEADER
ULONG EVNTAPI EventWriteEx(_In_ REGHANDLE RegHandle, _In_ PCEVENT_DESCRIPTOR EventDescriptor, _In_ ULONG64 Filter, _In_ ULONG Flags, _In_opt_ LPCGUID ActivityId, _In_opt_ LPCGUID RelatedActivityId, _In_ ULONG UserDataCount, _In_reads_opt_(UserDataCount) PEVENT_DATA_DESCRIPTOR UserData)
struct _EVENT_DESCRIPTOR EVENT_DESCRIPTOR
FORCEINLINE ULONGLONG EventDescGetKeyword(_In_ PCEVENT_DESCRIPTOR EventDescriptor)
Definition: evntprov.h:269
struct _EVENT_FILTER_DESCRIPTOR * PEVENT_FILTER_DESCRIPTOR
ULONG EVNTAPI EventWriteTransfer(_In_ REGHANDLE RegHandle, _In_ PCEVENT_DESCRIPTOR EventDescriptor, _In_opt_ LPCGUID ActivityId, _In_opt_ LPCGUID RelatedActivityId, _In_ ULONG UserDataCount, _In_reads_opt_(UserDataCount) PEVENT_DATA_DESCRIPTOR UserData)
FORCEINLINE PEVENT_DESCRIPTOR EventDescSetChannel(_In_ PEVENT_DESCRIPTOR EventDescriptor, _In_ UCHAR Channel)
Definition: evntprov.h:327
FORCEINLINE UCHAR EventDescGetVersion(_In_ PCEVENT_DESCRIPTOR EventDescriptor)
Definition: evntprov.h:229
const EVENT_DESCRIPTOR * PCEVENT_DESCRIPTOR
Definition: evntprov.h:70
BOOLEAN EVNTAPI EventEnabled(_In_ REGHANDLE RegHandle, _In_ PCEVENT_DESCRIPTOR EventDescriptor)
FORCEINLINE PEVENT_DESCRIPTOR EventDescSetVersion(_In_ PEVENT_DESCRIPTOR EventDescriptor, _In_ UCHAR Version)
Definition: evntprov.h:287
struct _EVENT_DATA_DESCRIPTOR EVENT_DATA_DESCRIPTOR
struct _EVENT_FILTER_HEADER EVENT_FILTER_HEADER
FORCEINLINE VOID EventDescZero(_Out_ PEVENT_DESCRIPTOR EventDescriptor)
Definition: evntprov.h:213
ULONG EVNTAPI EventActivityIdControl(_In_ ULONG ControlCode, _Inout_ LPGUID ActivityId)
ULONG EVNTAPI EventRegister(_In_ LPCGUID ProviderId, _In_opt_ PENABLECALLBACK EnableCallback, _In_opt_ PVOID CallbackContext, _Out_ PREGHANDLE RegHandle)
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1801
return pProvider IsEnabled(ProviderControl)
_In_ PVOID _In_ ULONG Opcode
Definition: hubbusif.h:331
unsigned __int64 ULONG64
Definition: imports.h:198
#define _In_reads_bytes_(size)
Definition: ms_sal.h:321
#define _Inout_
Definition: ms_sal.h:378
#define _Inout_opt_
Definition: ms_sal.h:379
#define _Out_
Definition: ms_sal.h:345
#define _In_reads_opt_(size)
Definition: ms_sal.h:320
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4755
unsigned short USHORT
Definition: pedump.c:61
#define memset(x, y, z)
Definition: compat.h:39
ULONGLONG Keyword
Definition: evntprov.h:68
ULONGLONG InstanceId
Definition: evntprov.h:84
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define NTAPI
Definition: typedefs.h:36
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
Definition: wdffdo.h:469
#define FORCEINLINE
Definition: wdftypes.h:67
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
_In_ PCEVENT_DESCRIPTOR _In_opt_ LPCGUID _In_ ULONG UserDataCount
Definition: wmifuncs.h:121
_In_opt_ PETWENABLECALLBACK EnableCallback
Definition: wmifuncs.h:76
_In_ PCEVENT_DESCRIPTOR _In_opt_ LPCGUID _In_opt_ LPCGUID RelatedActivityId
Definition: wmifuncs.h:132
_In_ PCEVENT_DESCRIPTOR _In_opt_ LPCGUID ActivityId
Definition: wmifuncs.h:120
_In_opt_ PETWENABLECALLBACK _In_opt_ PVOID _Out_ PREGHANDLE RegHandle
Definition: wmifuncs.h:78
_In_ PCEVENT_DESCRIPTOR EventDescriptor
Definition: wmifuncs.h:93
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR _In_ ULONGLONG _In_ ULONGLONG _In_opt_ PEVENT_FILTER_DESCRIPTOR _Inout_opt_ PVOID CallbackContext
Definition: wmitypes.h:60
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR _In_ ULONGLONG MatchAnyKeyword
Definition: wmitypes.h:57
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR _In_ ULONGLONG _In_ ULONGLONG _In_opt_ PEVENT_FILTER_DESCRIPTOR FilterData
Definition: wmitypes.h:59
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR _In_ ULONGLONG _In_ ULONGLONG MatchAllKeyword
Definition: wmitypes.h:58
_IRQL_requires_same_ typedef _In_ ULONG ControlCode
Definition: wmitypes.h:55
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:56
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
unsigned char UCHAR
Definition: xmlstorage.h:181