forked from php/pecl-caching-wincache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwincache_etw.h
709 lines (572 loc) · 20.9 KB
/
wincache_etw.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
//**********************************************************************`
//* This is an include file generated by Message Compiler. *`
//* *`
//* Copyright (c) Microsoft Corporation. All Rights Reserved. *`
//**********************************************************************`
#pragma once
#include <wmistr.h>
#include <evntrace.h>
#include "evntprov.h"
//
// Initial Defs
//
#if !defined(ETW_INLINE)
#define ETW_INLINE DECLSPEC_NOINLINE __inline
#endif
#if defined(__cplusplus)
extern "C" {
#endif
//
// Allow Diasabling of code generation
//
#ifndef MCGEN_DISABLE_PROVIDER_CODE_GENERATION
#if !defined(McGenDebug)
#define McGenDebug(a,b)
#endif
#if !defined(MCGEN_TRACE_CONTEXT_DEF)
#define MCGEN_TRACE_CONTEXT_DEF
typedef struct _MCGEN_TRACE_CONTEXT
{
TRACEHANDLE RegistrationHandle;
TRACEHANDLE Logger;
ULONGLONG MatchAnyKeyword;
ULONGLONG MatchAllKeyword;
ULONG Flags;
ULONG IsEnabled;
UCHAR Level;
UCHAR Reserve;
USHORT EnableBitsCount;
PULONG EnableBitMask;
const ULONGLONG* EnableKeyWords;
const UCHAR* EnableLevel;
} MCGEN_TRACE_CONTEXT, *PMCGEN_TRACE_CONTEXT;
#endif
#if !defined(MCGEN_LEVEL_KEYWORD_ENABLED_DEF)
#define MCGEN_LEVEL_KEYWORD_ENABLED_DEF
FORCEINLINE
BOOLEAN
McGenLevelKeywordEnabled(
_In_ PMCGEN_TRACE_CONTEXT EnableInfo,
_In_ UCHAR Level,
_In_ ULONGLONG Keyword
)
{
//
// Check if the event Level is lower than the level at which
// the channel is enabled.
// If the event Level is 0 or the channel is enabled at level 0,
// all levels are enabled.
//
if ((Level <= EnableInfo->Level) || // This also covers the case of Level == 0.
(EnableInfo->Level == 0)) {
//
// Check if Keyword is enabled
//
if ((Keyword == (ULONGLONG)0) ||
((Keyword & EnableInfo->MatchAnyKeyword) &&
((Keyword & EnableInfo->MatchAllKeyword) == EnableInfo->MatchAllKeyword))) {
return TRUE;
}
}
return FALSE;
}
#endif
#if !defined(MCGEN_EVENT_ENABLED_DEF)
#define MCGEN_EVENT_ENABLED_DEF
FORCEINLINE
BOOLEAN
McGenEventEnabled(
_In_ PMCGEN_TRACE_CONTEXT EnableInfo,
_In_ PCEVENT_DESCRIPTOR EventDescriptor
)
{
return McGenLevelKeywordEnabled(EnableInfo, EventDescriptor->Level, EventDescriptor->Keyword);
}
#endif
//
// EnableCheckMacro
//
#ifndef MCGEN_ENABLE_CHECK
#define MCGEN_ENABLE_CHECK(Context, Descriptor) (Context.IsEnabled && McGenEventEnabled(&Context, &Descriptor))
#endif
#if !defined(MCGEN_CONTROL_CALLBACK)
#define MCGEN_CONTROL_CALLBACK
DECLSPEC_NOINLINE __inline
VOID
__stdcall
McGenControlCallbackV2(
_In_ LPCGUID SourceId,
_In_ ULONG ControlCode,
_In_ UCHAR Level,
_In_ ULONGLONG MatchAnyKeyword,
_In_ ULONGLONG MatchAllKeyword,
_In_opt_ PEVENT_FILTER_DESCRIPTOR FilterData,
_Inout_opt_ PVOID CallbackContext
)
/*++
Routine Description:
This is the notification callback for Vista.
Arguments:
SourceId - The GUID that identifies the session that enabled the provider.
ControlCode - The parameter indicates whether the provider
is being enabled or disabled.
Level - The level at which the event is enabled.
MatchAnyKeyword - The bitmask of keywords that the provider uses to
determine the category of events that it writes.
MatchAllKeyword - This bitmask additionally restricts the category
of events that the provider writes.
FilterData - The provider-defined data.
CallbackContext - The context of the callback that is defined when the provider
called EtwRegister to register itself.
Remarks:
ETW calls this function to notify provider of enable/disable
--*/
{
PMCGEN_TRACE_CONTEXT Ctx = (PMCGEN_TRACE_CONTEXT)CallbackContext;
ULONG Ix;
#ifndef MCGEN_PRIVATE_ENABLE_CALLBACK_V2
UNREFERENCED_PARAMETER(SourceId);
UNREFERENCED_PARAMETER(FilterData);
#endif
if (Ctx == NULL) {
return;
}
switch (ControlCode) {
case EVENT_CONTROL_CODE_ENABLE_PROVIDER:
Ctx->Level = Level;
Ctx->MatchAnyKeyword = MatchAnyKeyword;
Ctx->MatchAllKeyword = MatchAllKeyword;
Ctx->IsEnabled = EVENT_CONTROL_CODE_ENABLE_PROVIDER;
for (Ix = 0; Ix < Ctx->EnableBitsCount; Ix += 1) {
if (McGenLevelKeywordEnabled(Ctx, Ctx->EnableLevel[Ix], Ctx->EnableKeyWords[Ix]) != FALSE) {
Ctx->EnableBitMask[Ix >> 5] |= (1 << (Ix % 32));
} else {
Ctx->EnableBitMask[Ix >> 5] &= ~(1 << (Ix % 32));
}
}
break;
case EVENT_CONTROL_CODE_DISABLE_PROVIDER:
Ctx->IsEnabled = EVENT_CONTROL_CODE_DISABLE_PROVIDER;
Ctx->Level = 0;
Ctx->MatchAnyKeyword = 0;
Ctx->MatchAllKeyword = 0;
if (Ctx->EnableBitsCount > 0) {
RtlZeroMemory(Ctx->EnableBitMask, (((Ctx->EnableBitsCount - 1) / 32) + 1) * sizeof(ULONG));
}
break;
default:
break;
}
#ifdef MCGEN_PRIVATE_ENABLE_CALLBACK_V2
//
// Call user defined callback
//
MCGEN_PRIVATE_ENABLE_CALLBACK_V2(
SourceId,
ControlCode,
Level,
MatchAnyKeyword,
MatchAllKeyword,
FilterData,
CallbackContext
);
#endif
return;
}
#endif
#endif // MCGEN_DISABLE_PROVIDER_CODE_GENERATION
//+
// Provider PHP-Wincache Event Count 11
//+
EXTERN_C __declspec(selectany) const GUID PhpWinCacheEtwProvider = {0xf7ad0093, 0xd5c3, 0x46b9, {0xbe, 0xea, 0xa9, 0xfc, 0xec, 0x7e, 0x14, 0x08}};
//
// Keyword
//
#define INIT_KEYWORD 0x1
#define MEMORY_KEYWORD 0x2
#define LOCKS_KEYWORD 0x4
#define OPCODE_KEYWORD 0x8
#define FCACHE_KEYWORD 0x10
#define ZCACHE_KEYWORD 0x20
#define SESSION_KEYWORD 0x40
//
// Event Descriptors
//
EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR ModuleInitErrorEvent = {0x1, 0x0, 0x0, 0x2, 0x0, 0x0, 0x1};
#define ModuleInitErrorEvent_value 0x1
EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR InitMutexErrorEvent = {0x2, 0x0, 0x0, 0x2, 0x0, 0x0, 0x1};
#define InitMutexErrorEvent_value 0x2
EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR InitOpcacheLocalFallbackEvent = {0x3, 0x0, 0x0, 0x4, 0x0, 0x0, 0x1};
#define InitOpcacheLocalFallbackEvent_value 0x3
EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR MemBlockNotInUse = {0xa, 0x0, 0x0, 0x2, 0x0, 0x0, 0x2};
#define MemBlockNotInUse_value 0xa
EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR MemFreeAddrNotInSegment = {0xb, 0x0, 0x0, 0x2, 0x0, 0x0, 0x2};
#define MemFreeAddrNotInSegment_value 0xb
EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR MemCombineNonFreeBlock = {0xc, 0x0, 0x0, 0x2, 0x0, 0x0, 0x2};
#define MemCombineNonFreeBlock_value 0xc
EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR MemFreeListCorrupt = {0xd, 0x0, 0x0, 0x2, 0x0, 0x0, 0x2};
#define MemFreeListCorrupt_value 0xd
EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR LockAbandonedMutex = {0x14, 0x0, 0x0, 0x2, 0x0, 0x0, 0x4};
#define LockAbandonedMutex_value 0x14
EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR LockFailedWaitForLock = {0x15, 0x0, 0x0, 0x2, 0x0, 0x0, 0x4};
#define LockFailedWaitForLock_value 0x15
EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR UnlockAbandonedMutex = {0x16, 0x0, 0x0, 0x2, 0x0, 0x0, 0x4};
#define UnlockAbandonedMutex_value 0x16
EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR UnlockFailedWaitForLock = {0x17, 0x0, 0x0, 0x2, 0x0, 0x0, 0x4};
#define UnlockFailedWaitForLock_value 0x17
//
// Note on Generate Code from Manifest Windows Vista and above
//
//Structures : are handled as a size and pointer pairs. The macro for the event will have an extra
//parameter for the size in bytes of the structure. Make sure that your structures have no extra padding.
//
//Strings: There are several cases that can be described in the manifest. For array of variable length
//strings, the generated code will take the count of characters for the whole array as an input parameter.
//
//SID No support for array of SIDs, the macro will take a pointer to the SID and use appropriate
//GetLengthSid function to get the length.
//
//
// Allow Diasabling of code generation
//
#ifndef MCGEN_DISABLE_PROVIDER_CODE_GENERATION
//
// Globals
//
//
// Event Enablement Bits
//
EXTERN_C __declspec(selectany) DECLSPEC_CACHEALIGN ULONG PHP_WincacheEnableBits[1];
EXTERN_C __declspec(selectany) const ULONGLONG PHP_WincacheKeywords[4] = {0x1, 0x1, 0x2, 0x4};
EXTERN_C __declspec(selectany) const UCHAR PHP_WincacheLevels[4] = {2, 4, 2, 2};
EXTERN_C __declspec(selectany) MCGEN_TRACE_CONTEXT PhpWinCacheEtwProvider_Context = {0, 0, 0, 0, 0, 0, 0, 0, 4, PHP_WincacheEnableBits, PHP_WincacheKeywords, PHP_WincacheLevels};
EXTERN_C __declspec(selectany) REGHANDLE PHP_WincacheHandle = (REGHANDLE)0;
#if !defined(McGenEventRegisterUnregister)
#define McGenEventRegisterUnregister
DECLSPEC_NOINLINE __inline
ULONG __stdcall
McGenEventRegister(
_In_ LPCGUID ProviderId,
_In_opt_ PENABLECALLBACK EnableCallback,
_In_opt_ PVOID CallbackContext,
_Inout_ PREGHANDLE RegHandle
)
/*++
Routine Description:
This function register the provider with ETW USER mode.
Arguments:
ProviderId - Provider Id to be register with ETW.
EnableCallback - Callback to be used.
CallbackContext - Context for this provider.
RegHandle - Pointer to Registration handle.
Remarks:
If the handle != NULL will return ERROR_SUCCESS
--*/
{
ULONG Error;
if (*RegHandle) {
//
// already registered
//
return ERROR_SUCCESS;
}
Error = EventRegister( ProviderId, EnableCallback, CallbackContext, RegHandle);
return Error;
}
DECLSPEC_NOINLINE __inline
ULONG __stdcall
McGenEventUnregister(_Inout_ PREGHANDLE RegHandle)
/*++
Routine Description:
Unregister from ETW USER mode
Arguments:
RegHandle this is the pointer to the provider context
Remarks:
If Provider has not register RegHandle = NULL,
return ERROR_SUCCESS
--*/
{
ULONG Error;
if(!(*RegHandle)) {
//
// Provider has not registerd
//
return ERROR_SUCCESS;
}
Error = EventUnregister(*RegHandle);
*RegHandle = (REGHANDLE)0;
return Error;
}
#endif
//
// Register with ETW Vista +
//
#ifndef EventRegisterPHP_Wincache
#define EventRegisterPHP_Wincache() McGenEventRegister(&PhpWinCacheEtwProvider, McGenControlCallbackV2, &PhpWinCacheEtwProvider_Context, &PHP_WincacheHandle)
#endif
//
// UnRegister with ETW
//
#ifndef EventUnregisterPHP_Wincache
#define EventUnregisterPHP_Wincache() McGenEventUnregister(&PHP_WincacheHandle)
#endif
//
// Enablement check macro for ModuleInitErrorEvent
//
#define EventEnabledModuleInitErrorEvent() ((PHP_WincacheEnableBits[0] & 0x00000001) != 0)
//
// Event Macro for ModuleInitErrorEvent
//
#define EventWriteModuleInitErrorEvent(Error)\
EventEnabledModuleInitErrorEvent() ?\
Template_x(PHP_WincacheHandle, &ModuleInitErrorEvent, Error)\
: ERROR_SUCCESS\
//
// Enablement check macro for InitMutexErrorEvent
//
#define EventEnabledInitMutexErrorEvent() ((PHP_WincacheEnableBits[0] & 0x00000001) != 0)
//
// Event Macro for InitMutexErrorEvent
//
#define EventWriteInitMutexErrorEvent(Name, Handle)\
EventEnabledInitMutexErrorEvent() ?\
Template_sp(PHP_WincacheHandle, &InitMutexErrorEvent, Name, Handle)\
: ERROR_SUCCESS\
//
// Enablement check macro for InitOpcacheLocalFallbackEvent
//
#define EventEnabledInitOpcacheLocalFallbackEvent() ((PHP_WincacheEnableBits[0] & 0x00000002) != 0)
//
// Event Macro for InitOpcacheLocalFallbackEvent
//
#define EventWriteInitOpcacheLocalFallbackEvent()\
EventEnabledInitOpcacheLocalFallbackEvent() ?\
TemplateEventDescriptor(PHP_WincacheHandle, &InitOpcacheLocalFallbackEvent)\
: ERROR_SUCCESS\
//
// Enablement check macro for MemBlockNotInUse
//
#define EventEnabledMemBlockNotInUse() ((PHP_WincacheEnableBits[0] & 0x00000004) != 0)
//
// Event Macro for MemBlockNotInUse
//
#define EventWriteMemBlockNotInUse(Block, AllocContext, File, Line)\
EventEnabledMemBlockNotInUse() ?\
Template_ppsq(PHP_WincacheHandle, &MemBlockNotInUse, Block, AllocContext, File, Line)\
: ERROR_SUCCESS\
//
// Enablement check macro for MemFreeAddrNotInSegment
//
#define EventEnabledMemFreeAddrNotInSegment() ((PHP_WincacheEnableBits[0] & 0x00000004) != 0)
//
// Event Macro for MemFreeAddrNotInSegment
//
#define EventWriteMemFreeAddrNotInSegment(Block, AllocContext, File, Line)\
EventEnabledMemFreeAddrNotInSegment() ?\
Template_ppsq(PHP_WincacheHandle, &MemFreeAddrNotInSegment, Block, AllocContext, File, Line)\
: ERROR_SUCCESS\
//
// Enablement check macro for MemCombineNonFreeBlock
//
#define EventEnabledMemCombineNonFreeBlock() ((PHP_WincacheEnableBits[0] & 0x00000004) != 0)
//
// Event Macro for MemCombineNonFreeBlock
//
#define EventWriteMemCombineNonFreeBlock(Block, AllocContext, File, Line)\
EventEnabledMemCombineNonFreeBlock() ?\
Template_ppsq(PHP_WincacheHandle, &MemCombineNonFreeBlock, Block, AllocContext, File, Line)\
: ERROR_SUCCESS\
//
// Enablement check macro for MemFreeListCorrupt
//
#define EventEnabledMemFreeListCorrupt() ((PHP_WincacheEnableBits[0] & 0x00000004) != 0)
//
// Event Macro for MemFreeListCorrupt
//
#define EventWriteMemFreeListCorrupt(Block, AllocContext, File, Line)\
EventEnabledMemFreeListCorrupt() ?\
Template_ppsq(PHP_WincacheHandle, &MemFreeListCorrupt, Block, AllocContext, File, Line)\
: ERROR_SUCCESS\
//
// Enablement check macro for LockAbandonedMutex
//
#define EventEnabledLockAbandonedMutex() ((PHP_WincacheEnableBits[0] & 0x00000008) != 0)
//
// Event Macro for LockAbandonedMutex
//
#define EventWriteLockAbandonedMutex(LockName, LastReaderPid, LastWriterPid, File, Line)\
EventEnabledLockAbandonedMutex() ?\
Template_sqqsq(PHP_WincacheHandle, &LockAbandonedMutex, LockName, LastReaderPid, LastWriterPid, File, Line)\
: ERROR_SUCCESS\
//
// Enablement check macro for LockFailedWaitForLock
//
#define EventEnabledLockFailedWaitForLock() ((PHP_WincacheEnableBits[0] & 0x00000008) != 0)
//
// Event Macro for LockFailedWaitForLock
//
#define EventWriteLockFailedWaitForLock(LockName, LastReaderPid, LastWriterPid, File, Line)\
EventEnabledLockFailedWaitForLock() ?\
Template_sqqsq(PHP_WincacheHandle, &LockFailedWaitForLock, LockName, LastReaderPid, LastWriterPid, File, Line)\
: ERROR_SUCCESS\
//
// Enablement check macro for UnlockAbandonedMutex
//
#define EventEnabledUnlockAbandonedMutex() ((PHP_WincacheEnableBits[0] & 0x00000008) != 0)
//
// Event Macro for UnlockAbandonedMutex
//
#define EventWriteUnlockAbandonedMutex(LockName, LastReaderPid, LastWriterPid, File, Line)\
EventEnabledUnlockAbandonedMutex() ?\
Template_sqqsq(PHP_WincacheHandle, &UnlockAbandonedMutex, LockName, LastReaderPid, LastWriterPid, File, Line)\
: ERROR_SUCCESS\
//
// Enablement check macro for UnlockFailedWaitForLock
//
#define EventEnabledUnlockFailedWaitForLock() ((PHP_WincacheEnableBits[0] & 0x00000008) != 0)
//
// Event Macro for UnlockFailedWaitForLock
//
#define EventWriteUnlockFailedWaitForLock(LockName, LastReaderPid, LastWriterPid, File, Line)\
EventEnabledUnlockFailedWaitForLock() ?\
Template_sqqsq(PHP_WincacheHandle, &UnlockFailedWaitForLock, LockName, LastReaderPid, LastWriterPid, File, Line)\
: ERROR_SUCCESS\
#endif // MCGEN_DISABLE_PROVIDER_CODE_GENERATION
//
// Allow Diasabling of code generation
//
#ifndef MCGEN_DISABLE_PROVIDER_CODE_GENERATION
//
// Template Functions
//
//
//Template from manifest : ModuleInitErrorTemplate
//
#ifndef Template_x_def
#define Template_x_def
ETW_INLINE
ULONG
Template_x(
_In_ REGHANDLE RegHandle,
_In_ PCEVENT_DESCRIPTOR Descriptor,
_In_ unsigned __int64 Error
)
{
#define ARGUMENT_COUNT_x 1
EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_x];
EventDataDescCreate(&EventData[0], &Error, sizeof(unsigned __int64) );
return EventWrite(RegHandle, Descriptor, ARGUMENT_COUNT_x, EventData);
}
#endif
//
//Template from manifest : InitMutexErrorTemplate
//
#ifndef Template_sp_def
#define Template_sp_def
ETW_INLINE
ULONG
Template_sp(
_In_ REGHANDLE RegHandle,
_In_ PCEVENT_DESCRIPTOR Descriptor,
_In_opt_ LPCSTR Name,
_In_opt_ const void * Handle
)
{
#define ARGUMENT_COUNT_sp 2
EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_sp];
EventDataDescCreate(&EventData[0],
(Name != NULL) ? Name : "NULL",
(Name != NULL) ? (ULONG)((strlen(Name) + 1) * sizeof(CHAR)) : (ULONG)sizeof("NULL"));
EventDataDescCreate(&EventData[1], &Handle, sizeof(PVOID) );
return EventWrite(RegHandle, Descriptor, ARGUMENT_COUNT_sp, EventData);
}
#endif
//
//Template from manifest : (null)
//
#ifndef TemplateEventDescriptor_def
#define TemplateEventDescriptor_def
ETW_INLINE
ULONG
TemplateEventDescriptor(
_In_ REGHANDLE RegHandle,
_In_ PCEVENT_DESCRIPTOR Descriptor
)
{
return EventWrite(RegHandle, Descriptor, 0, NULL);
}
#endif
//
//Template from manifest : MemAllocBlockTemplate
//
#ifndef Template_ppsq_def
#define Template_ppsq_def
ETW_INLINE
ULONG
Template_ppsq(
_In_ REGHANDLE RegHandle,
_In_ PCEVENT_DESCRIPTOR Descriptor,
_In_opt_ const void * Block,
_In_opt_ const void * AllocContext,
_In_opt_ LPCSTR File,
_In_ const unsigned int Line
)
{
#define ARGUMENT_COUNT_ppsq 4
EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_ppsq];
EventDataDescCreate(&EventData[0], &Block, sizeof(PVOID) );
EventDataDescCreate(&EventData[1], &AllocContext, sizeof(PVOID) );
EventDataDescCreate(&EventData[2],
(File != NULL) ? File : "NULL",
(File != NULL) ? (ULONG)((strlen(File) + 1) * sizeof(CHAR)) : (ULONG)sizeof("NULL"));
EventDataDescCreate(&EventData[3], &Line, sizeof(const unsigned int) );
return EventWrite(RegHandle, Descriptor, ARGUMENT_COUNT_ppsq, EventData);
}
#endif
//
//Template from manifest : LockMutexTemplate
//
#ifndef Template_sqqsq_def
#define Template_sqqsq_def
ETW_INLINE
ULONG
Template_sqqsq(
_In_ REGHANDLE RegHandle,
_In_ PCEVENT_DESCRIPTOR Descriptor,
_In_opt_ LPCSTR LockName,
_In_ const unsigned int LastReaderPid,
_In_ const unsigned int LastWriterPid,
_In_opt_ LPCSTR File,
_In_ const unsigned int Line
)
{
#define ARGUMENT_COUNT_sqqsq 5
EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_sqqsq];
EventDataDescCreate(&EventData[0],
(LockName != NULL) ? LockName : "NULL",
(LockName != NULL) ? (ULONG)((strlen(LockName) + 1) * sizeof(CHAR)) : (ULONG)sizeof("NULL"));
EventDataDescCreate(&EventData[1], &LastReaderPid, sizeof(const unsigned int) );
EventDataDescCreate(&EventData[2], &LastWriterPid, sizeof(const unsigned int) );
EventDataDescCreate(&EventData[3],
(File != NULL) ? File : "NULL",
(File != NULL) ? (ULONG)((strlen(File) + 1) * sizeof(CHAR)) : (ULONG)sizeof("NULL"));
EventDataDescCreate(&EventData[4], &Line, sizeof(const unsigned int) );
return EventWrite(RegHandle, Descriptor, ARGUMENT_COUNT_sqqsq, EventData);
}
#endif
#endif // MCGEN_DISABLE_PROVIDER_CODE_GENERATION
#if defined(__cplusplus)
};
#endif
#define MSG_Provider_Name 0x90000001L
#define MSG_Event_ModInitError 0xB0000001L
#define MSG_Event_InitMutexError 0xB0000002L
#define MSG_Event_InitOpcacheLocalFallbackInfo 0xB0000003L
#define MSG_Event_MemBlockNotInUseError 0xB000000AL
#define MSG_Event_MemFreeAddrNotInSegmentError 0xB000000BL
#define MSG_Event_MemCombineNonFreeBlockError 0xB000000CL
#define MSG_Event_MemFreeListCorruptError 0xB000000DL
#define MSG_Event_LockAbandonedMutexError 0xB0000014L
#define MSG_Event_LockFailedWaitForLockError 0xB0000015L
#define MSG_Event_UnlockAbandonedMutexError 0xB0000016L
#define MSG_Event_UnlockFailedWaitForLockError 0xB0000017L