Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SafeFreeCredentials.cs
Go to the documentation of this file.
3
4namespace System.Net.Security;
5
6internal abstract class SafeFreeCredentials : SafeHandle
7{
8 internal global::Interop.SspiCli.CredHandle _handle;
9
10 public override bool IsInvalid
11 {
12 get
13 {
14 if (!base.IsClosed)
15 {
16 return _handle.IsZero;
17 }
18 return true;
19 }
20 }
21
23 : base(IntPtr.Zero, ownsHandle: true)
24 {
25 _handle = default(global::Interop.SspiCli.CredHandle);
26 }
27
28 public unsafe static int AcquireDefaultCredential(string package, global::Interop.SspiCli.CredentialUse intent, out SafeFreeCredentials outCredential)
29 {
30 int num = -1;
31 outCredential = new SafeFreeCredential_SECURITY();
32 num = global::Interop.SspiCli.AcquireCredentialsHandleW(null, package, (int)intent, null, IntPtr.Zero, null, null, ref outCredential._handle, out var _);
33 if (System.Net.NetEventSource.Log.IsEnabled())
34 {
35 System.Net.NetEventSource.Verbose(null, FormattableStringFactory.Create("{0} returns 0x{1:x}, handle = {2}", "AcquireCredentialsHandleW", num, outCredential), "AcquireDefaultCredential");
36 }
37 if (num != 0)
38 {
39 outCredential.SetHandleAsInvalid();
40 }
41 return num;
42 }
43
44 public unsafe static int AcquireCredentialsHandle(string package, global::Interop.SspiCli.CredentialUse intent, ref SafeSspiAuthDataHandle authdata, out SafeFreeCredentials outCredential)
45 {
46 int num = -1;
47 outCredential = new SafeFreeCredential_SECURITY();
48 num = global::Interop.SspiCli.AcquireCredentialsHandleW(null, package, (int)intent, null, authdata, null, null, ref outCredential._handle, out var _);
49 if (num != 0)
50 {
51 outCredential.SetHandleAsInvalid();
52 }
53 return num;
54 }
55
56 public unsafe static int AcquireCredentialsHandle(string package, global::Interop.SspiCli.CredentialUse intent, global::Interop.SspiCli.SCHANNEL_CRED* authdata, out SafeFreeCredentials outCredential)
57 {
58 int num = -1;
59 outCredential = new SafeFreeCredential_SECURITY();
60 num = global::Interop.SspiCli.AcquireCredentialsHandleW(null, package, (int)intent, null, authdata, null, null, ref outCredential._handle, out var _);
61 if (System.Net.NetEventSource.Log.IsEnabled())
62 {
63 System.Net.NetEventSource.Verbose(null, FormattableStringFactory.Create("{0} returns 0x{1:x}, handle = {2}", "AcquireCredentialsHandleW", num, outCredential), "AcquireCredentialsHandle");
64 }
65 if (num != 0)
66 {
67 outCredential.SetHandleAsInvalid();
68 }
69 return num;
70 }
71
72 public unsafe static int AcquireCredentialsHandle(string package, global::Interop.SspiCli.CredentialUse intent, global::Interop.SspiCli.SCH_CREDENTIALS* authdata, out SafeFreeCredentials outCredential)
73 {
74 outCredential = new SafeFreeCredential_SECURITY();
75 long timeStamp;
76 int num = global::Interop.SspiCli.AcquireCredentialsHandleW(null, package, (int)intent, null, authdata, null, null, ref outCredential._handle, out timeStamp);
77 if (System.Net.NetEventSource.Log.IsEnabled())
78 {
79 System.Net.NetEventSource.Verbose(null, FormattableStringFactory.Create("{0} returns 0x{1:x}, handle = {2}", "AcquireCredentialsHandleW", num, outCredential), "AcquireCredentialsHandle");
80 }
81 if (num != 0)
82 {
83 outCredential.SetHandleAsInvalid();
84 }
85 return num;
86 }
87}
static readonly System.Net.NetEventSource Log
static void Verbose(object thisOrContextObject, FormattableString formattableString, [CallerMemberName] string memberName=null)
global::Interop.SspiCli.CredHandle _handle
static unsafe int AcquireCredentialsHandle(string package, global::Interop.SspiCli.CredentialUse intent, ref SafeSspiAuthDataHandle authdata, out SafeFreeCredentials outCredential)
static unsafe int AcquireCredentialsHandle(string package, global::Interop.SspiCli.CredentialUse intent, global::Interop.SspiCli.SCHANNEL_CRED *authdata, out SafeFreeCredentials outCredential)
static unsafe int AcquireDefaultCredential(string package, global::Interop.SspiCli.CredentialUse intent, out SafeFreeCredentials outCredential)
static unsafe int AcquireCredentialsHandle(string package, global::Interop.SspiCli.CredentialUse intent, global::Interop.SspiCli.SCH_CREDENTIALS *authdata, out SafeFreeCredentials outCredential)
static FormattableString Create(string format, params object?[] arguments)
static readonly IntPtr Zero
Definition IntPtr.cs:18