public override Int32 GetSecurityByName( String fileName, out UInt32 fileAttributes /* or ReparsePointIndex */, ref Byte[] securityDescriptor) { string path = GetWritePath(fileName); if (!FileOrDirectoryExists(path)) { path = GetReadOnlyPath(fileName); } System.IO.FileInfo info = new System.IO.FileInfo(path); fileAttributes = (UInt32)info.Attributes; if (null != securityDescriptor) { if (FileOrDirectoryExists(path)) { securityDescriptor = info.GetAccessControl().GetSecurityDescriptorBinaryForm(); } } return(STATUS_SUCCESS); }
public override Int32 GetSecurityByName( String FileName, out UInt32 FileAttributes /* or ReparsePointIndex */, ref Byte[] SecurityDescriptor) { FileName = ConcatPath(FileName); System.IO.FileInfo Info = new System.IO.FileInfo(FileName); FileAttributes = (UInt32)Info.Attributes; if (null != SecurityDescriptor) { SecurityDescriptor = Info.GetAccessControl().GetSecurityDescriptorBinaryForm(); } return(STATUS_SUCCESS); }