/// <summary>Enumerates the ACEs in an ACL.</summary> /// <param name="pAcl">A pointer to an ACL that contains the ACE to be retrieved.</param> /// <returns>A sequence of PACE values from the ACL.</returns> public static IEnumerable <PACE> EnumerateAces(this PACL pAcl) { for (var i = 0U; i < pAcl.AceCount(); i++) { yield return(GetAce(pAcl, i)); } }
public override INHERITED_FROM[] GetInheritSource(string objName, string serverName, bool isContainer, uint si, PACL pAcl) { // Get list of all parents //var obj = SecuredObject.GetKnownObject(Windows.Forms.AccessControlEditorDialog.TaskResourceType, objName, serverName); //var parents = new System.Collections.Generic.List<object>(); //var folder = obj.GetPropertyValue(isContainer ? "Parent" : "Folder"); //while (folder != null) //{ // parents.Add(folder); // folder = folder.GetPropertyValue("Parent"); //} // For each ACE, walk up list of lists of parents to determine if there's a matching one. // var acl = RawAclFromPtr(pAcl); // for (int i = 0; i < acl.Count; i++) { } return(new INHERITED_FROM[pAcl.AceCount()]); }
public static uint GetAceCount(this PACL pAcl) => pAcl.AceCount();