Exemplo n.º 1
0
        public static RawSecurityDescriptor MarshalToManagedSecurityDescriptor(IntPtr ptrSecDesc)
        {
            if (ptrSecDesc == IntPtr.Zero)
            {
                return(null);
            }
            ControlFlags       controlFlags;
            SecurityIdentifier owner, group;
            RawAcl             sacl, dacl;

            unsafe
            {
                STRUCT_SECURITY_DESCRIPTOR *pSecDesc = (STRUCT_SECURITY_DESCRIPTOR *)ptrSecDesc.ToPointer();
                controlFlags = (ControlFlags)pSecDesc->Control;
                owner        = SID.MarshalToManagedSid(pSecDesc->Owner);
                group        = SID.MarshalToManagedSid(pSecDesc->Group);
                sacl         = ACL.MarshalToManagedAcl(pSecDesc->Sacl);
                dacl         = ACL.MarshalToManagedAcl(pSecDesc->Dacl);
            }
            return(new RawSecurityDescriptor(controlFlags, owner, group, sacl, dacl));
        }
Exemplo n.º 2
0
 public SecurityIdentifier MarshalPrincipalSelfSidToManaged() =>
 SID.MarshalToManagedSid(PrincipalSelfSid);
Exemplo n.º 3
0
 public SecurityIdentifier MarshalSidToManaged() =>
 SID.MarshalToManagedSid(Sid);
Exemplo n.º 4
0
 public unsafe SecurityIdentifier MarshalAppContainerSidToManagedSid() =>
 SID.MarshalToManagedSid(new IntPtr(AppContainerSid));
 public SecurityIdentifier MarshalTrustLevelSidToManaged() =>
 SID.MarshalToManagedSid(TrustLevelSid);
Exemplo n.º 6
0
 public SecurityIdentifier MarshalOwnerToManaged() =>
 SID.MarshalToManagedSid(Owner);
Exemplo n.º 7
0
 public SecurityIdentifier MarshalTokenAppContainerToManaged() =>
 SID.MarshalToManagedSid(TokenAppContainer);
Exemplo n.º 8
0
 public SecurityIdentifier MarshalPrimaryGroupToManaged() =>
 SID.MarshalToManagedSid(PrimaryGroup);