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

◆ MustRunAcceptSecurityContext_SECURITY() [1/4]

static unsafe int System.Net.Security.SafeDeleteContext.MustRunAcceptSecurityContext_SECURITY ( ref SafeFreeCredentials inCredentials,
bool isContextAbsent,
global::Interop::SspiCli::SecBufferDesc * inputBuffer,
global::Interop::SspiCli::ContextFlags inFlags,
global::Interop::SspiCli::Endianness endianness,
SafeDeleteContext outContext,
ref global::Interop::SspiCli::SecBufferDesc outputBuffer,
ref global::Interop::SspiCli::ContextFlags outFlags,
SafeFreeContextBuffer handleTemplate )
inlinestaticprivateinherited

Definition at line 394 of file SafeDeleteContext.cs.

395 {
396 int num = -2146893055;
397 try
398 {
399 bool success = false;
400 inCredentials.DangerousAddRef(ref success);
401 outContext.DangerousAddRef(ref success);
402 global::Interop.SspiCli.CredHandle credentialHandle = inCredentials._handle;
403 global::Interop.SspiCli.CredHandle credHandle = outContext._handle;
404 void* ptr = (credHandle.IsZero ? null : (&credHandle));
405 isContextAbsent = ptr == null;
406 num = global::Interop.SspiCli.AcceptSecurityContext(ref credentialHandle, ptr, inputBuffer, inFlags, endianness, ref outContext._handle, ref outputBuffer, ref outFlags, out var _);
407 }
408 finally
409 {
410 if (outContext._EffectiveCredential != inCredentials && (num & 0x80000000u) == 0L)
411 {
412 outContext._EffectiveCredential?.DangerousRelease();
413 outContext._EffectiveCredential = inCredentials;
414 }
415 else
416 {
417 inCredentials.DangerousRelease();
418 }
419 outContext.DangerousRelease();
420 }
421 if (handleTemplate != null)
422 {
423 handleTemplate.Set(((global::Interop.SspiCli.SecBuffer*)outputBuffer.pBuffers)->pvBuffer);
424 if (handleTemplate.IsInvalid)
425 {
426 handleTemplate.SetHandleAsInvalid();
427 }
428 }
429 if (isContextAbsent && (num & 0x80000000u) != 0L)
430 {
431 outContext._handle.SetToInvalid();
432 }
433 return num;
434 }

References Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid.IsInvalid, System.L, System.Net.Security.SafeFreeContextBuffer.Set(), and System.Runtime.InteropServices.SafeHandle.SetHandleAsInvalid().