using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Security; namespace System.ComponentModel { /// Throws an exception for a Win32 error code. // Token: 0x020000DC RID: 220 [SuppressUnmanagedCodeSecurity] [Serializable] public class Win32Exception : ExternalException { /// Initializes a new instance of the class with the last Win32 error that occurred. // Token: 0x06000760 RID: 1888 RVA: 0x00013DE8 File Offset: 0x00011FE8 public Win32Exception() : base(Win32Exception.W32ErrorMessage(Marshal.GetLastWin32Error())) { this.native_error_code = Marshal.GetLastWin32Error(); } /// Initializes a new instance of the class with the specified error. /// The Win32 error code associated with this exception. // Token: 0x06000761 RID: 1889 RVA: 0x00013E08 File Offset: 0x00012008 public Win32Exception(int error) : base(Win32Exception.W32ErrorMessage(error)) { this.native_error_code = error; } /// Initializes a new instance of the class with the specified error and the specified detailed description. /// The Win32 error code associated with this exception. /// A detailed description of the error. // Token: 0x06000762 RID: 1890 RVA: 0x00013E20 File Offset: 0x00012020 public Win32Exception(int error, string message) : base(message) { this.native_error_code = error; } /// Initializes a new instance of the class with the specified detailed description. /// A detailed description of the error. // Token: 0x06000763 RID: 1891 RVA: 0x00013E30 File Offset: 0x00012030 public Win32Exception(string message) : base(message) { this.native_error_code = Marshal.GetLastWin32Error(); } /// Initializes a new instance of the class with the specified detailed description and the specified exception. /// A detailed description of the error. /// A reference to the inner exception that is the cause of this exception. // Token: 0x06000764 RID: 1892 RVA: 0x00013E44 File Offset: 0x00012044 public Win32Exception(string message, Exception innerException) : base(message, innerException) { this.native_error_code = Marshal.GetLastWin32Error(); } /// Initializes a new instance of the class with the specified context and the serialization information. /// The associated with this exception. /// A that represents the context of this exception. // Token: 0x06000765 RID: 1893 RVA: 0x00013E5C File Offset: 0x0001205C protected Win32Exception(SerializationInfo info, StreamingContext context) : base(info, context) { this.native_error_code = info.GetInt32("NativeErrorCode"); } /// Gets the Win32 error code associated with this exception. /// The Win32 error code associated with this exception. // Token: 0x170001C2 RID: 450 // (get) Token: 0x06000766 RID: 1894 RVA: 0x00013E78 File Offset: 0x00012078 public int NativeErrorCode { get { return this.native_error_code; } } /// Sets the object with the file name and line number at which this occurred. /// A . /// The contextual information about the source or destination. /// /// is null. // Token: 0x06000767 RID: 1895 RVA: 0x00013E80 File Offset: 0x00012080 public override void GetObjectData(SerializationInfo info, StreamingContext context) { if (info == null) { throw new ArgumentNullException("info"); } info.AddValue("NativeErrorCode", this.native_error_code); base.GetObjectData(info, context); } // Token: 0x06000768 RID: 1896 [MethodImpl(MethodImplOptions.InternalCall)] internal static extern string W32ErrorMessage(int error_code); // Token: 0x04000215 RID: 533 private int native_error_code; } }