コード例 #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));
        }
コード例 #2
0
 public SecurityIdentifier MarshalPrincipalSelfSidToManaged() =>
 SID.MarshalToManagedSid(PrincipalSelfSid);
コード例 #3
0
 public SecurityIdentifier MarshalSidToManaged() =>
 SID.MarshalToManagedSid(Sid);
コード例 #4
0
 public unsafe SecurityIdentifier MarshalAppContainerSidToManagedSid() =>
 SID.MarshalToManagedSid(new IntPtr(AppContainerSid));
コード例 #5
0
 public SecurityIdentifier MarshalTrustLevelSidToManaged() =>
 SID.MarshalToManagedSid(TrustLevelSid);
コード例 #6
0
ファイル: TOKEN_OWNER.cs プロジェクト: CodeAbyss/windows-api
 public SecurityIdentifier MarshalOwnerToManaged() =>
 SID.MarshalToManagedSid(Owner);
コード例 #7
0
 public SecurityIdentifier MarshalTokenAppContainerToManaged() =>
 SID.MarshalToManagedSid(TokenAppContainer);
コード例 #8
0
 public SecurityIdentifier MarshalPrimaryGroupToManaged() =>
 SID.MarshalToManagedSid(PrimaryGroup);