public void Dispose() { Win32Error error = NativeMethods.RmEndSession(_sessionHandle); if (error != Win32Error.ERROR_SUCCESS) { Log.Error(error.GetException(), "[RestartManager] Failed to dispose."); } GC.SuppressFinalize(this); }
public static void Check(this Win32Error self, string formatMessage = null, params object[] args) { if (self == Win32Error.ERROR_SUCCESS) { return; } Win32Exception ex = self.GetException(); if (formatMessage == null) { throw ex; } throw new Exception(String.Format(formatMessage, args), ex); }
internal EventTraceException(Win32Error err, string message = null) : base(message ?? err.ToString(), err.GetException()) { }