199 {
200 int num = -2146893055;
201 try
202 {
203 bool success = false;
204 inCredentials.DangerousAddRef(ref success);
206 global::Interop.SspiCli.CredHandle credentialHandle = inCredentials._handle;
207 global::Interop.SspiCli.CredHandle credHandle = outContext.
_handle;
208 void* ptr = (credHandle.IsZero ? null : (&credHandle));
209 isContextAbsent = ptr == null;
210 num = global::Interop.SspiCli.InitializeSecurityContextW(ref credentialHandle, ptr, targetName, inFlags, 0, endianness, inputBuffer, 0, ref outContext.
_handle, ref outputBuffer, ref attributes, out var _);
211 }
212 finally
213 {
215 {
217 outContext._EffectiveCredential = inCredentials;
218 }
219 else
220 {
221 inCredentials.DangerousRelease();
222 }
224 }
225 if (handleTemplate != null)
226 {
227 handleTemplate.
Set(((global::Interop.SspiCli.SecBuffer*)outputBuffer.pBuffers)->pvBuffer);
229 {
231 }
232 }
233 if (isContextAbsent && (num & 0x80000000u) != 0
L)
234 {
235 outContext.
_handle.SetToInvalid();
236 }
237 return num;
238 }
global::Interop.SspiCli.CredHandle _handle
System.Net.Security.SafeFreeCredentials _EffectiveCredential
void DangerousAddRef(ref bool success)
void SetHandleAsInvalid()