Exemplo n.º 1
0
 public static uint ExmonTaskTraceEventInstance(byte[] buffer, ref DiagnosticsNativeMethods.EventInstanceInfo instanceInfo, ref DiagnosticsNativeMethods.EventInstanceInfo parentInstanceInfo)
 {
     DiagnosticsNativeMethods.CriticalTraceHandle session = ETWTrace.ExmonTaskSession.Session;
     if (session != null)
     {
         return(DiagnosticsNativeMethods.TraceEventInstance(session.DangerousGetHandle(), buffer, ref instanceInfo, ref parentInstanceInfo));
     }
     return(87U);
 }
 public static DiagnosticsNativeMethods.CriticalTraceHandle Attach(IntPtr buffer)
 {
     DiagnosticsNativeMethods.CriticalTraceHandle criticalTraceHandle = new DiagnosticsNativeMethods.CriticalTraceHandle();
     criticalTraceHandle.Initialize(DiagnosticsNativeMethods.CriticalTraceHandle.GetTraceLoggerHandle(buffer));
     if (criticalTraceHandle.IsInvalid)
     {
         throw new Win32Exception(Marshal.GetLastWin32Error());
     }
     return(criticalTraceHandle);
 }