unsafe void EtwRegister()
        {
            this.etwCallback = new UnsafeNativeMethods.EtwEnableCallback(EtwEnableCallBack);
            uint etwRegistrationStatus = UnsafeNativeMethods.EventRegister(ref this.providerId, this.etwCallback, null, ref this.traceRegistrationHandle);

            if (etwRegistrationStatus != 0)
            {
                throw new InvalidOperationException(InternalSR.EtwRegistrationFailed(etwRegistrationStatus.ToString("x", CultureInfo.CurrentCulture)));
            }
        }
Ejemplo n.º 2
0
 private void EtwRegister()
 {
     unsafe
     {
         this.etwCallback = new UnsafeNativeMethods.EtwEnableCallback(this.EtwEnableCallBack);
         uint num = UnsafeNativeMethods.EventRegister(ref this.providerId, this.etwCallback, 0, out this.traceRegistrationHandle);
         if (num == 0)
         {
             return;
         }
         else
         {
             throw new InvalidOperationException(InternalSR.EtwRegistrationFailed(num.ToString("x", CultureInfo.CurrentCulture)));
         }
     }
 }