unsafe void Initialize(Guid guid) { controlGuid = guid; TraceGuidRegistration guidReg = new TraceGuidRegistration(); Guid dummyGuid = new Guid("{aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaabbb}"); etwProc = new EtwTraceCallback(EtwNotificationCallback); guidReg.Guid = &dummyGuid; guidReg.RegHandle = null; uint status = EtwNativeMethods.RegisterTraceGuids(etwProc, null, ref controlGuid, 1, ref guidReg, null, null, out registrationHandle); if (status != 0) { throw new Win32Exception((int)status); } this.isDisposed = false; }
internal static extern unsafe uint RegisterTraceGuids([In] EtwTraceCallback cbFunc, [In] void *context, [In] ref System.Guid controlGuid, [In] uint guidCount, ref TraceGuidRegistration guidReg, [In] string mofImagePath, [In] string mofResourceName, [Out] out ulong regHandle);
internal static extern unsafe uint RegisterTraceGuids([In]EtwTraceCallback cbFunc, [In]void* context, [In] ref System.Guid controlGuid, [In] uint guidCount, ref TraceGuidRegistration guidReg, [In]string mofImagePath, [In] string mofResourceName, [Out] out ulong regHandle);