/winbase/Eventing/Provider/Advanced/CSharp/AdvancedProviderEvents.cs
https://github.com/pauldotknopf/WindowsSDK7-Samples · C# · 1511 lines · 980 code · 388 blank · 143 comment · 68 complexity · 88a87512240b966ed8aedc9967926b53 MD5 · raw file
- //---------------------------------------------------------------------
- // <autogenerated>
- //
- // Generated by Message Compiler (mc.exe)
- //
- // Copyright (c) Microsoft Corporation. All Rights Reserved.
- //
- // Changes to this file may cause incorrect behavior and will be lost if
- // the code is regenerated.
- // </autogenerated>
- //---------------------------------------------------------------------
- namespace AdvancedProvider
- {
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Diagnostics;
- using System.Diagnostics.Eventing;
- using Microsoft.Win32;
- using System.Runtime.InteropServices;
- using System.Security.Principal;
- public class MicrosoftWindowsSDKSampleAdvancedProviderCs
- {
- //
- // Provider Microsoft-Windows-SDKSample-AdvancedProvider-CS Event Count 41
- //
- private EventProviderVersionTwo m_provider = new EventProviderVersionTwo(new Guid("21a9201e-73b0-43fe-9821-7e159a59bc72"));
- //
- // Task : eventGUIDs
- //
- //
- // Event Descriptors
- //
- private EventDescriptor SampleEvt_INT8;
- private EventDescriptor SampleEvt_UINT8;
- private EventDescriptor SampleEvt_UINT8_HEXINT8;
- private EventDescriptor SampleEvt_INT16;
- private EventDescriptor SampleEvt_UINT16;
- private EventDescriptor SampleEvt_UINT16_HexInt16;
- private EventDescriptor SampleEvt_INT32;
- private EventDescriptor SampleEvt_UINT32;
- private EventDescriptor SampleEvt_UINT32_PID;
- private EventDescriptor SampleEvt_UINT32_TID;
- private EventDescriptor SampleEvt_UINT32_IPV4;
- private EventDescriptor SampleEvt_UINT32_ERRORCODE;
- private EventDescriptor SampleEvt_UINT32_HEXINT32;
- private EventDescriptor SampleEvt_INT64;
- private EventDescriptor SampleEvt_UINT64;
- private EventDescriptor SampleEvt_UINT64_HEXInt64;
- private EventDescriptor SampleEvt_FLOAT;
- private EventDescriptor SampleEvt_DOUBLE;
- private EventDescriptor SampleEvt_BOOL;
- private EventDescriptor SampleEvt_GUID;
- private EventDescriptor SampleEvt_POINTER;
- private EventDescriptor SampleEvt_FILETIME;
- private EventDescriptor SampleEvt_SID;
- private EventDescriptor SampleEvt_UnicodeString;
- private EventDescriptor SampleEvt_FixedLength_UnicodeString;
- private EventDescriptor SampleEvt_ParamLength_UnicodeString;
- private EventDescriptor SampleEvt_UserChannel_UnicodeString;
- private EventDescriptor SampleEvt_UserChannel_UINT8;
- private EventDescriptor SampleEvt_UserKeyword_UINT8;
- private EventDescriptor SampleEvt_Alignment_UInt8_UnicodeString;
- private EventDescriptor SampleEvt_ValueMap_UInt8;
- private EventDescriptor SampleEvt_BitMap_UInt8;
- private EventDescriptor SampleEvt_UInt32_Win32Error;
- private EventDescriptor SampleEvt_UInt32_NTSTATUS;
- private EventDescriptor SampleEvt_Int32_HResult;
- private EventDescriptor SampleEvt_INT8_V1;
- private EventDescriptor SampleEvt_INT8_V2;
- private EventDescriptor SampleEvt_UnicodeString_V1;
- private EventDescriptor SampleEvt_FixedCount_Int8_V1;
- private EventDescriptor SampleEvt_FixedCount_Int8_V3;
- private EventDescriptor SampleEvt_Int32_HResult_V2;
- public MicrosoftWindowsSDKSampleAdvancedProviderCs()
- {
- unchecked
- {
- SampleEvt_INT8 = new EventDescriptor(0x66, 0x0, 0x8, 0x1, 0x1, 0x64, (long)0x8000000000000000);
- SampleEvt_UINT8 = new EventDescriptor(0x67, 0x0, 0x8, 0x1, 0x2, 0x64, (long)0x8040000000000000);
- SampleEvt_UINT8_HEXINT8 = new EventDescriptor(0x68, 0x0, 0x8, 0x1, 0x0, 0x64, (long)0x8000000000000000);
- SampleEvt_INT16 = new EventDescriptor(0x69, 0x0, 0x8, 0x1, 0x7, 0x64, (long)0x8000000000000000);
- SampleEvt_UINT16 = new EventDescriptor(0x6a, 0x0, 0x8, 0x1, 0x8, 0x64, (long)0x8000000000000000);
- SampleEvt_UINT16_HexInt16 = new EventDescriptor(0x6b, 0x0, 0x8, 0x1, 0x9, 0x64, (long)0x8000000000000000);
- SampleEvt_INT32 = new EventDescriptor(0x6c, 0x0, 0x8, 0x1, 0xf0, 0x64, (long)0x8000000000000000);
- SampleEvt_UINT32 = new EventDescriptor(0x6d, 0x0, 0x8, 0x1, 0xa, 0x64, (long)0x8000000000000000);
- SampleEvt_UINT32_PID = new EventDescriptor(0x6e, 0x0, 0x8, 0x1, 0xb, 0x64, (long)0x8000000000000000);
- SampleEvt_UINT32_TID = new EventDescriptor(0x6f, 0x0, 0x8, 0x1, 0x1, 0x65, (long)0x8000000000000000);
- SampleEvt_UINT32_IPV4 = new EventDescriptor(0x70, 0x0, 0x8, 0x1, 0x2, 0x65, (long)0x8000000000000000);
- SampleEvt_UINT32_ERRORCODE = new EventDescriptor(0x72, 0x0, 0x8, 0x1, 0x0, 0x65, (long)0x8000000000000000);
- SampleEvt_UINT32_HEXINT32 = new EventDescriptor(0x73, 0x0, 0x8, 0x1, 0x7, 0x65, (long)0x8000000000000000);
- SampleEvt_INT64 = new EventDescriptor(0x74, 0x0, 0x8, 0x1, 0x8, 0x65, (long)0x8000000000000000);
- SampleEvt_UINT64 = new EventDescriptor(0x75, 0x0, 0x8, 0x1, 0x9, 0x65, (long)0x8000000000000000);
- SampleEvt_UINT64_HEXInt64 = new EventDescriptor(0x76, 0x0, 0x8, 0x1, 0xf0, 0x65, (long)0x8000000000000000);
- SampleEvt_FLOAT = new EventDescriptor(0x77, 0x0, 0x8, 0x1, 0xa, 0x65, (long)0x8000000000000000);
- SampleEvt_DOUBLE = new EventDescriptor(0x78, 0x0, 0x8, 0x1, 0xb, 0x65, (long)0x8000000000000000);
- SampleEvt_BOOL = new EventDescriptor(0x79, 0x0, 0x8, 0x1, 0x1, 0x66, (long)0x8000000000000000);
- SampleEvt_GUID = new EventDescriptor(0x7d, 0x0, 0x8, 0x1, 0x2, 0x66, (long)0x8000000000000000);
- SampleEvt_POINTER = new EventDescriptor(0x7e, 0x0, 0x8, 0x1, 0x0, 0x66, (long)0x8000000000000000);
- SampleEvt_FILETIME = new EventDescriptor(0x7f, 0x0, 0x8, 0x1, 0x7, 0x66, (long)0x8000000000000000);
- SampleEvt_SID = new EventDescriptor(0x80, 0x0, 0x8, 0x1, 0x9, 0x66, (long)0x8000000000000000);
- SampleEvt_UnicodeString = new EventDescriptor(0xc8, 0x0, 0x9, 0x4, 0xf0, 0x66, (long)0x4000000000000000);
- SampleEvt_FixedLength_UnicodeString = new EventDescriptor(0xc9, 0x0, 0x9, 0x4, 0xb, 0x66, (long)0x4000000000000000);
- SampleEvt_ParamLength_UnicodeString = new EventDescriptor(0xca, 0x0, 0x9, 0x4, 0x0, 0x67, (long)0x4000000000000000);
- SampleEvt_UserChannel_UnicodeString = new EventDescriptor(0x258, 0x0, 0x11, 0x2, 0xe, 0x65, (long)0x1000000000000000);
- SampleEvt_UserChannel_UINT8 = new EventDescriptor(0x259, 0x0, 0x11, 0x2, 0x5, 0x66, (long)0x1000000000000000);
- SampleEvt_UserKeyword_UINT8 = new EventDescriptor(0x25a, 0x0, 0x11, 0x2, 0x6, 0x66, (long)0x1000000000000020);
- SampleEvt_Alignment_UInt8_UnicodeString = new EventDescriptor(0x25b, 0x0, 0x11, 0x2, 0xc, 0x66, (long)0x1000000000000020);
- SampleEvt_ValueMap_UInt8 = new EventDescriptor(0x25d, 0x0, 0x11, 0x2, 0xd, 0x66, (long)0x1000000000000020);
- SampleEvt_BitMap_UInt8 = new EventDescriptor(0x25e, 0x0, 0x11, 0x2, 0xe, 0x66, (long)0x1000000000000020);
- SampleEvt_UInt32_Win32Error = new EventDescriptor(0x2bc, 0x0, 0x11, 0x3, 0x5, 0x67, (long)0x1000000000000000);
- SampleEvt_UInt32_NTSTATUS = new EventDescriptor(0x2bd, 0x0, 0x11, 0x3, 0x6, 0x67, (long)0x1000000000000000);
- SampleEvt_Int32_HResult = new EventDescriptor(0x2be, 0x0, 0x11, 0x3, 0xc, 0x67, (long)0x1000000000000000);
- SampleEvt_INT8_V1 = new EventDescriptor(0x66, 0x1, 0x8, 0x1, 0xd, 0x67, (long)0x8000000000000000);
- SampleEvt_INT8_V2 = new EventDescriptor(0x66, 0x2, 0x8, 0x1, 0xe, 0x67, (long)0x8000000000000000);
- SampleEvt_UnicodeString_V1 = new EventDescriptor(0xc8, 0x1, 0x9, 0x4, 0x5, 0x68, (long)0x4000000000000000);
- SampleEvt_FixedCount_Int8_V1 = new EventDescriptor(0x12c, 0x1, 0x11, 0x3, 0x6, 0x68, (long)0x1000000000000000);
- SampleEvt_FixedCount_Int8_V3 = new EventDescriptor(0x12c, 0x3, 0x11, 0x3, 0xc, 0x68, (long)0x1000000000000000);
- SampleEvt_Int32_HResult_V2 = new EventDescriptor(0x2be, 0x2, 0x11, 0x3, 0xd, 0x68, (long)0x1000000000000000);
- }
- }
- //
- // Event method for SampleEvt_INT8
- //
- public bool EventWriteSampleEvt_INT8(sbyte Prop_Int8)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_INT8(ref SampleEvt_INT8, Prop_Int8);
- }
- //
- // Event method for SampleEvt_UINT8
- //
- public bool EventWriteSampleEvt_UINT8(byte Prop_UInt8)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_UINT8(ref SampleEvt_UINT8, Prop_UInt8);
- }
- //
- // Event method for SampleEvt_UINT8_HEXINT8
- //
- public bool EventWriteSampleEvt_UINT8_HEXINT8(byte Prop_UInt8_HexInt8)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_UINT8_HEXINT8(ref SampleEvt_UINT8_HEXINT8, Prop_UInt8_HexInt8);
- }
- //
- // Event method for SampleEvt_INT16
- //
- public bool EventWriteSampleEvt_INT16(short Prop_Int16)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_INT16(ref SampleEvt_INT16, Prop_Int16);
- }
- //
- // Event method for SampleEvt_UINT16
- //
- public bool EventWriteSampleEvt_UINT16(ushort Prop_UInt16)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_UINT16(ref SampleEvt_UINT16, Prop_UInt16);
- }
- //
- // Event method for SampleEvt_UINT16_HexInt16
- //
- public bool EventWriteSampleEvt_UINT16_HexInt16(ushort Prop_UInt16_HexInt16)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_UINT16_HexInt16(ref SampleEvt_UINT16_HexInt16, Prop_UInt16_HexInt16);
- }
- //
- // Event method for SampleEvt_INT32
- //
- public bool EventWriteSampleEvt_INT32(int Prop_Int32)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_INT32(ref SampleEvt_INT32, Prop_Int32);
- }
- //
- // Event method for SampleEvt_UINT32
- //
- public bool EventWriteSampleEvt_UINT32(uint Prop_Uint32)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_UINT32(ref SampleEvt_UINT32, Prop_Uint32);
- }
- //
- // Event method for SampleEvt_UINT32_PID
- //
- public bool EventWriteSampleEvt_UINT32_PID(uint Prop_UInt32_Pid)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_UINT32_PID(ref SampleEvt_UINT32_PID, Prop_UInt32_Pid);
- }
- //
- // Event method for SampleEvt_UINT32_TID
- //
- public bool EventWriteSampleEvt_UINT32_TID(uint Prop_Uint32_Tid)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_UINT32_TID(ref SampleEvt_UINT32_TID, Prop_Uint32_Tid);
- }
- //
- // Event method for SampleEvt_UINT32_IPV4
- //
- public bool EventWriteSampleEvt_UINT32_IPV4(uint Prop_Uint32_IPV4)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_UINT32_IPV4(ref SampleEvt_UINT32_IPV4, Prop_Uint32_IPV4);
- }
- //
- // Event method for SampleEvt_UINT32_ERRORCODE
- //
- public bool EventWriteSampleEvt_UINT32_ERRORCODE(uint Prop_Uint32_ERRORCODE)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_UINT32_ERRORCODE(ref SampleEvt_UINT32_ERRORCODE, Prop_Uint32_ERRORCODE);
- }
- //
- // Event method for SampleEvt_UINT32_HEXINT32
- //
- public bool EventWriteSampleEvt_UINT32_HEXINT32(uint Prop_Uint32_HEXINT32)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_UINT32_HEXINT32(ref SampleEvt_UINT32_HEXINT32, Prop_Uint32_HEXINT32);
- }
- //
- // Event method for SampleEvt_INT64
- //
- public bool EventWriteSampleEvt_INT64(long Prop_Int64)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_INT64(ref SampleEvt_INT64, Prop_Int64);
- }
- //
- // Event method for SampleEvt_UINT64
- //
- public bool EventWriteSampleEvt_UINT64(ulong Prop_UInt64)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_UINT64(ref SampleEvt_UINT64, Prop_UInt64);
- }
- //
- // Event method for SampleEvt_UINT64_HEXInt64
- //
- public bool EventWriteSampleEvt_UINT64_HEXInt64(ulong Prop_UInt64_HEXInt64)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_UINT64_HEXInt64(ref SampleEvt_UINT64_HEXInt64, Prop_UInt64_HEXInt64);
- }
- //
- // Event method for SampleEvt_FLOAT
- //
- public bool EventWriteSampleEvt_FLOAT(float Prop_Float)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_FLOAT(ref SampleEvt_FLOAT, Prop_Float);
- }
- //
- // Event method for SampleEvt_DOUBLE
- //
- public bool EventWriteSampleEvt_DOUBLE(double Prop_Double)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_DOUBLE(ref SampleEvt_DOUBLE, Prop_Double);
- }
- //
- // Event method for SampleEvt_BOOL
- //
- public bool EventWriteSampleEvt_BOOL(bool Prop_Bool)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_BOOL(ref SampleEvt_BOOL, Prop_Bool);
- }
- //
- // Event method for SampleEvt_GUID
- //
- public bool EventWriteSampleEvt_GUID(Guid Prop_Guid)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_GUID(ref SampleEvt_GUID, Prop_Guid);
- }
- //
- // Event method for SampleEvt_POINTER
- //
- public bool EventWriteSampleEvt_POINTER(IntPtr Prop_Pointer)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_POINTER(ref SampleEvt_POINTER, Prop_Pointer);
- }
- //
- // Event method for SampleEvt_FILETIME
- //
- public bool EventWriteSampleEvt_FILETIME(DateTime Prop_FileTime)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_FILETIME(ref SampleEvt_FILETIME, Prop_FileTime);
- }
- //
- // Event method for SampleEvt_SID
- //
- public bool EventWriteSampleEvt_SID(SecurityIdentifier Prop_SID)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_SID(ref SampleEvt_SID, Prop_SID);
- }
- //
- // Event method for SampleEvt_UnicodeString
- //
- public bool EventWriteSampleEvt_UnicodeString(string Prop_UnicodeString)
- {
- return m_provider.WriteEvent(ref SampleEvt_UnicodeString, Prop_UnicodeString);
- }
- //
- // Event method for SampleEvt_FixedLength_UnicodeString
- //
- public bool EventWriteSampleEvt_FixedLength_UnicodeString(string Prop_FixedLength_UnicodeString)
- {
- return m_provider.WriteEvent(ref SampleEvt_FixedLength_UnicodeString, Prop_FixedLength_UnicodeString);
- }
- //
- // Event method for SampleEvt_ParamLength_UnicodeString
- //
- public bool EventWriteSampleEvt_ParamLength_UnicodeString(uint Prop_ParamLength_UnicodString_Length, string Prop_ParamLength_UnicodeString)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_ParamLength_UnicodeString(ref SampleEvt_ParamLength_UnicodeString, Prop_ParamLength_UnicodString_Length, Prop_ParamLength_UnicodeString);
- }
- //
- // Event method for SampleEvt_UserChannel_UnicodeString
- //
- public bool EventWriteSampleEvt_UserChannel_UnicodeString(string Prop_UnicodeString)
- {
- return m_provider.WriteEvent(ref SampleEvt_UserChannel_UnicodeString, Prop_UnicodeString);
- }
- //
- // Event method for SampleEvt_UserChannel_UINT8
- //
- public bool EventWriteSampleEvt_UserChannel_UINT8(byte Prop_UInt8)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_UINT8(ref SampleEvt_UserChannel_UINT8, Prop_UInt8);
- }
- //
- // Event method for SampleEvt_UserKeyword_UINT8
- //
- public bool EventWriteSampleEvt_UserKeyword_UINT8(byte Prop_UInt8)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_UINT8(ref SampleEvt_UserKeyword_UINT8, Prop_UInt8);
- }
- //
- // Event method for SampleEvt_Alignment_UInt8_UnicodeString
- //
- public bool EventWriteSampleEvt_Alignment_UInt8_UnicodeString(byte Prop_Alignment_UInt8_UnicodeString_1, string Prop_Alignment_UInt8_UnicodeString_2)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_Alignment_UInt8_UnicodeString(ref SampleEvt_Alignment_UInt8_UnicodeString, Prop_Alignment_UInt8_UnicodeString_1, Prop_Alignment_UInt8_UnicodeString_2);
- }
- //
- // Event method for SampleEvt_ValueMap_UInt8
- //
- public bool EventWriteSampleEvt_ValueMap_UInt8(byte Prop_ValueMap_Uint8)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_ValueMap_UInt8(ref SampleEvt_ValueMap_UInt8, Prop_ValueMap_Uint8);
- }
- //
- // Event method for SampleEvt_BitMap_UInt8
- //
- public bool EventWriteSampleEvt_BitMap_UInt8(byte Prop_BitMap_Uint8)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_BitMap_UInt8(ref SampleEvt_BitMap_UInt8, Prop_BitMap_Uint8);
- }
- //
- // Event method for SampleEvt_UInt32_Win32Error
- //
- public bool EventWriteSampleEvt_UInt32_Win32Error(uint Prop_UInt32_Win32Error)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_UInt32_Win32Error(ref SampleEvt_UInt32_Win32Error, Prop_UInt32_Win32Error);
- }
- //
- // Event method for SampleEvt_UInt32_NTSTATUS
- //
- public bool EventWriteSampleEvt_UInt32_NTSTATUS(uint Prop_UInt32_NTSTATUS)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_UInt32_NTSTATUS(ref SampleEvt_UInt32_NTSTATUS, Prop_UInt32_NTSTATUS);
- }
- //
- // Event method for SampleEvt_Int32_HResult
- //
- public bool EventWriteSampleEvt_Int32_HResult(int Prop_Int32_HResult)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_Int32_HResult(ref SampleEvt_Int32_HResult, Prop_Int32_HResult);
- }
- //
- // Event method for SampleEvt_INT8_V1
- //
- public bool EventWriteSampleEvt_INT8_V1(sbyte Prop_Int8)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_INT8(ref SampleEvt_INT8_V1, Prop_Int8);
- }
- //
- // Event method for SampleEvt_INT8_V2
- //
- public bool EventWriteSampleEvt_INT8_V2(sbyte Prop_Int8)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_INT8(ref SampleEvt_INT8_V2, Prop_Int8);
- }
- //
- // Event method for SampleEvt_UnicodeString_V1
- //
- public bool EventWriteSampleEvt_UnicodeString_V1(string Prop_UnicodeString)
- {
- return m_provider.WriteEvent(ref SampleEvt_UnicodeString_V1, Prop_UnicodeString);
- }
- //
- // Event method for SampleEvt_FixedCount_Int8_V1
- //
- public bool EventWriteSampleEvt_FixedCount_Int8_V1(sbyte[] Prop_FixedCount_Int8)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_FixedCount_Int8(ref SampleEvt_FixedCount_Int8_V1, Prop_FixedCount_Int8);
- }
- //
- // Event method for SampleEvt_FixedCount_Int8_V3
- //
- public bool EventWriteSampleEvt_FixedCount_Int8_V3(sbyte[] Prop_FixedCount_Int8)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_FixedCount_Int8(ref SampleEvt_FixedCount_Int8_V3, Prop_FixedCount_Int8);
- }
- //
- // Event method for SampleEvt_Int32_HResult_V2
- //
- public bool EventWriteSampleEvt_Int32_HResult_V2(int Prop_Int32_HResult)
- {
- if (!m_provider.IsEnabled())
- {
- return true;
- }
- return m_provider.TemplateT_Int32_HResult(ref SampleEvt_Int32_HResult_V2, Prop_Int32_HResult);
- }
- }
- internal class EventProviderVersionTwo : EventProvider
- {
- internal EventProviderVersionTwo(Guid id)
- : base(id)
- {}
- [StructLayout(LayoutKind.Explicit, Size = 16)]
- private struct EventData
- {
- [FieldOffset(0)]
- internal UInt64 DataPointer;
- [FieldOffset(8)]
- internal uint Size;
- [FieldOffset(12)]
- internal int Reserved;
- }
- internal unsafe bool TemplateT_INT8(
- ref EventDescriptor eventDescriptor,
- sbyte Prop_Int8
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_Int8);
- userDataPtr[0].Size = (uint)(sizeof(byte) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_UINT8(
- ref EventDescriptor eventDescriptor,
- byte Prop_UInt8
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_UInt8);
- userDataPtr[0].Size = (uint)(sizeof(byte) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_UINT8_HEXINT8(
- ref EventDescriptor eventDescriptor,
- byte Prop_UInt8_HexInt8
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_UInt8_HexInt8);
- userDataPtr[0].Size = (uint)(sizeof(byte) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_INT16(
- ref EventDescriptor eventDescriptor,
- short Prop_Int16
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_Int16);
- userDataPtr[0].Size = (uint)(sizeof(short) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_UINT16(
- ref EventDescriptor eventDescriptor,
- ushort Prop_UInt16
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_UInt16);
- userDataPtr[0].Size = (uint)(sizeof(short) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_UINT16_HexInt16(
- ref EventDescriptor eventDescriptor,
- ushort Prop_UInt16_HexInt16
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_UInt16_HexInt16);
- userDataPtr[0].Size = (uint)(sizeof(short) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_INT32(
- ref EventDescriptor eventDescriptor,
- int Prop_Int32
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_Int32);
- userDataPtr[0].Size = (uint)(sizeof(int) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_UINT32(
- ref EventDescriptor eventDescriptor,
- uint Prop_Uint32
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_Uint32);
- userDataPtr[0].Size = (uint)(sizeof(int) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_UINT32_PID(
- ref EventDescriptor eventDescriptor,
- uint Prop_UInt32_Pid
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_UInt32_Pid);
- userDataPtr[0].Size = (uint)(sizeof(int) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_UINT32_TID(
- ref EventDescriptor eventDescriptor,
- uint Prop_Uint32_Tid
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_Uint32_Tid);
- userDataPtr[0].Size = (uint)(sizeof(int) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_UINT32_IPV4(
- ref EventDescriptor eventDescriptor,
- uint Prop_Uint32_IPV4
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_Uint32_IPV4);
- userDataPtr[0].Size = (uint)(sizeof(int) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_UINT32_ERRORCODE(
- ref EventDescriptor eventDescriptor,
- uint Prop_Uint32_ERRORCODE
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_Uint32_ERRORCODE);
- userDataPtr[0].Size = (uint)(sizeof(int) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_UINT32_HEXINT32(
- ref EventDescriptor eventDescriptor,
- uint Prop_Uint32_HEXINT32
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_Uint32_HEXINT32);
- userDataPtr[0].Size = (uint)(sizeof(int) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_INT64(
- ref EventDescriptor eventDescriptor,
- long Prop_Int64
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_Int64);
- userDataPtr[0].Size = (uint)(sizeof(long) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_UINT64(
- ref EventDescriptor eventDescriptor,
- ulong Prop_UInt64
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_UInt64);
- userDataPtr[0].Size = (uint)(sizeof(long) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_UINT64_HEXInt64(
- ref EventDescriptor eventDescriptor,
- ulong Prop_UInt64_HEXInt64
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_UInt64_HEXInt64);
- userDataPtr[0].Size = (uint)(sizeof(long) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_FLOAT(
- ref EventDescriptor eventDescriptor,
- float Prop_Float
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_Float);
- userDataPtr[0].Size = (uint)(sizeof(float) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_DOUBLE(
- ref EventDescriptor eventDescriptor,
- double Prop_Double
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_Double);
- userDataPtr[0].Size = (uint)(sizeof(double) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_BOOL(
- ref EventDescriptor eventDescriptor,
- bool Prop_Bool
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- int Prop_BoolInt = Prop_Bool ? 1 : 0;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_BoolInt);
- userDataPtr[0].Size = (uint)(sizeof(int));
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_GUID(
- ref EventDescriptor eventDescriptor,
- Guid Prop_Guid
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_Guid);
- userDataPtr[0].Size = (uint)(sizeof(Guid) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_POINTER(
- ref EventDescriptor eventDescriptor,
- IntPtr Prop_Pointer
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_Pointer);
- userDataPtr[0].Size = (uint)(sizeof(IntPtr) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_FILETIME(
- ref EventDescriptor eventDescriptor,
- DateTime Prop_FileTime
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- long Prop_FileTimeFileTime = Prop_FileTime.ToFileTime();
- userDataPtr[0].DataPointer = (UInt64)(&Prop_FileTimeFileTime);
- userDataPtr[0].Size = (uint)(sizeof(long));
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_SID(
- ref EventDescriptor eventDescriptor,
- SecurityIdentifier Prop_SID
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- byte [] Prop_SIDBin = new byte[Prop_SID.BinaryLength];
- Prop_SID.GetBinaryForm(Prop_SIDBin, 0);
- userDataPtr[0].Size = (uint)(Prop_SID.BinaryLength);
- fixed (byte* a0 = Prop_SIDBin)
- {
- userDataPtr[0].DataPointer = (ulong)a0;
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- }
- return status;
- }
- internal unsafe bool TemplateT_ParamLength_UnicodeString(
- ref EventDescriptor eventDescriptor,
- uint Prop_ParamLength_UnicodString_Length,
- string Prop_ParamLength_UnicodeString
- )
- {
- int argumentCount = 2;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_ParamLength_UnicodString_Length);
- userDataPtr[0].Size = (uint)(sizeof(int) );
- userDataPtr[1].Size = (uint)(sizeof(char)*Prop_ParamLength_UnicodString_Length);
- fixed (char* a0 = Prop_ParamLength_UnicodeString)
- {
- userDataPtr[1].DataPointer = (ulong)a0;
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- }
- return status;
- }
- internal unsafe bool TemplateT_Alignment_UInt8_UnicodeString(
- ref EventDescriptor eventDescriptor,
- byte Prop_Alignment_UInt8_UnicodeString_1,
- string Prop_Alignment_UInt8_UnicodeString_2
- )
- {
- int argumentCount = 2;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_Alignment_UInt8_UnicodeString_1);
- userDataPtr[0].Size = (uint)(sizeof(byte) );
- userDataPtr[1].Size = (uint)(Prop_Alignment_UInt8_UnicodeString_2.Length + 1)*sizeof(char);
- fixed (char* a0 = Prop_Alignment_UInt8_UnicodeString_2)
- {
- userDataPtr[1].DataPointer = (ulong)a0;
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- }
- return status;
- }
- internal unsafe bool TemplateT_ValueMap_UInt8(
- ref EventDescriptor eventDescriptor,
- byte Prop_ValueMap_Uint8
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_ValueMap_Uint8);
- userDataPtr[0].Size = (uint)(sizeof(byte) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_BitMap_UInt8(
- ref EventDescriptor eventDescriptor,
- byte Prop_BitMap_Uint8
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_BitMap_Uint8);
- userDataPtr[0].Size = (uint)(sizeof(byte) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_UInt32_Win32Error(
- ref EventDescriptor eventDescriptor,
- uint Prop_UInt32_Win32Error
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_UInt32_Win32Error);
- userDataPtr[0].Size = (uint)(sizeof(int) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_UInt32_NTSTATUS(
- ref EventDescriptor eventDescriptor,
- uint Prop_UInt32_NTSTATUS
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_UInt32_NTSTATUS);
- userDataPtr[0].Size = (uint)(sizeof(int) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_Int32_HResult(
- ref EventDescriptor eventDescriptor,
- int Prop_Int32_HResult
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].DataPointer = (UInt64)(&Prop_Int32_HResult);
- userDataPtr[0].Size = (uint)(sizeof(int) );
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- return status;
- }
- internal unsafe bool TemplateT_FixedCount_Int8(
- ref EventDescriptor eventDescriptor,
- sbyte[] Prop_FixedCount_Int8
- )
- {
- int argumentCount = 1;
- bool status = true;
- if (IsEnabled(eventDescriptor.Level, eventDescriptor.Keywords))
- {
- byte* userData = stackalloc byte[sizeof(EventData) * argumentCount];
- EventData* userDataPtr = (EventData*)userData;
- userDataPtr[0].Size = (uint)(sizeof(byte)*15);
- fixed (sbyte* a0 = Prop_FixedCount_Int8)
- {
- userDataPtr[0].DataPointer = (ulong)a0;
- status = WriteEvent(ref eventDescriptor, argumentCount, (IntPtr)(userData));
- }
- }
- return status;
- }
- }
- }