69 references to NativeMethods
System.IdentityModel (69)
System\IdentityModel\Claims\WindowsClaimSet.cs (11)
288
uint mask =
NativeMethods
.SE_GROUP_ENABLED |
NativeMethods
.SE_GROUP_LOGON_ID |
NativeMethods
.SE_GROUP_USE_FOR_DENY_ONLY;
289
if ((group.Attributes & mask) ==
NativeMethods
.SE_GROUP_ENABLED)
293
else if ((group.Attributes & mask) ==
NativeMethods
.SE_GROUP_USE_FOR_DENY_ONLY)
317
bool result =
NativeMethods
.GetTokenInformation(tokenHandle,
325
case
NativeMethods
.ERROR_BAD_LENGTH:
327
case
NativeMethods
.ERROR_INSUFFICIENT_BUFFER:
329
result =
NativeMethods
.GetTokenInformation(tokenHandle,
359
uint mask =
NativeMethods
.SE_GROUP_USE_FOR_DENY_ONLY;
365
else if ((user.Attributes & mask) ==
NativeMethods
.SE_GROUP_USE_FOR_DENY_ONLY)
System\IdentityModel\Privilege.cs (10)
70
if (!
NativeMethods
.AdjustTokenPrivileges(
85
if (!
NativeMethods
.RevertToSelf())
110
if (!
NativeMethods
.OpenThreadToken(
111
NativeMethods
.GetCurrentThread(),
125
if (!
NativeMethods
.OpenProcessToken(
126
NativeMethods
.GetCurrentProcess(),
137
if (!
NativeMethods
.DuplicateTokenEx(
181
success =
NativeMethods
.AdjustTokenPrivileges(
218
if (!
NativeMethods
.SetThreadToken(IntPtr.Zero, threadToken))
244
if (!
NativeMethods
.LookupPrivilegeValueW(null, privilege, out luid))
System\IdentityModel\RijndaelCryptoServiceProvider.cs (12)
83
ThrowIfFalse(SR.AESCryptAcquireContextFailed,
NativeMethods
.CryptAcquireContextW(out provHandle, null, null,
NativeMethods
.PROV_RSA_AES,
NativeMethods
.CRYPT_VERIFYCONTEXT));
92
pbhdr->bType =
NativeMethods
.PLAINTEXTKEYBLOB;
93
pbhdr->bVersion =
NativeMethods
.CUR_BLOB_VERSION;
96
pbhdr->aiKeyAlg =
NativeMethods
.CALG_AES_128;
98
pbhdr->aiKeyAlg =
NativeMethods
.CALG_AES_192;
100
pbhdr->aiKeyAlg =
NativeMethods
.CALG_AES_256;
114
ThrowIfFalse(SR.AESCryptSetKeyParamFailed,
NativeMethods
.CryptSetKeyParam(keyHandle,
NativeMethods
.KP_IV, pbIVPtr, 0));
289
ThrowIfFalse(SR.AESCryptEncryptFailed,
NativeMethods
.CryptEncrypt(keyHandle, IntPtr.Zero, final, 0, tempBufferPtr, ref dwCount, tempBuffer.Length - tempOffset));
318
ThrowIfFalse(SR.AESCryptDecryptFailed,
NativeMethods
.CryptDecrypt(keyHandle, IntPtr.Zero, bFinal, 0, outputBufferPtr, ref dwCount));
System\IdentityModel\SafeCryptHandles.cs (3)
36
return
NativeMethods
.CryptReleaseContext(handle, 0);
63
bool ret =
NativeMethods
.CryptDestroyKey(handle);
99
b =
NativeMethods
.CryptImportKey(provHandle, pbDataPtr, (uint)cbData, IntPtr.Zero, 0, out keyHandle);
System\IdentityModel\Selectors\WindowsUserNameSecurityTokenAuthenticator.cs (1)
52
if (!
NativeMethods
.LogonUser(userName, domain, password, LOGON32_LOGON_NETWORK_CLEARTEXT, LOGON32_PROVIDER_DEFAULT, out tokenHandle))
System\IdentityModel\Selectors\X509SecurityTokenAuthenticator.cs (23)
145
pSourceName = SafeHGlobalHandle.AllocHGlobal(
NativeMethods
.LsaSourceName.Length + 1);
146
Marshal.Copy(
NativeMethods
.LsaSourceName, 0, pSourceName.DangerousGetHandle(),
NativeMethods
.LsaSourceName.Length);
147
UNICODE_INTPTR_STRING sourceName = new UNICODE_INTPTR_STRING(
NativeMethods
.LsaSourceName.Length,
NativeMethods
.LsaSourceName.Length + 1, pSourceName.DangerousGetHandle());
167
status =
NativeMethods
.LsaRegisterLogonProcess(ref sourceName, out logonHandle, out dummy);
168
if (
NativeMethods
.ERROR_ACCESS_DENIED ==
NativeMethods
.LsaNtStatusToWinError(status))
171
status =
NativeMethods
.LsaConnectUntrusted(out logonHandle);
175
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new Win32Exception(
NativeMethods
.LsaNtStatusToWinError(status)));
201
pPackageName = SafeHGlobalHandle.AllocHGlobal(
NativeMethods
.LsaKerberosName.Length + 1);
202
Marshal.Copy(
NativeMethods
.LsaKerberosName, 0, pPackageName.DangerousGetHandle(),
NativeMethods
.LsaKerberosName.Length);
203
UNICODE_INTPTR_STRING packageName = new UNICODE_INTPTR_STRING(
NativeMethods
.LsaKerberosName.Length,
NativeMethods
.LsaKerberosName.Length + 1, pPackageName.DangerousGetHandle());
206
status =
NativeMethods
.LsaLookupAuthenticationPackage(logonHandle, ref packageName, out packageId);
209
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new Win32Exception(
NativeMethods
.LsaNtStatusToWinError(status)));
214
if (!
NativeMethods
.AllocateLocallyUniqueId(out sourceContext.SourceIdentifier))
232
pInfo->Flags =
NativeMethods
.KERB_CERTIFICATE_S4U_LOGON_FLAG_CHECK_LOGONHOURS;
246
status =
NativeMethods
.LsaLogonUser(
264
if ((uint)status ==
NativeMethods
.STATUS_ACCOUNT_RESTRICTION && subStatus < 0)
270
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new Win32Exception(
NativeMethods
.LsaNtStatusToWinError(status)));
274
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new Win32Exception(
NativeMethods
.LsaNtStatusToWinError(subStatus)));
System\IdentityModel\SspiSafeHandles.cs (2)
1473
return
NativeMethods
.LsaDeregisterLogonProcess(handle) >= 0;
1496
return
NativeMethods
.LsaFreeReturnBuffer(handle) >= 0;
System\IdentityModel\SspiWrapper.cs (2)
823
retCode =
NativeMethods
.SspiPromptForCredentials(targetName, ref credui_Info, 0, packageName, IntPtr.Zero, out ppAuthIdentity, ref saveCredentials, 0);
829
return
NativeMethods
.SspiIsPromptingNeeded(ErrorOrNtStatus);
System\IdentityModel\Tokens\RsaSecurityToken.cs (2)
96
if (!
NativeMethods
.CryptAcquireContextW(out provHandle,
100
NativeMethods
.CRYPT_DELETEKEYSET))
System\IdentityModel\Tokens\SessionSecurityToken.cs (2)
1032
if (!
NativeMethods
.TranslateName(shortDomainName, EXTENDED_NAME_FORMAT.NameSamCompatible, EXTENDED_NAME_FORMAT.NameCanonical,
1039
if (!
NativeMethods
.TranslateName(shortDomainName, EXTENDED_NAME_FORMAT.NameSamCompatible, EXTENDED_NAME_FORMAT.NameCanonical,
System\IdentityModel\Tokens\WindowsUserNameSecurityTokenHandler.cs (1)
95
if (!
NativeMethods
.LogonUser(userName, domain, password, LOGON32_LOGON_NETWORK_CLEARTEXT, LOGON32_PROVIDER_DEFAULT, out tokenHandle))