Something went wrong. Try again.
Reactos
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359/* * evntprov.h * * This file is part of the ReactOS PSDK package. * * Contributors: * Created by Amine Khaldi. * * THIS SOFTWARE IS NOT COPYRIGHTED * * This source code is offered for use in the public domain. You may * use, modify or distribute it freely. * * This code is distributed in the hope that it will be useful but * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * DISCLAIMED. This includes but is not limited to warranties of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * */
#pragma once
#define _EVNTPROV_
#ifndef EVNTAPI#ifndef MIDL_PASS#ifdef _EVNT_SOURCE_#define EVNTAPI __stdcall#else#define EVNTAPI DECLSPEC_IMPORT __stdcall#endif /* _EVNT_SOURCE_ */#endif /* MIDL_PASS */#endif /* EVNTAPI */
#ifdef __cplusplusextern "C" {#endif
#define EVENT_MIN_LEVEL (0)#define EVENT_MAX_LEVEL (0xff)
#define EVENT_ACTIVITY_CTRL_GET_ID (1)#define EVENT_ACTIVITY_CTRL_SET_ID (2)#define EVENT_ACTIVITY_CTRL_CREATE_ID (3)#define EVENT_ACTIVITY_CTRL_GET_SET_ID (4)#define EVENT_ACTIVITY_CTRL_CREATE_SET_ID (5)
typedef ULONGLONG REGHANDLE, *PREGHANDLE;
#define MAX_EVENT_DATA_DESCRIPTORS (128)#define MAX_EVENT_FILTER_DATA_SIZE (1024)
#define EVENT_FILTER_TYPE_SCHEMATIZED (0x80000000)
typedef struct _EVENT_DATA_DESCRIPTOR { ULONGLONG Ptr; ULONG Size; ULONG Reserved;} EVENT_DATA_DESCRIPTOR, *PEVENT_DATA_DESCRIPTOR;
typedef struct _EVENT_DESCRIPTOR { USHORT Id; UCHAR Version; UCHAR Channel; UCHAR Level; UCHAR Opcode; USHORT Task; ULONGLONG Keyword;} EVENT_DESCRIPTOR, *PEVENT_DESCRIPTOR;typedef const EVENT_DESCRIPTOR *PCEVENT_DESCRIPTOR;
#ifndef _EVNTRACE_typedef struct _EVENT_FILTER_DESCRIPTOR { ULONGLONG Ptr; ULONG Size; ULONG Type;} EVENT_FILTER_DESCRIPTOR, *PEVENT_FILTER_DESCRIPTOR;#endif
typedef struct _EVENT_FILTER_HEADER { USHORT Id; UCHAR Version; UCHAR Reserved[5]; ULONGLONG InstanceId; ULONG Size; ULONG NextOffset;} EVENT_FILTER_HEADER, *PEVENT_FILTER_HEADER;
#ifndef _ETW_KM_
typedef 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);
#if (WINVER >= _WIN32_WINNT_VISTA)ULONGEVNTAPIEventRegister( _In_ LPCGUID ProviderId, _In_opt_ PENABLECALLBACK EnableCallback, _In_opt_ PVOID CallbackContext, _Out_ PREGHANDLE RegHandle);
ULONGEVNTAPIEventUnregister( _In_ REGHANDLE RegHandle);
BOOLEANEVNTAPIEventEnabled( _In_ REGHANDLE RegHandle, _In_ PCEVENT_DESCRIPTOR EventDescriptor);
BOOLEANEVNTAPIEventProviderEnabled( _In_ REGHANDLE RegHandle, _In_ UCHAR Level, _In_ ULONGLONG Keyword);
ULONGEVNTAPIEventWrite( _In_ REGHANDLE RegHandle, _In_ PCEVENT_DESCRIPTOR EventDescriptor, _In_ ULONG UserDataCount, _In_reads_opt_(UserDataCount) PEVENT_DATA_DESCRIPTOR UserData);
ULONGEVNTAPIEventWriteTransfer( _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);
ULONGEVNTAPIEventWriteString( _In_ REGHANDLE RegHandle, _In_ UCHAR Level, _In_ ULONGLONG Keyword, _In_ PCWSTR String);
ULONGEVNTAPIEventActivityIdControl( _In_ ULONG ControlCode, _Inout_ LPGUID ActivityId);
#endif /* (WINVER >= _WIN32_WINNT_VISTA) */
#if (WINVER >= _WIN32_WINNT_WIN7)ULONGEVNTAPIEventWriteEx( _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);#endif
#endif // _ETW_KM_
FORCEINLINEVOIDEventDataDescCreate( _Out_ PEVENT_DATA_DESCRIPTOR EventDataDescriptor, _In_reads_bytes_(DataSize) const VOID* DataPtr, _In_ ULONG DataSize){ EventDataDescriptor->Ptr = (ULONGLONG)(ULONG_PTR)DataPtr; EventDataDescriptor->Size = DataSize; EventDataDescriptor->Reserved = 0;}
FORCEINLINEVOIDEventDescCreate( _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){ EventDescriptor->Id = Id; EventDescriptor->Version = Version; EventDescriptor->Channel = Channel; EventDescriptor->Level = Level; EventDescriptor->Task = Task; EventDescriptor->Opcode = Opcode; EventDescriptor->Keyword = Keyword;}
FORCEINLINEVOIDEventDescZero( _Out_ PEVENT_DESCRIPTOR EventDescriptor){ memset(EventDescriptor, 0, sizeof(EVENT_DESCRIPTOR));}
FORCEINLINEUSHORTEventDescGetId( _In_ PCEVENT_DESCRIPTOR EventDescriptor){ return (EventDescriptor->Id);}
FORCEINLINEUCHAREventDescGetVersion( _In_ PCEVENT_DESCRIPTOR EventDescriptor){ return (EventDescriptor->Version);}
FORCEINLINEUSHORTEventDescGetTask( _In_ PCEVENT_DESCRIPTOR EventDescriptor){ return (EventDescriptor->Task);}
FORCEINLINEUCHAREventDescGetOpcode( _In_ PCEVENT_DESCRIPTOR EventDescriptor){ return (EventDescriptor->Opcode);}
FORCEINLINEUCHAREventDescGetChannel( _In_ PCEVENT_DESCRIPTOR EventDescriptor){ return (EventDescriptor->Channel);}
FORCEINLINEUCHAREventDescGetLevel( _In_ PCEVENT_DESCRIPTOR EventDescriptor){ return (EventDescriptor->Level);}
FORCEINLINEULONGLONGEventDescGetKeyword( _In_ PCEVENT_DESCRIPTOR EventDescriptor){ return (EventDescriptor->Keyword);}
FORCEINLINEPEVENT_DESCRIPTOREventDescSetId( _In_ PEVENT_DESCRIPTOR EventDescriptor, _In_ USHORT Id){ EventDescriptor->Id = Id; return (EventDescriptor);}
FORCEINLINEPEVENT_DESCRIPTOREventDescSetVersion( _In_ PEVENT_DESCRIPTOR EventDescriptor, _In_ UCHAR Version){ EventDescriptor->Version = Version; return (EventDescriptor);}
FORCEINLINEPEVENT_DESCRIPTOREventDescSetTask( _In_ PEVENT_DESCRIPTOR EventDescriptor, _In_ USHORT Task){ EventDescriptor->Task = Task; return (EventDescriptor);}
FORCEINLINEPEVENT_DESCRIPTOREventDescSetOpcode( _In_ PEVENT_DESCRIPTOR EventDescriptor, _In_ UCHAR Opcode){ EventDescriptor->Opcode = Opcode; return (EventDescriptor);}
FORCEINLINEPEVENT_DESCRIPTOREventDescSetLevel( _In_ PEVENT_DESCRIPTOR EventDescriptor, _In_ UCHAR Level){ EventDescriptor->Level = Level; return (EventDescriptor);}
FORCEINLINEPEVENT_DESCRIPTOREventDescSetChannel( _In_ PEVENT_DESCRIPTOR EventDescriptor, _In_ UCHAR Channel){ EventDescriptor->Channel = Channel; return (EventDescriptor);}
FORCEINLINEPEVENT_DESCRIPTOREventDescSetKeyword( _In_ PEVENT_DESCRIPTOR EventDescriptor, _In_ ULONGLONG Keyword){ EventDescriptor->Keyword = Keyword; return (EventDescriptor);}
FORCEINLINEPEVENT_DESCRIPTOREventDescOrKeyword( _In_ PEVENT_DESCRIPTOR EventDescriptor, _In_ ULONGLONG Keyword){ EventDescriptor->Keyword |= Keyword; return (EventDescriptor);}
#ifdef __cplusplus}#endif