Incorrect warning message on thread pool startup in full AOT:ed Windows build.
[mono.git] / mcs / class / referencesource / mscorlib / system / runtime / interopservices / errorwrapper.cs
1 // ==++==
2 // 
3 //   Copyright (c) Microsoft Corporation.  All rights reserved.
4 // 
5 // ==--==
6 /*=============================================================================
7 **
8 ** Class: ErrorWrapper.
9 **
10 **
11 ** Purpose: Wrapper that is converted to a variant with VT_ERROR.
12 **
13 **
14 =============================================================================*/
15
16 namespace System.Runtime.InteropServices {
17    
18     using System;
19     using System.Security.Permissions;
20
21     [Serializable]
22 [System.Runtime.InteropServices.ComVisible(true)]
23     public sealed class ErrorWrapper
24     {
25         public ErrorWrapper(int errorCode)
26         {
27             m_ErrorCode = errorCode;
28         }
29
30         public ErrorWrapper(Object errorCode)
31         {
32             if (!(errorCode is int))
33                 throw new ArgumentException(Environment.GetResourceString("Arg_MustBeInt32"), "errorCode");
34             m_ErrorCode = (int)errorCode;
35         }        
36
37         [System.Security.SecuritySafeCritical]  // auto-generated
38 #pragma warning disable 618
39         [SecurityPermissionAttribute(SecurityAction.Demand, Flags=SecurityPermissionFlag.UnmanagedCode)]
40 #pragma warning restore 618
41         public ErrorWrapper(Exception e)
42         {
43             m_ErrorCode = Marshal.GetHRForException(e);
44         }
45
46         public int ErrorCode 
47         {
48             get 
49             {
50                 return m_ErrorCode;
51             }
52         }
53
54         private int m_ErrorCode;
55     }
56 }