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 System.Net.Security.SafeFreeCredentials outCredential)
29 {
30 int num = -1;
31 outCredential = new System.Net.Security.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 System.Net.Security.SafeSspiAuthDataHandle authdata, out System.Net.Security.SafeFreeCredentials outCredential)
45 {
46 int num = -1;
47 outCredential = new System.Net.Security.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}
static readonly System.Net.NetEventSource Log
static void Verbose(object thisOrContextObject, FormattableString formattableString, [CallerMemberName] string memberName=null)
static unsafe int AcquireDefaultCredential(string package, global::Interop.SspiCli.CredentialUse intent, out System.Net.Security.SafeFreeCredentials outCredential)
global::Interop.SspiCli.CredHandle _handle
static unsafe int AcquireCredentialsHandle(string package, global::Interop.SspiCli.CredentialUse intent, ref System.Net.Security.SafeSspiAuthDataHandle authdata, out System.Net.Security.SafeFreeCredentials outCredential)
static FormattableString Create(string format, params object?[] arguments)
static readonly IntPtr Zero
Definition IntPtr.cs:18