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

◆ AddPrimarySidClaim()

void System.Security.Principal.WindowsIdentity.AddPrimarySidClaim ( List< Claim > instanceClaims)
inlineprivate

Definition at line 889 of file WindowsIdentity.cs.

890 {
892 {
893 return;
894 }
896 try
897 {
899 global::Interop.SID_AND_ATTRIBUTES sID_AND_ATTRIBUTES = Marshal.PtrToStructure<global::Interop.SID_AND_ATTRIBUTES>(safeLocalAllocHandle.DangerousGetHandle());
900 uint num = 16u;
901 SecurityIdentifier securityIdentifier = new SecurityIdentifier(sID_AND_ATTRIBUTES.Sid);
902 if (sID_AND_ATTRIBUTES.Attributes == 0)
903 {
904 Claim claim = new Claim("http://schemas.microsoft.com/ws/2008/06/identity/claims/primarysid", securityIdentifier.Value, "http://www.w3.org/2001/XMLSchema#string", _issuerName, _issuerName, this);
905 claim.Properties.Add("http://schemas.microsoft.com/ws/2008/06/identity/claims/windowssubauthority", securityIdentifier.IdentifierAuthority.ToString());
907 }
908 else if ((sID_AND_ATTRIBUTES.Attributes & num) == 16)
909 {
910 Claim claim = new Claim("http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlyprimarysid", securityIdentifier.Value, "http://www.w3.org/2001/XMLSchema#string", _issuerName, _issuerName, this);
911 claim.Properties.Add("http://schemas.microsoft.com/ws/2008/06/identity/claims/windowssubauthority", securityIdentifier.IdentifierAuthority.ToString());
913 }
914 }
915 finally
916 {
917 safeLocalAllocHandle?.Dispose();
918 }
919 }
void Add(TKey key, TValue value)
static ? object PtrToStructure(IntPtr ptr, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors|DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type structureType)
Definition Marshal.cs:1164
static SafeLocalAllocHandle GetTokenInformation(SafeAccessTokenHandle tokenHandle, TokenInformationClass tokenInformationClass, bool nullOnInvalidParam=false)

References System.Security.Principal.WindowsIdentity._issuerName, System.Security.Principal.WindowsIdentity._safeTokenHandle, System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Runtime.Serialization.Dictionary, System.Security.Principal.WindowsIdentity.GetTokenInformation(), Microsoft.Win32.SafeHandles.SafeAccessTokenHandle.IsInvalid, and System.Runtime.InteropServices.Marshal.PtrToStructure().

Referenced by System.Security.Principal.WindowsIdentity.InitializeClaims().