Exemple #1
0
        public void Dispose()
        {
            Win32Error error = NativeMethods.RmEndSession(_sessionHandle);

            if (error != Win32Error.ERROR_SUCCESS)
            {
                Log.Error(error.GetException(), "[RestartManager] Failed to dispose.");
            }
            GC.SuppressFinalize(this);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 internal EventTraceException(Win32Error err, string message = null) : base(message ?? err.ToString(), err.GetException())
 {
 }