Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SecurityStatusAdapterPal.cs
Go to the documentation of this file.
3
4namespace System.Net;
5
6internal static class SecurityStatusAdapterPal
7{
8 private static readonly BidirectionalDictionary<global::Interop.SECURITY_STATUS, SecurityStatusPalErrorCode> s_statusDictionary = new BidirectionalDictionary<global::Interop.SECURITY_STATUS, SecurityStatusPalErrorCode>(43)
9 {
10 {
11 global::Interop.SECURITY_STATUS.AlgorithmMismatch,
12 SecurityStatusPalErrorCode.AlgorithmMismatch
13 },
14 {
15 global::Interop.SECURITY_STATUS.ApplicationProtocolMismatch,
16 SecurityStatusPalErrorCode.ApplicationProtocolMismatch
17 },
18 {
19 global::Interop.SECURITY_STATUS.BadBinding,
20 SecurityStatusPalErrorCode.BadBinding
21 },
22 {
23 global::Interop.SECURITY_STATUS.BufferNotEnough,
24 SecurityStatusPalErrorCode.BufferNotEnough
25 },
26 {
27 global::Interop.SECURITY_STATUS.CannotInstall,
28 SecurityStatusPalErrorCode.CannotInstall
29 },
30 {
31 global::Interop.SECURITY_STATUS.CannotPack,
32 SecurityStatusPalErrorCode.CannotPack
33 },
34 {
35 global::Interop.SECURITY_STATUS.CertExpired,
36 SecurityStatusPalErrorCode.CertExpired
37 },
38 {
39 global::Interop.SECURITY_STATUS.CertUnknown,
40 SecurityStatusPalErrorCode.CertUnknown
41 },
42 {
43 global::Interop.SECURITY_STATUS.CompAndContinue,
44 SecurityStatusPalErrorCode.CompAndContinue
45 },
46 {
47 global::Interop.SECURITY_STATUS.CompleteNeeded,
48 SecurityStatusPalErrorCode.CompleteNeeded
49 },
50 {
51 global::Interop.SECURITY_STATUS.ContextExpired,
52 SecurityStatusPalErrorCode.ContextExpired
53 },
54 {
55 global::Interop.SECURITY_STATUS.ContinueNeeded,
56 SecurityStatusPalErrorCode.ContinueNeeded
57 },
58 {
59 global::Interop.SECURITY_STATUS.CredentialsNeeded,
60 SecurityStatusPalErrorCode.CredentialsNeeded
61 },
62 {
63 global::Interop.SECURITY_STATUS.DecryptFailure,
64 SecurityStatusPalErrorCode.DecryptFailure
65 },
66 {
67 global::Interop.SECURITY_STATUS.DowngradeDetected,
68 SecurityStatusPalErrorCode.DowngradeDetected
69 },
70 {
71 global::Interop.SECURITY_STATUS.IllegalMessage,
72 SecurityStatusPalErrorCode.IllegalMessage
73 },
74 {
75 global::Interop.SECURITY_STATUS.IncompleteCredentials,
76 SecurityStatusPalErrorCode.IncompleteCredentials
77 },
78 {
79 global::Interop.SECURITY_STATUS.IncompleteMessage,
80 SecurityStatusPalErrorCode.IncompleteMessage
81 },
82 {
83 global::Interop.SECURITY_STATUS.InternalError,
84 SecurityStatusPalErrorCode.InternalError
85 },
86 {
87 global::Interop.SECURITY_STATUS.InvalidHandle,
88 SecurityStatusPalErrorCode.InvalidHandle
89 },
90 {
91 global::Interop.SECURITY_STATUS.InvalidToken,
92 SecurityStatusPalErrorCode.InvalidToken
93 },
94 {
95 global::Interop.SECURITY_STATUS.LogonDenied,
96 SecurityStatusPalErrorCode.LogonDenied
97 },
98 {
99 global::Interop.SECURITY_STATUS.MessageAltered,
100 SecurityStatusPalErrorCode.MessageAltered
101 },
102 {
103 global::Interop.SECURITY_STATUS.NoAuthenticatingAuthority,
104 SecurityStatusPalErrorCode.NoAuthenticatingAuthority
105 },
106 {
107 global::Interop.SECURITY_STATUS.NoImpersonation,
108 SecurityStatusPalErrorCode.NoImpersonation
109 },
110 {
111 global::Interop.SECURITY_STATUS.NoCredentials,
112 SecurityStatusPalErrorCode.NoCredentials
113 },
114 {
115 global::Interop.SECURITY_STATUS.NotOwner,
116 SecurityStatusPalErrorCode.NotOwner
117 },
118 {
119 global::Interop.SECURITY_STATUS.OK,
120 SecurityStatusPalErrorCode.OK
121 },
122 {
123 global::Interop.SECURITY_STATUS.OutOfMemory,
124 SecurityStatusPalErrorCode.OutOfMemory
125 },
126 {
127 global::Interop.SECURITY_STATUS.OutOfSequence,
128 SecurityStatusPalErrorCode.OutOfSequence
129 },
130 {
131 global::Interop.SECURITY_STATUS.PackageNotFound,
132 SecurityStatusPalErrorCode.PackageNotFound
133 },
134 {
135 global::Interop.SECURITY_STATUS.QopNotSupported,
136 SecurityStatusPalErrorCode.QopNotSupported
137 },
138 {
139 global::Interop.SECURITY_STATUS.Renegotiate,
140 SecurityStatusPalErrorCode.Renegotiate
141 },
142 {
143 global::Interop.SECURITY_STATUS.SecurityQosFailed,
144 SecurityStatusPalErrorCode.SecurityQosFailed
145 },
146 {
147 global::Interop.SECURITY_STATUS.SmartcardLogonRequired,
148 SecurityStatusPalErrorCode.SmartcardLogonRequired
149 },
150 {
151 global::Interop.SECURITY_STATUS.TargetUnknown,
152 SecurityStatusPalErrorCode.TargetUnknown
153 },
154 {
155 global::Interop.SECURITY_STATUS.TimeSkew,
156 SecurityStatusPalErrorCode.TimeSkew
157 },
158 {
159 global::Interop.SECURITY_STATUS.UnknownCredentials,
160 SecurityStatusPalErrorCode.UnknownCredentials
161 },
162 {
163 global::Interop.SECURITY_STATUS.UnsupportedPreauth,
164 SecurityStatusPalErrorCode.UnsupportedPreauth
165 },
166 {
167 global::Interop.SECURITY_STATUS.Unsupported,
168 SecurityStatusPalErrorCode.Unsupported
169 },
170 {
171 global::Interop.SECURITY_STATUS.UntrustedRoot,
172 SecurityStatusPalErrorCode.UntrustedRoot
173 },
174 {
175 global::Interop.SECURITY_STATUS.WrongPrincipal,
176 SecurityStatusPalErrorCode.WrongPrincipal
177 },
178 {
179 global::Interop.SECURITY_STATUS.NoRenegotiation,
180 SecurityStatusPalErrorCode.NoRenegotiation
181 }
182 };
183
185 {
186 return GetSecurityStatusPalFromInterop((global::Interop.SECURITY_STATUS)win32SecurityStatus);
187 }
188
189 internal static SecurityStatusPal GetSecurityStatusPalFromInterop(global::Interop.SECURITY_STATUS win32SecurityStatus, bool attachException = false)
190 {
192 {
194 }
195 if (attachException)
196 {
198 }
199 return new SecurityStatusPal(item);
200 }
201
202 internal static global::Interop.SECURITY_STATUS GetInteropFromSecurityStatusPal(SecurityStatusPal status)
203 {
204 if (!s_statusDictionary.TryGetBackward(status.ErrorCode, out var item))
205 {
206 throw new InternalException(status.ErrorCode);
207 }
208 return item;
209 }
210}
static SecurityStatusPal GetSecurityStatusPalFromNativeInt(int win32SecurityStatus)
static global::Interop.SECURITY_STATUS GetInteropFromSecurityStatusPal(SecurityStatusPal status)
static SecurityStatusPal GetSecurityStatusPalFromInterop(global::Interop.SECURITY_STATUS win32SecurityStatus, bool attachException=false)
static readonly System.Collections.Generic.BidirectionalDictionary< global::Interop.SECURITY_STATUS, System.Net.SecurityStatusPalErrorCode > s_statusDictionary
static System.Net.SecurityStatusPal GetSecurityStatusPalFromInterop(global::Interop.SECURITY_STATUS win32SecurityStatus, bool attachException=false)
readonly System.Net.SecurityStatusPalErrorCode ErrorCode