Inheritance: SmbComNtTransaction
Example #1
0
 /// <summary>
 /// Return an array of Access Control Entry (ACE) objects representing
 /// the security descriptor associated with this file or directory.
 /// </summary>
 /// <remarks>
 /// Return an array of Access Control Entry (ACE) objects representing
 /// the security descriptor associated with this file or directory.
 /// If no DACL is present, null is returned. If the DACL is empty, an array with 0 elements is returned.
 /// </remarks>
 /// <param name="resolveSids">
 /// Attempt to resolve the SIDs within each ACE form
 /// their numeric representation to their corresponding account names.
 /// </param>
 /// <exception cref="System.IO.IOException"></exception>
 public virtual Ace[] GetSecurity(bool resolveSids)
 {
     int f;
     Ace[] aces;
     f = Open0(ORdonly, SmbConstants.ReadControl, 0, IsDirectory() ? 1 : 0);
     NtTransQuerySecurityDesc request = new NtTransQuerySecurityDesc(f, 0x04);
     NtTransQuerySecurityDescResponse response = new NtTransQuerySecurityDescResponse(
         );
     try
     {
         Send(request, response);
     }
     finally
     {
         Close(f, 0L);
     }
     aces = response.SecurityDescriptor.Aces;
     if (aces != null)
     {
         ProcessAces(aces, resolveSids);
     }
     return aces;
 }