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