private void PopulateEntries()
        {
            DirectoryAccessRights granted_access = _directory.GrantedAccess;

            if ((granted_access & DirectoryAccessRights.ReadControl) == DirectoryAccessRights.ReadControl)
            {
                _sd   = _directory.GetSecurityDescriptorBytes(SecurityInformation.Dacl | SecurityInformation.Label | SecurityInformation.Group | SecurityInformation.Owner);
                _sddl = NtSecurity.SecurityDescriptorToSddl(_sd, SecurityInformation.Dacl | SecurityInformation.Label | SecurityInformation.Group | SecurityInformation.Owner);
            }
            else
            {
                _sd   = new byte[0];
                _sddl = String.Empty;
            }


            _full_path = _directory.FullPath;
            if (String.IsNullOrWhiteSpace(_full_path))
            {
                _full_path = _orig_path;
            }

            if ((granted_access & DirectoryAccessRights.Query) != DirectoryAccessRights.Query)
            {
                _entries = new List <ObjectDirectoryEntry>();
            }
            else
            {
                _entries = new List <ObjectDirectoryEntry>(_directory.Query().Select(e => new ObjectDirectoryEntry(e.Name, e.TypeName, this)));
            }
        }
 public static extern NtStatus NtOpenPrivateNamespace(
     out SafeKernelObjectHandle NamespaceHandle,
     DirectoryAccessRights DesiredAccess,
     [In] ObjectAttributes ObjectAttributes,
     IntPtr BoundaryDescriptor);
 public static extern NtStatus NtOpenDirectoryObject(out SafeKernelObjectHandle Handle, DirectoryAccessRights DesiredAccess, [In] ObjectAttributes ObjectAttributes);
 public static extern NtStatus NtCreateDirectoryObjectEx(out SafeKernelObjectHandle Handle,
                                                         DirectoryAccessRights DesiredAccess, ObjectAttributes ObjectAttributes, SafeKernelObjectHandle ShadowDirectory, DirectoryCreateFlags Flags);
Exemplo n.º 5
0
 protected override sealed NtResult <NtDirectory> OpenInternal(ObjectAttributes obj_attributes,
                                                               DirectoryAccessRights desired_access, bool throw_on_error)
 {
     return(NtDirectory.Open(obj_attributes, desired_access, throw_on_error));
 }
Exemplo n.º 6
0
 public void AddAuditRule(IdentityReference identityReference, DirectoryAccessRights accessMask, AuditFlags flags)
 {
     AddAuditRule(new DirectoryAuditRule(identityReference, accessMask, flags));
 }
Exemplo n.º 7
0
 public DirectoryAuditRule(IdentityReference identity, DirectoryAccessRights accessRights, AuditFlags type)
     : base(identity, (int)accessRights, false, InheritanceFlags.None, PropagationFlags.None, type)
 {
 }
Exemplo n.º 8
0
 public void AddAccessRule(IdentityReference identityReference, DirectoryAccessRights accessMask, AccessControlType type)
 {
     AddAccessRule(new DirectoryAccessRule(identityReference, accessMask, type));
 }
Exemplo n.º 9
0
 static extern int NtOpenDirectoryObject(out IntPtr Handle, DirectoryAccessRights DesiredAccess, ObjectAttributes ObjectAttributes);
Exemplo n.º 10
0
 public DirectoryAuditRule(IdentityReference identity, DirectoryAccessRights accessRights, AuditFlags type)
     : base(identity, (int)accessRights, false, InheritanceFlags.None, PropagationFlags.None, type)
 {
 }
Exemplo n.º 11
0
 public void AddAuditRule(IdentityReference identityReference, DirectoryAccessRights accessMask, AuditFlags flags)
 {
     AddAuditRule(new DirectoryAuditRule(identityReference, accessMask, flags));
 }
Exemplo n.º 12
0
 public void AddAccessRule(IdentityReference identityReference, DirectoryAccessRights accessMask, AccessControlType type)
 {
     AddAccessRule(new DirectoryAccessRule(identityReference, accessMask, type));
 }