Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenevntprov.h
Go to the documentation of this file.
00001 /* 00002 * evntprov.h 00003 * 00004 * This file is part of the ReactOS PSDK package. 00005 * 00006 * Contributors: 00007 * Created by Amine Khaldi. 00008 * 00009 * THIS SOFTWARE IS NOT COPYRIGHTED 00010 * 00011 * This source code is offered for use in the public domain. You may 00012 * use, modify or distribute it freely. 00013 * 00014 * This code is distributed in the hope that it will be useful but 00015 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY 00016 * DISCLAIMED. This includes but is not limited to warranties of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00018 * 00019 */ 00020 00021 #pragma once 00022 00023 #define _EVNTPROV_ 00024 00025 #ifndef EVNTAPI 00026 #ifndef MIDL_PASS 00027 #ifdef _EVNT_SOURCE_ 00028 #define EVNTAPI __stdcall 00029 #else 00030 #define EVNTAPI DECLSPEC_IMPORT __stdcall 00031 #endif /* _EVNT_SOURCE_ */ 00032 #endif /* MIDL_PASS */ 00033 #endif /* EVNTAPI */ 00034 00035 #ifdef __cplusplus 00036 extern "C" { 00037 #endif 00038 00039 #define EVENT_MIN_LEVEL (0) 00040 #define EVENT_MAX_LEVEL (0xff) 00041 00042 #define EVENT_ACTIVITY_CTRL_GET_ID (1) 00043 #define EVENT_ACTIVITY_CTRL_SET_ID (2) 00044 #define EVENT_ACTIVITY_CTRL_CREATE_ID (3) 00045 #define EVENT_ACTIVITY_CTRL_GET_SET_ID (4) 00046 #define EVENT_ACTIVITY_CTRL_CREATE_SET_ID (5) 00047 00048 typedef ULONGLONG REGHANDLE, *PREGHANDLE; 00049 00050 #define MAX_EVENT_DATA_DESCRIPTORS (128) 00051 #define MAX_EVENT_FILTER_DATA_SIZE (1024) 00052 00053 #define EVENT_FILTER_TYPE_SCHEMATIZED (0x80000000) 00054 00055 typedef struct _EVENT_DATA_DESCRIPTOR { 00056 ULONGLONG Ptr; 00057 ULONG Size; 00058 ULONG Reserved; 00059 } EVENT_DATA_DESCRIPTOR, *PEVENT_DATA_DESCRIPTOR; 00060 00061 typedef struct _EVENT_DESCRIPTOR { 00062 USHORT Id; 00063 UCHAR Version; 00064 UCHAR Channel; 00065 UCHAR Level; 00066 UCHAR Opcode; 00067 USHORT Task; 00068 ULONGLONG Keyword; 00069 } EVENT_DESCRIPTOR, *PEVENT_DESCRIPTOR; 00070 typedef const EVENT_DESCRIPTOR *PCEVENT_DESCRIPTOR; 00071 00072 #ifndef _EVNTRACE_ 00073 typedef struct _EVENT_FILTER_DESCRIPTOR { 00074 ULONGLONG Ptr; 00075 ULONG Size; 00076 ULONG Type; 00077 } EVENT_FILTER_DESCRIPTOR, *PEVENT_FILTER_DESCRIPTOR; 00078 #endif 00079 00080 typedef struct _EVENT_FILTER_HEADER { 00081 USHORT Id; 00082 UCHAR Version; 00083 UCHAR Reserved[5]; 00084 ULONGLONG InstanceId; 00085 ULONG Size; 00086 ULONG NextOffset; 00087 } EVENT_FILTER_HEADER, *PEVENT_FILTER_HEADER; 00088 00089 #ifndef _ETW_KM_ 00090 00091 typedef VOID 00092 (NTAPI *PENABLECALLBACK)( 00093 IN LPCGUID SourceId, 00094 IN ULONG IsEnabled, 00095 IN UCHAR Level, 00096 IN ULONGLONG MatchAnyKeyword, 00097 IN ULONGLONG MatchAllKeyword, 00098 IN PEVENT_FILTER_DESCRIPTOR FilterData OPTIONAL, 00099 IN OUT PVOID CallbackContext OPTIONAL); 00100 00101 #if (WINVER >= _WIN32_WINNT_VISTA) 00102 ULONG 00103 EVNTAPI 00104 EventRegister( 00105 IN LPCGUID ProviderId, 00106 IN PENABLECALLBACK EnableCallback OPTIONAL, 00107 IN PVOID CallbackContext OPTIONAL, 00108 OUT PREGHANDLE RegHandle); 00109 00110 ULONG 00111 EVNTAPI 00112 EventUnregister( 00113 IN REGHANDLE RegHandle); 00114 00115 BOOLEAN 00116 EVNTAPI 00117 EventEnabled( 00118 IN REGHANDLE RegHandle, 00119 IN PCEVENT_DESCRIPTOR EventDescriptor); 00120 00121 BOOLEAN 00122 EVNTAPI 00123 EventProviderEnabled( 00124 IN REGHANDLE RegHandle, 00125 IN UCHAR Level, 00126 IN ULONGLONG Keyword); 00127 00128 ULONG 00129 EVNTAPI 00130 EventWrite( 00131 IN REGHANDLE RegHandle, 00132 IN PCEVENT_DESCRIPTOR EventDescriptor, 00133 IN ULONG UserDataCount, 00134 IN PEVENT_DATA_DESCRIPTOR UserData); 00135 00136 ULONG 00137 EVNTAPI 00138 EventWriteTransfer( 00139 IN REGHANDLE RegHandle, 00140 IN PCEVENT_DESCRIPTOR EventDescriptor, 00141 IN LPCGUID ActivityId OPTIONAL, 00142 IN LPCGUID RelatedActivityId OPTIONAL, 00143 IN ULONG UserDataCount, 00144 IN PEVENT_DATA_DESCRIPTOR UserData OPTIONAL); 00145 00146 ULONG 00147 EVNTAPI 00148 EventWriteString( 00149 IN REGHANDLE RegHandle, 00150 IN UCHAR Level, 00151 IN ULONGLONG Keyword, 00152 IN PCWSTR String); 00153 00154 ULONG 00155 EVNTAPI 00156 EventActivityIdControl( 00157 IN ULONG ControlCode, 00158 IN OUT LPGUID ActivityId); 00159 00160 #endif /* (WINVER >= _WIN32_WINNT_VISTA) */ 00161 00162 #if (WINVER >= _WIN32_WINNT_WIN7) 00163 ULONG 00164 EVNTAPI 00165 EventWriteEx( 00166 IN REGHANDLE RegHandle, 00167 IN PCEVENT_DESCRIPTOR EventDescriptor, 00168 IN ULONG64 Filter, 00169 IN ULONG Flags, 00170 IN LPCGUID ActivityId OPTIONAL, 00171 IN LPCGUID RelatedActivityId OPTIONAL, 00172 IN ULONG UserDataCount, 00173 IN PEVENT_DATA_DESCRIPTOR UserData OPTIONAL); 00174 #endif 00175 00176 #endif // _ETW_KM_ 00177 00178 FORCEINLINE 00179 VOID 00180 EventDataDescCreate( 00181 OUT PEVENT_DATA_DESCRIPTOR EventDataDescriptor, 00182 IN const VOID* DataPtr, 00183 IN ULONG DataSize) 00184 { 00185 EventDataDescriptor->Ptr = (ULONGLONG)(ULONG_PTR)DataPtr; 00186 EventDataDescriptor->Size = DataSize; 00187 EventDataDescriptor->Reserved = 0; 00188 } 00189 00190 FORCEINLINE 00191 VOID 00192 EventDescCreate( 00193 OUT PEVENT_DESCRIPTOR EventDescriptor, 00194 IN USHORT Id, 00195 IN UCHAR Version, 00196 IN UCHAR Channel, 00197 IN UCHAR Level, 00198 IN USHORT Task, 00199 IN UCHAR Opcode, 00200 IN ULONGLONG Keyword) 00201 { 00202 EventDescriptor->Id = Id; 00203 EventDescriptor->Version = Version; 00204 EventDescriptor->Channel = Channel; 00205 EventDescriptor->Level = Level; 00206 EventDescriptor->Task = Task; 00207 EventDescriptor->Opcode = Opcode; 00208 EventDescriptor->Keyword = Keyword; 00209 } 00210 00211 FORCEINLINE 00212 VOID 00213 EventDescZero( 00214 OUT PEVENT_DESCRIPTOR EventDescriptor) 00215 { 00216 memset(EventDescriptor, 0, sizeof(EVENT_DESCRIPTOR)); 00217 } 00218 00219 FORCEINLINE 00220 USHORT 00221 EventDescGetId( 00222 IN PCEVENT_DESCRIPTOR EventDescriptor) 00223 { 00224 return (EventDescriptor->Id); 00225 } 00226 00227 FORCEINLINE 00228 UCHAR 00229 EventDescGetVersion( 00230 IN PCEVENT_DESCRIPTOR EventDescriptor) 00231 { 00232 return (EventDescriptor->Version); 00233 } 00234 00235 FORCEINLINE 00236 USHORT 00237 EventDescGetTask( 00238 IN PCEVENT_DESCRIPTOR EventDescriptor) 00239 { 00240 return (EventDescriptor->Task); 00241 } 00242 00243 FORCEINLINE 00244 UCHAR 00245 EventDescGetOpcode( 00246 IN PCEVENT_DESCRIPTOR EventDescriptor) 00247 { 00248 return (EventDescriptor->Opcode); 00249 } 00250 00251 FORCEINLINE 00252 UCHAR 00253 EventDescGetChannel( 00254 IN PCEVENT_DESCRIPTOR EventDescriptor) 00255 { 00256 return (EventDescriptor->Channel); 00257 } 00258 00259 FORCEINLINE 00260 UCHAR 00261 EventDescGetLevel( 00262 IN PCEVENT_DESCRIPTOR EventDescriptor) 00263 { 00264 return (EventDescriptor->Level); 00265 } 00266 00267 FORCEINLINE 00268 ULONGLONG 00269 EventDescGetKeyword( 00270 IN PCEVENT_DESCRIPTOR EventDescriptor) 00271 { 00272 return (EventDescriptor->Keyword); 00273 } 00274 00275 FORCEINLINE 00276 PEVENT_DESCRIPTOR 00277 EventDescSetId( 00278 IN PEVENT_DESCRIPTOR EventDescriptor, 00279 IN USHORT Id) 00280 { 00281 EventDescriptor->Id = Id; 00282 return (EventDescriptor); 00283 } 00284 00285 FORCEINLINE 00286 PEVENT_DESCRIPTOR 00287 EventDescSetVersion( 00288 IN PEVENT_DESCRIPTOR EventDescriptor, 00289 IN UCHAR Version) 00290 { 00291 EventDescriptor->Version = Version; 00292 return (EventDescriptor); 00293 } 00294 00295 FORCEINLINE 00296 PEVENT_DESCRIPTOR 00297 EventDescSetTask( 00298 IN PEVENT_DESCRIPTOR EventDescriptor, 00299 IN USHORT Task) 00300 { 00301 EventDescriptor->Task = Task; 00302 return (EventDescriptor); 00303 } 00304 00305 FORCEINLINE 00306 PEVENT_DESCRIPTOR 00307 EventDescSetOpcode( 00308 IN PEVENT_DESCRIPTOR EventDescriptor, 00309 IN UCHAR Opcode) 00310 { 00311 EventDescriptor->Opcode = Opcode; 00312 return (EventDescriptor); 00313 } 00314 00315 FORCEINLINE 00316 PEVENT_DESCRIPTOR 00317 EventDescSetLevel( 00318 IN PEVENT_DESCRIPTOR EventDescriptor, 00319 IN UCHAR Level) 00320 { 00321 EventDescriptor->Level = Level; 00322 return (EventDescriptor); 00323 } 00324 00325 FORCEINLINE 00326 PEVENT_DESCRIPTOR 00327 EventDescSetChannel( 00328 IN PEVENT_DESCRIPTOR EventDescriptor, 00329 IN UCHAR Channel) 00330 { 00331 EventDescriptor->Channel = Channel; 00332 return (EventDescriptor); 00333 } 00334 00335 FORCEINLINE 00336 PEVENT_DESCRIPTOR 00337 EventDescSetKeyword( 00338 IN PEVENT_DESCRIPTOR EventDescriptor, 00339 IN ULONGLONG Keyword) 00340 { 00341 EventDescriptor->Keyword = Keyword; 00342 return (EventDescriptor); 00343 } 00344 00345 00346 FORCEINLINE 00347 PEVENT_DESCRIPTOR 00348 EventDescOrKeyword( 00349 IN PEVENT_DESCRIPTOR EventDescriptor, 00350 IN ULONGLONG Keyword) 00351 { 00352 EventDescriptor->Keyword |= Keyword; 00353 return (EventDescriptor); 00354 } 00355 00356 #ifdef __cplusplus 00357 } 00358 #endif 00359 Generated on Fri May 25 2012 04:29:59 for ReactOS by
1.7.6.1
|