232 references to Interop
System.Security.Principal.Windows (232)
_generated\0\LibraryImports.g.cs (44)
329internal static partial int LsaGetLogonSessionData(ref global::Interop.LUID LogonId, out global::Microsoft.Win32.SafeHandles.SafeLsaReturnBufferHandle ppLogonSessionData) 341fixed (global::Interop.LUID* __LogonId_native = &LogonId) 367static extern unsafe int __PInvoke(global::Interop.LUID* __LogonId_native, nint* __ppLogonSessionData_native); 399internal static partial uint LsaLookupNames2(global::Microsoft.Win32.SafeHandles.SafeLsaPolicyHandle handle, int flags, int count, global::Interop.Advapi32.MARSHALLED_UNICODE_STRING[] names, out global::Microsoft.Win32.SafeHandles.SafeLsaMemoryHandle referencedDomains, out global::Microsoft.Win32.SafeHandles.SafeLsaMemoryHandle sids) 406global::Interop.Advapi32.MARSHALLED_UNICODE_STRING.Marshaller.Native* __names_native = default; 413scoped global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Interop.Advapi32.MARSHALLED_UNICODE_STRING, global::Interop.Advapi32.MARSHALLED_UNICODE_STRING.Marshaller.Native>.ManagedToUnmanagedIn __names_native__marshaller = new(); 419__names_native__marshaller.FromManaged(names, stackalloc global::Interop.Advapi32.MARSHALLED_UNICODE_STRING.Marshaller.Native[global::System.Runtime.InteropServices.Marshalling.ArrayMarshaller<global::Interop.Advapi32.MARSHALLED_UNICODE_STRING, global::Interop.Advapi32.MARSHALLED_UNICODE_STRING.Marshaller.Native>.ManagedToUnmanagedIn.BufferSize]); 421global::System.ReadOnlySpan<global::Interop.Advapi32.MARSHALLED_UNICODE_STRING> __names_native__managedSpan = __names_native__marshaller.GetManagedValuesSource(); 422global::System.Span<global::Interop.Advapi32.MARSHALLED_UNICODE_STRING.Marshaller.Native> __names_native__nativeSpan = __names_native__marshaller.GetUnmanagedValuesDestination(); 425__names_native__nativeSpan[__i0] = global::Interop.Advapi32.MARSHALLED_UNICODE_STRING.Marshaller.ConvertToUnmanaged(__names_native__managedSpan[__i0]); 461global::System.ReadOnlySpan<global::Interop.Advapi32.MARSHALLED_UNICODE_STRING.Marshaller.Native> __names_native__nativeSpan = __names_native__marshaller.GetUnmanagedValuesDestination(); 464global::Interop.Advapi32.MARSHALLED_UNICODE_STRING.Marshaller.Free(__names_native__nativeSpan[__i0]); 476static extern unsafe uint __PInvoke(nint __handle_native, int __flags_native, int __count_native, global::Interop.Advapi32.MARSHALLED_UNICODE_STRING.Marshaller.Native* __names_native, nint* __referencedDomains_native, nint* __sids_native); 593private static partial uint LsaOpenPolicy(ref global::Interop.UNICODE_STRING SystemName, ref global::Interop.OBJECT_ATTRIBUTES ObjectAttributes, int AccessMask, out global::Microsoft.Win32.SafeHandles.SafeLsaPolicyHandle PolicyHandle) 605fixed (global::Interop.OBJECT_ATTRIBUTES* __ObjectAttributes_native = &ObjectAttributes) 606fixed (global::Interop.UNICODE_STRING* __SystemName_native = &SystemName) 632static extern unsafe uint __PInvoke(global::Interop.UNICODE_STRING* __SystemName_native, global::Interop.OBJECT_ATTRIBUTES* __ObjectAttributes_native, int __AccessMask_native, nint* __PolicyHandle_native); 641internal static unsafe partial global::Interop.BOOL ConvertStringSidToSid(string StringSid, out void* Sid) 645global::Interop.BOOL __retVal; 659static extern unsafe global::Interop.BOOL __PInvoke(ushort* __StringSid_native, void** __Sid_native); 980internal static partial int LsaLogonUser(global::Microsoft.Win32.SafeHandles.SafeLsaHandle LsaHandle, in global::Interop.Advapi32.LSA_STRING OriginName, global::Interop.SspiCli.SECURITY_LOGON_TYPE LogonType, int AuthenticationPackage, nint AuthenticationInformation, int AuthenticationInformationLength, nint LocalGroups, in global::Interop.SspiCli.TOKEN_SOURCE SourceContext, out global::Microsoft.Win32.SafeHandles.SafeLsaReturnBufferHandle ProfileBuffer, out int ProfileBufferLength, out global::Interop.LUID LogonId, out global::Microsoft.Win32.SafeHandles.SafeAccessTokenHandle Token, out global::Interop.SspiCli.QUOTA_LIMITS Quotas, out int SubStatus) 1003fixed (global::Interop.SspiCli.QUOTA_LIMITS* __Quotas_native = &Quotas) 1004fixed (global::Interop.LUID* __LogonId_native = &LogonId) 1006fixed (global::Interop.SspiCli.TOKEN_SOURCE* __SourceContext_native = &SourceContext) 1007fixed (global::Interop.Advapi32.LSA_STRING* __OriginName_native = &OriginName) 1038static extern unsafe int __PInvoke(nint __LsaHandle_native, global::Interop.Advapi32.LSA_STRING* __OriginName_native, global::Interop.SspiCli.SECURITY_LOGON_TYPE __LogonType_native, int __AuthenticationPackage_native, nint __AuthenticationInformation_native, int __AuthenticationInformationLength_native, nint __LocalGroups_native, global::Interop.SspiCli.TOKEN_SOURCE* __SourceContext_native, nint* __ProfileBuffer_native, int* __ProfileBufferLength_native, global::Interop.LUID* __LogonId_native, nint* __Token_native, global::Interop.SspiCli.QUOTA_LIMITS* __Quotas_native, int* __SubStatus_native); 1047internal static partial int LsaLookupAuthenticationPackage(global::Microsoft.Win32.SafeHandles.SafeLsaHandle LsaHandle, ref global::Interop.Advapi32.LSA_STRING PackageName, out int AuthenticationPackage) 1060fixed (global::Interop.Advapi32.LSA_STRING* __PackageName_native = &PackageName) 1076static extern unsafe int __PInvoke(nint __LsaHandle_native, global::Interop.Advapi32.LSA_STRING* __PackageName_native, int* __AuthenticationPackage_native); 1085internal static unsafe partial bool AllocateLocallyUniqueId(global::Interop.LUID* Luid) 1098static extern unsafe int __PInvoke(global::Interop.LUID* __Luid_native);
Microsoft\Win32\SafeHandles\SafeAccessTokenHandle.cs (1)
41return Interop.Kernel32.CloseHandle(handle);
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.CheckTokenMembership.cs (1)
12[LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.ConvertStringSidToSid.cs (1)
12[LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSidToSidW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.DuplicateTokenEx.cs (1)
12[LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.GetTokenInformation.cs (1)
12[LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.GetTokenInformation_SafeLocalAllocHandle.cs (2)
12[LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)] 21[LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.GetWindowsAccountDomainSid.cs (1)
11[LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "GetWindowsAccountDomainSid", SetLastError = true)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.ImpersonateLoggedOnUser.cs (1)
12[LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.IsEqualDomainSid.cs (1)
11[LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "EqualDomainSid", SetLastError = true)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.IsWellKnownSid.cs (1)
11[LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "IsWellKnownSid", SetLastError = true)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.LsaClose.cs (1)
11[LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.LsaFreeMemory.cs (1)
11[LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.LsaLookupNames2.cs (1)
13[LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "LsaLookupNames2", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.LsaLookupSids.cs (6)
12[LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "LsaLookupSids", SetLastError = true)] 30referencedDomains.Initialize((uint)Marshal.SizeOf<Interop.LSA_REFERENCED_DOMAIN_LIST>()); 31Interop.LSA_REFERENCED_DOMAIN_LIST domainList = referencedDomains.Read<Interop.LSA_REFERENCED_DOMAIN_LIST>(0); 43Interop.LSA_TRUST_INFORMATION* pTrustInformation = (Interop.LSA_TRUST_INFORMATION*)domainList.Domains;
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.LsaNtStatusToWinError.cs (1)
11[LibraryImport(Interop.Libraries.Advapi32, SetLastError = false)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.LsaOpenPolicy.cs (1)
30[LibraryImport(Interop.Libraries.Advapi32, EntryPoint = "LsaOpenPolicy", SetLastError = true)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.OpenProcessToken_SafeAccessTokenHandle.cs (1)
13[LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.OpenThreadToken_SafeAccessTokenHandle.cs (1)
13[LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.RevertToSelf.cs (1)
11[LibraryImport(Interop.Libraries.Advapi32, SetLastError = true)]
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.GetCurrentThread.cs (1)
11[LibraryImport(Interop.Libraries.Kernel32)]
src\runtime\src\libraries\Common\src\Interop\Windows\SspiCli\Interop.LsaConnectUntrusted.cs (1)
13[LibraryImport(Interop.Libraries.SspiCli)]
src\runtime\src\libraries\Common\src\Interop\Windows\SspiCli\Interop.LsaDeregisterLogonProcess.cs (1)
11[LibraryImport(Interop.Libraries.SspiCli)]
src\runtime\src\libraries\Common\src\Interop\Windows\SspiCli\Interop.LsaFreeReturnBuffer.cs (1)
11[LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
src\runtime\src\libraries\Common\src\Interop\Windows\SspiCli\Interop.LsaGetLogonSessionData.cs (1)
12[LibraryImport(Interop.Libraries.SspiCli, SetLastError = true)]
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeLsaHandle.cs (1)
19int ntStatus = Interop.SspiCli.LsaDeregisterLogonProcess(handle);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeLsaMemoryHandle.cs (1)
21return Interop.Advapi32.LsaFreeMemory(handle) == 0;
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeLsaPolicyHandle.cs (1)
20return Interop.Advapi32.LsaClose(handle) == 0;
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeLsaReturnBufferHandle.cs (1)
23return Interop.SspiCli.LsaFreeReturnBuffer(handle) >= 0;
System\Security\Principal\NTAccount.cs (16)
222Interop.Advapi32.MARSHALLED_UNICODE_STRING[] Names = new Interop.Advapi32.MARSHALLED_UNICODE_STRING[sourceAccounts.Count]; 251LsaHandle = Win32.LsaOpenPolicy(null, Interop.Advapi32.PolicyRights.POLICY_LOOKUP_NAMES); 260ReturnCode = Interop.Advapi32.LsaLookupNames2(LsaHandle, 0, sourceAccounts.Count, Names, out ReferencedDomainsPtr, out SidsPtr); 267if (ReturnCode == Interop.StatusOptions.STATUS_NO_MEMORY || 268ReturnCode == Interop.StatusOptions.STATUS_INSUFFICIENT_RESOURCES) 272else if (ReturnCode == Interop.StatusOptions.STATUS_ACCESS_DENIED) 276else if (ReturnCode == Interop.StatusOptions.STATUS_NONE_MAPPED || 277ReturnCode == Interop.StatusOptions.STATUS_SOME_NOT_MAPPED) 283uint win32ErrorCode = Interop.Advapi32.LsaNtStatusToWinError(ReturnCode); 285if (unchecked((int)win32ErrorCode) != Interop.Errors.ERROR_TRUSTED_RELATIONSHIP_FAILURE) 299if (ReturnCode == 0 || ReturnCode == Interop.StatusOptions.STATUS_SOME_NOT_MAPPED) 301SidsPtr.Initialize((uint)sourceAccounts.Count, (uint)sizeof(Interop.LSA_TRANSLATED_SID2)); 303Interop.LSA_TRANSLATED_SID2[] translatedSids = new Interop.LSA_TRANSLATED_SID2[sourceAccounts.Count]; 308Interop.LSA_TRANSLATED_SID2 Lts = translatedSids[i];
System\Security\Principal\SID.cs (28)
498if (error == Interop.Errors.ERROR_INVALID_SID) 502else if (error == Interop.Errors.ERROR_NOT_ENOUGH_MEMORY) 506else if (error != Interop.Errors.ERROR_SUCCESS) 581if (error == Interop.Errors.ERROR_INSUFFICIENT_BUFFER) 585else if (error == Interop.Errors.ERROR_NON_ACCOUNT_SID) 590else if (error != Interop.Errors.ERROR_SUCCESS) 609if (error == Interop.Errors.ERROR_INVALID_PARAMETER) 615else if (error != Interop.Errors.ERROR_SUCCESS) 772if (error == Interop.Errors.ERROR_INSUFFICIENT_BUFFER) 776else if (error == Interop.Errors.ERROR_NON_ACCOUNT_SID) 780else if (error != Interop.Errors.ERROR_SUCCESS) 979LsaHandle = Win32.LsaOpenPolicy(null, Interop.Advapi32.PolicyRights.POLICY_LOOKUP_NAMES); 987ReturnCode = Interop.Advapi32.LsaLookupSids(LsaHandle, sourceSids.Count, SidArrayPtr, out ReferencedDomainsPtr, out NamesPtr); 994if (ReturnCode == Interop.StatusOptions.STATUS_NO_MEMORY || 995ReturnCode == Interop.StatusOptions.STATUS_INSUFFICIENT_RESOURCES) 999else if (ReturnCode == Interop.StatusOptions.STATUS_ACCESS_DENIED) 1003else if (ReturnCode == Interop.StatusOptions.STATUS_NONE_MAPPED || 1004ReturnCode == Interop.StatusOptions.STATUS_SOME_NOT_MAPPED) 1010uint win32ErrorCode = Interop.Advapi32.LsaNtStatusToWinError(ReturnCode); 1017NamesPtr.Initialize((uint)sourceSids.Count, (uint)sizeof(Interop.LSA_TRANSLATED_NAME)); 1026if (ReturnCode == 0 || ReturnCode == Interop.StatusOptions.STATUS_SOME_NOT_MAPPED) 1032Interop.LSA_REFERENCED_DOMAIN_LIST rdl = ReferencedDomainsPtr.Read<Interop.LSA_REFERENCED_DOMAIN_LIST>(0); 1037Interop.LSA_TRUST_INFORMATION* ti = (Interop.LSA_TRUST_INFORMATION*)rdl.Domains + i; 1041Interop.LSA_TRANSLATED_NAME[] translatedNames = new Interop.LSA_TRANSLATED_NAME[sourceSids.Count]; 1046Interop.LSA_TRANSLATED_NAME Ltn = translatedNames[i];
System\Security\Principal\Win32.cs (16)
22Interop.Advapi32.PolicyRights rights) 25Interop.OBJECT_ATTRIBUTES attributes = default; 26uint error = Interop.Advapi32.LsaOpenPolicy(systemName, ref attributes, (int)rights, out SafeLsaPolicyHandle policyHandle); 34if (error == Interop.StatusOptions.STATUS_ACCESS_DENIED) 38else if (error == Interop.StatusOptions.STATUS_INSUFFICIENT_RESOURCES || 39error == Interop.StatusOptions.STATUS_NO_MEMORY) 45uint win32ErrorCode = Interop.Advapi32.LsaNtStatusToWinError(error); 110if (Interop.BOOL.FALSE == Interop.Advapi32.ConvertStringSidToSid(stringSid, out pSid)) 131return Interop.Errors.ERROR_SUCCESS; 158if (FALSE != Interop.Advapi32.CreateWellKnownSid((int)sidType, domainSid?.BinaryForm, resultSid, ref length)) 160return Interop.Errors.ERROR_SUCCESS; 189return (Interop.Advapi32.IsEqualDomainSid(BinaryForm1, BinaryForm2, out bool result) == FALSE ? false : result); 211if (FALSE != Interop.Advapi32.GetWindowsAccountDomainSid(BinaryForm, resultSidBinary, ref sidLength)) 215return Interop.Errors.ERROR_SUCCESS; 238if (FALSE == Interop.Advapi32.IsWellKnownSid(BinaryForm, (int)type))
System\Security\Principal\WindowsIdentity.cs (91)
16using KERB_LOGON_SUBMIT_TYPE = Interop.SspiCli.KERB_LOGON_SUBMIT_TYPE; 17using KERB_S4U_LOGON = Interop.SspiCli.KERB_S4U_LOGON; 18using KerbS4uLogonFlags = Interop.SspiCli.KerbS4uLogonFlags; 19using LSA_STRING = Interop.Advapi32.LSA_STRING; 20using LUID = Interop.LUID; 21using QUOTA_LIMITS = Interop.SspiCli.QUOTA_LIMITS; 22using SECURITY_LOGON_TYPE = Interop.SspiCli.SECURITY_LOGON_TYPE; 23using TOKEN_SOURCE = Interop.SspiCli.TOKEN_SOURCE; 137int packageId = LookupAuthenticationPackage(lsaHandle, Interop.SspiCli.AuthenticationPackageNames.MICROSOFT_KERBEROS_NAME_A); 146if (!Interop.Advapi32.AllocateLocallyUniqueId(&sourceContext.SourceIdentifier)) 191int ntStatus = Interop.SspiCli.LsaLogonUser( 209if (ntStatus == unchecked((int)Interop.StatusOptions.STATUS_ACCOUNT_RESTRICTION) && subStatus < 0) 234int ntStatus = Interop.SspiCli.LsaConnectUntrusted(out SafeLsaHandle lsaHandle); 250int ntStatus = Interop.SspiCli.LsaLookupAuthenticationPackage(lsaHandle, ref lsaPackageName, out packageId); 266if (!Interop.Advapi32.GetTokenInformation( 272Marshal.GetLastPInvokeError() == Interop.Errors.ERROR_INVALID_HANDLE) 278IntPtr currentProcessHandle = Interop.Kernel32.GetCurrentProcess(); 279if (!Interop.Kernel32.DuplicateHandle( 286Interop.DuplicateHandleOptions.DUPLICATE_SAME_ACCESS)) 387Interop.LUID authId = GetLogonAuthId(_safeTokenHandle); 388if (authId.LowPart == Interop.LuidOptions.ANONYMOUS_LOGON_LUID) 394int status = Interop.SspiCli.LsaGetLogonSessionData(ref authId, out pLogonSessionData); 398pLogonSessionData.Initialize((uint)sizeof(Interop.SECURITY_LOGON_SESSION_DATA)); 400Interop.SECURITY_LOGON_SESSION_DATA logonSessionData = pLogonSessionData.Read<Interop.SECURITY_LOGON_SESSION_DATA>(0); 458new int[] { Interop.SecurityIdentifier.SECURITY_AUTHENTICATED_USER_RID } 484!Interop.Advapi32.DuplicateTokenEx(_safeTokenHandle, 495if (!Interop.Advapi32.CheckTokenMembership((til != TokenImpersonationLevel.None ? _safeTokenHandle : token), 526new int[] { Interop.SecurityIdentifier.SECURITY_BUILTIN_DOMAIN_RID, (int)WindowsBuiltInRole.Guest } 543new int[] { Interop.SecurityIdentifier.SECURITY_LOCAL_SYSTEM_RID } 560new int[] { Interop.SecurityIdentifier.SECURITY_ANONYMOUS_LOGON_RID } 648Interop.TOKEN_GROUPS tokenGroups = pGroups!.Read<Interop.TOKEN_GROUPS>(0); 649Interop.SID_AND_ATTRIBUTES[] groupDetails = new Interop.SID_AND_ATTRIBUTES[tokenGroups.GroupCount]; 655foreach (Interop.SID_AND_ATTRIBUTES group in groupDetails) 658uint mask = Interop.SecurityGroups.SE_GROUP_ENABLED | Interop.SecurityGroups.SE_GROUP_LOGON_ID | Interop.SecurityGroups.SE_GROUP_USE_FOR_DENY_ONLY; 659if ((group.Attributes & mask) == Interop.SecurityGroups.SE_GROUP_ENABLED) 779if (!Interop.Advapi32.RevertToSelf()) 784if (!token.IsInvalid && !Interop.Advapi32.ImpersonateLoggedOnUser(token)) 799if (!Interop.Advapi32.RevertToSelf()) 804if (!Interop.Advapi32.ImpersonateLoggedOnUser(args.CurrentValue)) 842if ((uint)status == Interop.StatusOptions.STATUS_ACCESS_DENIED) 845if ((uint)status == Interop.StatusOptions.STATUS_INSUFFICIENT_RESOURCES || (uint)status == Interop.StatusOptions.STATUS_NO_MEMORY) 848uint win32ErrorCode = Interop.Advapi32.LsaNtStatusToWinError((uint)status); 856bool success = Interop.Advapi32.OpenThreadToken(desiredAccess, WinSecurityContext.Both, out SafeAccessTokenHandle safeTokenHandle); 860if (hr == GetHRForWin32Error(Interop.Errors.ERROR_NO_TOKEN)) 878if (!Interop.Advapi32.OpenProcessToken(Interop.Kernel32.GetCurrentProcess(), desiredAccess, out SafeAccessTokenHandle safeTokenHandle)) 900private static Interop.LUID GetLogonAuthId(SafeAccessTokenHandle safeTokenHandle) 904Interop.TOKEN_STATISTICS statistics = pStatistics!.Read<Interop.TOKEN_STATISTICS>(0); 914Interop.Advapi32.GetTokenInformation(tokenHandle, 922case Interop.Errors.ERROR_BAD_LENGTH: // special case for TokenSessionId. Falling through 923case Interop.Errors.ERROR_INSUFFICIENT_BUFFER: 927bool result = Interop.Advapi32.GetTokenInformation(tokenHandle, 938case Interop.Errors.ERROR_INVALID_HANDLE: 941case Interop.Errors.ERROR_INVALID_PARAMETER: 1095Interop.TOKEN_PRIMARY_GROUP primaryGroup = *(Interop.TOKEN_PRIMARY_GROUP*)(safeAllocHandlePrimaryGroup!.DangerousGetHandle()); 1104Interop.SID_AND_ATTRIBUTES* pSidAndAttributes = (Interop.SID_AND_ATTRIBUTES*) 1109Interop.SID_AND_ATTRIBUTES group = pSidAndAttributes[i]; 1110uint mask = Interop.SecurityGroups.SE_GROUP_ENABLED | Interop.SecurityGroups.SE_GROUP_LOGON_ID | Interop.SecurityGroups.SE_GROUP_USE_FOR_DENY_ONLY; 1113if ((group.Attributes & mask) == Interop.SecurityGroups.SE_GROUP_ENABLED) 1127else if ((group.Attributes & mask) == Interop.SecurityGroups.SE_GROUP_USE_FOR_DENY_ONLY) 1163Interop.SID_AND_ATTRIBUTES user = *(Interop.SID_AND_ATTRIBUTES*)(safeAllocHandle!.DangerousGetHandle()); 1164uint mask = Interop.SecurityGroups.SE_GROUP_USE_FOR_DENY_ONLY; 1174else if ((user.Attributes & mask) == Interop.SecurityGroups.SE_GROUP_USE_FOR_DENY_ONLY) 1207Interop.SID_AND_ATTRIBUTES* pSidAndAttributes = (Interop.SID_AND_ATTRIBUTES*) 1211Interop.SID_AND_ATTRIBUTES group = pSidAndAttributes[i]; 1212uint mask = Interop.SecurityGroups.SE_GROUP_ENABLED | Interop.SecurityGroups.SE_GROUP_LOGON_ID | Interop.SecurityGroups.SE_GROUP_USE_FOR_DENY_ONLY; 1215if ((group.Attributes & mask) == Interop.SecurityGroups.SE_GROUP_ENABLED) 1223else if ((group.Attributes & mask) == Interop.SecurityGroups.SE_GROUP_USE_FOR_DENY_ONLY) 1251Interop.CLAIM_SECURITY_ATTRIBUTES_INFORMATION claimAttributes = *(Interop.CLAIM_SECURITY_ATTRIBUTES_INFORMATION*)(safeAllocHandle!.DangerousGetHandle()); 1257Interop.CLAIM_SECURITY_ATTRIBUTE_V1 windowsClaim = ((Interop.CLAIM_SECURITY_ATTRIBUTE_V1*)claimAttributes.Attribute.pAttributeV1)[attribute]; 1264case Interop.ClaimSecurityAttributeType.CLAIM_SECURITY_ATTRIBUTE_TYPE_STRING: 1276case Interop.ClaimSecurityAttributeType.CLAIM_SECURITY_ATTRIBUTE_TYPE_INT64: 1289case Interop.ClaimSecurityAttributeType.CLAIM_SECURITY_ATTRIBUTE_TYPE_UINT64: 1301case Interop.ClaimSecurityAttributeType.CLAIM_SECURITY_ATTRIBUTE_TYPE_BOOLEAN:
System\Security\Principal\WindowsPrincipal.cs (3)
128int[] { Interop.SecurityIdentifier.SECURITY_BUILTIN_DOMAIN_RID, rid } 153if (!Interop.Advapi32.DuplicateTokenEx(_identity.AccessToken, 167if (!Interop.Advapi32.CheckTokenMembership((_identity.ImpersonationLevel != TokenImpersonationLevel.None ? _identity.AccessToken : token),