Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 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);
 }