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)); }
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); }
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); }