コード例 #1
0
 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)));
     }
 }
コード例 #2
0
ファイル: EventProvider.cs プロジェクト: yra40/PowerShell
        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);
            }
        }
コード例 #3
0
        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");
            }
        }
コード例 #4
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)));
         }
     }
 }
コード例 #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);
            }
        }
コード例 #6
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);
            }

        }
コード例 #7
0
 internal static extern unsafe uint EventRegister(ref Guid providerId, UnsafeNativeMethods.EtwEnableCallback enableCallback, void *callbackContext, out long registrationHandle);
コード例 #8
0
ファイル: EventProvider.cs プロジェクト: 40a/PowerShell
        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);
            }
        }
コード例 #9
0
 internal static extern unsafe uint EventRegister([In] ref Guid providerId, [In] UnsafeNativeMethods.EtwEnableCallback enableCallback, [In] void *callbackContext, [In][Out] ref long registrationHandle);
コード例 #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)));
				}
			}
		}