Пример #1
0
 public static extern bool GetVolumeInformation(string rootPathName
                                                , StringBuilder volumeNameBuffer
                                                , uint volumeNameSize
                                                , out uint volumeSerialNumber
                                                , out uint maximumComponentLength
                                                , out FileSystemFlags fileSystemFlags
                                                , StringBuilder fileSystemNameBuffer
                                                , uint fileSystemNameSize);
Пример #2
0
 public static extern bool GetVolumeInformation(
     [In] string lpRootPathName,
     [Out] StringBuilder lpVolumeNameBuffer,
     [In] uint nVolumeNameSize,
     [In, Out] ref uint lpVolumeSerialNumber,
     [In, Out] ref uint lpMaximumComponentLength,
     [In, Out][MarshalAs(UnmanagedType.U4)] ref FileSystemFlags lpFileSystemFlags,
     [Out] StringBuilder lpFileSystemNameBuffer,
     [In] uint nFileSystemNameSize);
 public VolumeInformation(string rootPathName, string volumeName, uint volumeSerialNumber, uint maximumComponentLength, FileSystemFlags fileSystemFlags, string fileSystemName)
 {
     RootPathName           = rootPathName;
     VolumeName             = volumeName;
     VolumeSerialNumber     = volumeSerialNumber;
     MaximumComponentLength = maximumComponentLength;
     FileSystemFlags        = fileSystemFlags;
     FileSystemName         = fileSystemName;
 }
Пример #4
0
 public static extern bool GetVolumeInformation(
     string lpRootPathName,
     StringBuilder lpVolumeNameBuffer,
     int nVolumeNameSize,
     out int lpVolumeNameSerialNumber,
     out int lpMaximumComponentLength,
     out FileSystemFlags lpFileSystemFlags,
     StringBuilder lpFileSystemNameBuffer,
     int nFileSystemNameSize);
Пример #5
0
        public static bool IsFeatureSupportedByVolume(string volumeRoot, FileSystemFlags flags)
        {
            uint volumeSerialNumber;
            uint maximumComponentLength;
            uint fileSystemFlags;

            if (!GetVolumeInformation(
                    volumeRoot,
                    null,
                    0,
                    out volumeSerialNumber,
                    out maximumComponentLength,
                    out fileSystemFlags,
                    null,
                    0))
            {
                ThrowLastWin32Exception();
            }

            return((fileSystemFlags & (uint)flags) == (uint)flags);
        }
Пример #6
0
 public static extern bool GetVolumeInformationByHandle(IntPtr hFile, IntPtr lpVolumeNameBuffer, int nVolumeNameSize, ref uint lpVolumeSerialNumber, ref int lpMaximumComponentLength, ref FileSystemFlags lpFileSystemFlags, IntPtr lpFileSystemNameBuffer, int nFileSystemNameSize);
Пример #7
0
 public static extern bool GetVolumeInformation([MarshalAs(UnmanagedType.LPWStr)] string lpRootPathName, IntPtr lpVolumeNameBuffer, int nVolumeNameSize, ref uint lpVolumeSerialNumber, ref int lpMaximumComponentLength, ref FileSystemFlags lpFileSystemFlags, IntPtr lpFileSystemNameBuffer, int nFileSystemNameSize);