private void Initialize(DiagnosticsNativeMethods.ControlCallback callback, long handle) { RuntimeHelpers.PrepareConstrainedRegions(); try { } finally { this.callback = callback; this.traceHandle = handle; } }
private unsafe static void RegisterGuid(ref ETWTrace.EtwTraceGuids traceGuids, out DiagnosticsNativeMethods.CriticalTraceRegistrationHandle regHandle, DiagnosticsNativeMethods.ControlCallback callback, out IntPtr eventHandle) { Guid events = traceGuids.Events; DiagnosticsNativeMethods.TraceGuidRegistration traceGuidRegistration; traceGuidRegistration.guid = &events; traceGuidRegistration.handle = IntPtr.Zero; regHandle = DiagnosticsNativeMethods.CriticalTraceRegistrationHandle.RegisterTrace(traceGuids.Provider, ref traceGuidRegistration, callback); eventHandle = traceGuidRegistration.handle; }
public static DiagnosticsNativeMethods.CriticalTraceRegistrationHandle RegisterTrace(Guid provider, DiagnosticsNativeMethods.ControlCallback callback) { DiagnosticsNativeMethods.CriticalTraceRegistrationHandle criticalTraceRegistrationHandle = new DiagnosticsNativeMethods.CriticalTraceRegistrationHandle(); long handle; int num = DiagnosticsNativeMethods.CriticalTraceRegistrationHandle.RegisterTraceGuids(callback, IntPtr.Zero, ref provider, 0, IntPtr.Zero, null, null, out handle); if (num != 0) { throw new Win32Exception(num); } criticalTraceRegistrationHandle.Initialize(callback, handle); return(criticalTraceRegistrationHandle); }
private static extern int RegisterTraceGuids([In] DiagnosticsNativeMethods.ControlCallback callback, [In] IntPtr context, [In] ref Guid controlGuid, [In] int guidCount, IntPtr guidRegistrations, [In] string mofImagePath, [In] string mofResourceName, out long registrationHandle);