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

◆ AcquireCredentialsHandle() [3/4]

static System.Net.Security.SafeFreeCredentials System.Net.Security.NegotiateStreamPal.AcquireCredentialsHandle ( string package,
bool isServer,
NetworkCredential credential )
inlinestaticpackage

Definition at line 20 of file NegotiateStreamPal.cs.

21 {
23 try
24 {
25 global::Interop.SECURITY_STATUS sECURITY_STATUS = global::Interop.SspiCli.SspiEncodeStringsAsAuthIdentity(credential.UserName, credential.Domain, credential.Password, out authData);
26 if (sECURITY_STATUS != 0)
27 {
28 if (System.Net.NetEventSource.Log.IsEnabled())
29 {
30 System.Net.NetEventSource.Error(null, System.SR.Format(System.SR.net_log_operation_failed_with_error, "SspiEncodeStringsAsAuthIdentity", $"0x{sECURITY_STATUS:X}"), "AcquireCredentialsHandle");
31 }
32 throw new Win32Exception((int)sECURITY_STATUS);
33 }
34 return System.Net.SSPIWrapper.AcquireCredentialsHandle(System.Net.GlobalSSPI.SSPIAuth, package, isServer ? global::Interop.SspiCli.CredentialUse.SECPKG_CRED_INBOUND : global::Interop.SspiCli.CredentialUse.SECPKG_CRED_OUTBOUND, ref authData);
35 }
36 finally
37 {
38 authData?.Dispose();
39 }
40 }
static readonly System.Net.SSPIAuthType SSPIAuth
Definition GlobalSSPI.cs:5
static readonly System.Net.NetEventSource Log
static void Error(object thisOrContextObject, FormattableString formattableString, [CallerMemberName] string memberName=null)
static System.Net.Security.SafeFreeCredentials AcquireCredentialsHandle(System.Net.ISSPIInterface secModule, string package, global::Interop.SspiCli.CredentialUse intent, ref System.Net.Security.SafeSspiAuthDataHandle authdata)
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string net_log_operation_failed_with_error
Definition SR.cs:154
Definition SR.cs:7

References System.Net.SSPIWrapper.AcquireCredentialsHandle(), System.Runtime.InteropServices.SafeHandle.Dispose(), System.Net.NetworkCredential.Domain, System.Net.NetEventSource.Error(), System.SR.Format(), System.Net.NetEventSource.Log, System.SR.net_log_operation_failed_with_error, System.Net.NetworkCredential.Password, System.Net.GlobalSSPI.SSPIAuth, and System.Net.NetworkCredential.UserName.