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);
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)); }
public void AddAuditRule(IdentityReference identityReference, DirectoryAccessRights accessMask, AuditFlags flags) { AddAuditRule(new DirectoryAuditRule(identityReference, accessMask, flags)); }
public DirectoryAuditRule(IdentityReference identity, DirectoryAccessRights accessRights, AuditFlags type) : base(identity, (int)accessRights, false, InheritanceFlags.None, PropagationFlags.None, type) { }
public void AddAccessRule(IdentityReference identityReference, DirectoryAccessRights accessMask, AccessControlType type) { AddAccessRule(new DirectoryAccessRule(identityReference, accessMask, type)); }
static extern int NtOpenDirectoryObject(out IntPtr Handle, DirectoryAccessRights DesiredAccess, ObjectAttributes ObjectAttributes);