private unsafe uint ClassicShimUnregister() { uint num = ClassicEtw.UnregisterTraceGuids(this.m_regHandle); this.m_regHandle = 0L; this.m_classicControlCallback = null; this.m_classicSessionHandle = 0L; if (this.m_classicEventHeader != null) { Marshal.FreeHGlobal((IntPtr)this.m_classicEventHeader); this.m_classicEventHeader = null; } return(num); }
private unsafe uint ClassicShimRegister(Guid providerId, ManifestEtw.EtwEnableCallback enableCallback) { ClassicEtw.TRACE_GUID_REGISTRATION trace_guid_registration; if (this.m_regHandle != 0L) { throw new Exception(); } this.m_classicEventHeader = (ClassicEtw.EVENT_HEADER *)Marshal.AllocHGlobal(sizeof(ClassicEtw.EVENT_HEADER)); ZeroMemory((IntPtr)this.m_classicEventHeader, sizeof(ClassicEtw.EVENT_HEADER)); trace_guid_registration.RegHandle = null; trace_guid_registration.Guid = &providerId; this.m_classicControlCallback = new ClassicEtw.ControlCallback(this.ClassicControlCallback); return(ClassicEtw.RegisterTraceGuidsW(this.m_classicControlCallback, null, ref providerId, 1, &trace_guid_registration, null, null, out this.m_regHandle)); }
// // Registers the providerGuid with an inbuilt callback // internal override unsafe void Register(Guid providerGuid) { ulong registrationHandle; ClassicEtw.TRACE_GUID_REGISTRATION guidReg; Guid dummyGuid = new Guid(0xb4955bf0, 0x3af1, 0x4740, 0xb4, 0x75, 0x99, 0x05, 0x5d, 0x3f, 0xe9, 0xaa); _etwProc = new ClassicEtw.ControlCallback(EtwEnableCallback); // This dummyGuid is there for ETW backward compat issues and is the same for all downlevel trace providers guidReg.Guid = &dummyGuid; guidReg.RegHandle = null; ClassicEtw.RegisterTraceGuidsW(_etwProc, IntPtr.Zero, ref providerGuid, 1, ref guidReg, null, null, out registrationHandle); _registrationHandle.Value = registrationHandle; }
private uint ClassicShimUnregister() { // uint status = ClassicEtw.UnregisterTraceGuids(m_regHandle); m_regHandle = 0; m_classicControlCallback = null; m_classicSessionHandle = 0; if (m_classicEventHeader != null) { Marshal.FreeHGlobal((IntPtr)m_classicEventHeader); m_classicEventHeader = null; } return status; }
private unsafe uint ClassicShimRegister(Guid providerId, ManifestEtw.EtwEnableCallback enableCallback) { if (m_regHandle != 0) // registering again illegal throw new Exception(); // m_classicEventHeader = (ClassicEtw.EVENT_HEADER*)Marshal.AllocHGlobal(sizeof(ClassicEtw.EVENT_HEADER)); ZeroMemory((IntPtr)m_classicEventHeader, sizeof(ClassicEtw.EVENT_HEADER)); // We only declare one Task GUID because you don't need to be accurate. ClassicEtw.TRACE_GUID_REGISTRATION registrationInfo; registrationInfo.RegHandle = null; registrationInfo.Guid = &providerId; // We assign it to a field variable to keep it alive until we unregister. m_classicControlCallback = ClassicControlCallback; return ClassicEtw.RegisterTraceGuidsW(m_classicControlCallback, null, ref providerId, 1, ®istrationInfo, null, null, out m_regHandle); }
internal override unsafe void Register(Guid providerGuid) { ulong registrationHandle; ClassicEtw.TRACE_GUID_REGISTRATION guidReg; Guid dummyGuid = new Guid(0xb4955bf0, 0x3af1, 0x4740, 0xb4,0x75, 0x99,0x05,0x5d,0x3f,0xe9,0xaa); _etwProc = new ClassicEtw.ControlCallback(EtwEnableCallback); // This dummyGuid is there for ETW backward compat issues and is the same for all downlevel trace providers guidReg.Guid = &dummyGuid; guidReg.RegHandle = null; ClassicEtw.RegisterTraceGuidsW(_etwProc, IntPtr.Zero, ref providerGuid, 1, ref guidReg, null, null, out registrationHandle); _registrationHandle.Value = registrationHandle; }
private unsafe uint ClassicShimUnregister() { uint num = ClassicEtw.UnregisterTraceGuids(this.m_regHandle); this.m_regHandle = 0L; this.m_classicControlCallback = null; this.m_classicSessionHandle = 0L; if (this.m_classicEventHeader != null) { Marshal.FreeHGlobal((IntPtr) this.m_classicEventHeader); this.m_classicEventHeader = null; } return num; }
private unsafe uint ClassicShimRegister(Guid providerId, ManifestEtw.EtwEnableCallback enableCallback) { ClassicEtw.TRACE_GUID_REGISTRATION trace_guid_registration; if (this.m_regHandle != 0L) { throw new Exception(); } this.m_classicEventHeader = (ClassicEtw.EVENT_HEADER*) Marshal.AllocHGlobal(sizeof(ClassicEtw.EVENT_HEADER)); ZeroMemory((IntPtr) this.m_classicEventHeader, sizeof(ClassicEtw.EVENT_HEADER)); trace_guid_registration.RegHandle = null; trace_guid_registration.Guid = &providerId; this.m_classicControlCallback = new ClassicEtw.ControlCallback(this.ClassicControlCallback); return ClassicEtw.RegisterTraceGuidsW(this.m_classicControlCallback, null, ref providerId, 1, &trace_guid_registration, null, null, out this.m_regHandle); }