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)));
     }
 }
Esempio n. 2
0
        private unsafe void EtwRegister()
        {
            uint status;

            _etwCallback = new UnsafeNativeMethods.EtwEnableCallback(EtwEnableCallBack);

            status = UnsafeNativeMethods.EventRegister(ref _providerId, _etwCallback, null, ref _regHandle);
            if (status != 0)
            {
                throw new Win32Exception((int)status);
            }
        }
        unsafe protected NativeEventProvider(Guid providerGuid)
        {
            this.providerId = providerGuid;

            enableCallback = new UnsafeNativeMethods.EtwEnableCallback(EtwEnableCallBack);
            uint etwRegistrationStatus = UnsafeNativeMethods.EventRegister(ref this.providerId,
                                                                           enableCallback, IntPtr.Zero, ref this.traceRegistrationHandle);

            if (etwRegistrationStatus != 0)
            {
                throw new InvalidOperationException("ETW Registration failed");
            }
        }
 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)));
         }
     }
 }
Esempio n. 5
0
        private unsafe void EtwRegister()
        {
            uint status;

            //
            // Check only the mayor version
            //

            if (s_platformNotSupported)
            {
                throw new PlatformNotSupportedException(SR.GetString(SR.NotSupported_DownLevelVista));
            }

            m_etwCallback = new UnsafeNativeMethods.EtwEnableCallback(EtwEnableCallBack);


            status = UnsafeNativeMethods.EventRegister(ref m_providerId, m_etwCallback, null, ref m_regHandle);
            if (status != 0)
            {
                throw new Win32Exception((int)status);
            }
        }
        private unsafe void EtwRegister()
        {

            uint status;

            //
            // Check only the mayor version
            //

            if (s_platformNotSupported)
            {
                throw new PlatformNotSupportedException(SR.GetString(SR.NotSupported_DownLevelVista));
            }

            m_etwCallback = new UnsafeNativeMethods.EtwEnableCallback(EtwEnableCallBack);


            status = UnsafeNativeMethods.EventRegister(ref m_providerId, m_etwCallback, null, ref m_regHandle);
            if (status != 0)
            {
                throw new Win32Exception((int)status);
            }

        }
Esempio n. 7
0
 internal static extern unsafe uint EventRegister(ref Guid providerId, UnsafeNativeMethods.EtwEnableCallback enableCallback, void *callbackContext, out long registrationHandle);
Esempio n. 8
0
        private unsafe void EtwRegister()
        {
            uint status;

            _etwCallback = new UnsafeNativeMethods.EtwEnableCallback(EtwEnableCallBack);

            status = UnsafeNativeMethods.EventRegister(ref _providerId, _etwCallback, null, ref _regHandle);
            if (status != 0)
            {
                throw new Win32Exception((int)status);
            }
        }
Esempio n. 9
0
 internal static extern unsafe uint EventRegister([In] ref Guid providerId, [In] UnsafeNativeMethods.EtwEnableCallback enableCallback, [In] void *callbackContext, [In][Out] ref long registrationHandle);
Esempio n. 10
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)));
				}
			}
		}