Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SafeFreeContextBuffer.cs
Go to the documentation of this file.
3
4namespace System.Net.Security;
5
6internal abstract class SafeFreeContextBuffer : SafeHandleZeroOrMinusOneIsInvalid
7{
9 : base(ownsHandle: true)
10 {
11 }
12
13 internal void Set(IntPtr value)
14 {
15 handle = value;
16 }
17
18 internal static int EnumeratePackages(out int pkgnum, out System.Net.Security.SafeFreeContextBuffer pkgArray)
19 {
20 int num = -1;
21 System.Net.Security.SafeFreeContextBuffer_SECURITY safeFreeContextBuffer_SECURITY = null;
22 num = global::Interop.SspiCli.EnumerateSecurityPackagesW(out pkgnum, out safeFreeContextBuffer_SECURITY);
23 pkgArray = safeFreeContextBuffer_SECURITY;
24 if (num != 0)
25 {
26 pkgArray?.SetHandleAsInvalid();
27 }
28 return num;
29 }
30
35
36 public unsafe static int QueryContextAttributes(System.Net.Security.SafeDeleteContext phContext, global::Interop.SspiCli.ContextAttribute contextAttribute, byte* buffer, SafeHandle refHandle)
37 {
38 int num = -2146893055;
39 try
40 {
41 bool success = false;
42 phContext.DangerousAddRef(ref success);
43 num = global::Interop.SspiCli.QueryContextAttributesW(ref phContext._handle, contextAttribute, buffer);
44 }
45 finally
46 {
47 phContext.DangerousRelease();
48 }
49 if (num == 0 && refHandle != null)
50 {
52 {
54 }
55 else
56 {
58 }
59 }
60 if (num != 0)
61 {
62 refHandle?.SetHandleAsInvalid();
63 }
64 return num;
65 }
66}
static System.Net.Security.SafeFreeContextBuffer CreateEmptyHandle()
static int EnumeratePackages(out int pkgnum, out System.Net.Security.SafeFreeContextBuffer pkgArray)
static unsafe int QueryContextAttributes(System.Net.Security.SafeDeleteContext phContext, global::Interop.SspiCli.ContextAttribute contextAttribute, byte *buffer, SafeHandle refHandle)