Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ QueryContextAttributes() [1/3]

static unsafe int System.Net.Security.SafeFreeContextBuffer.QueryContextAttributes ( SafeDeleteContext phContext,
global::Interop::SspiCli::ContextAttribute contextAttribute,
byte * buffer,
SafeHandle refHandle )
inlinestatic

Definition at line 36 of file SafeFreeContextBuffer.cs.

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 {
51 if (refHandle is SafeFreeContextBuffer)
52 {
53 ((SafeFreeContextBuffer)refHandle).Set(*(IntPtr*)buffer);
54 }
55 else
56 {
57 ((SafeFreeCertContext)refHandle).Set(*(IntPtr*)buffer);
58 }
59 }
60 if (num != 0)
61 {
62 refHandle?.SetHandleAsInvalid();
63 }
64 return num;
65 }

References System.Net.Security.SafeFreeContextBuffer.SafeFreeContextBuffer(), System.Net.Security.SafeDeleteContext._handle, System.buffer, System.Runtime.InteropServices.SafeHandle.DangerousAddRef(), System.Runtime.InteropServices.SafeHandle.DangerousRelease(), and System.Runtime.InteropServices.SafeHandle.SetHandleAsInvalid().