public static extern bool GetVolumeInformation(string rootPathName , StringBuilder volumeNameBuffer , uint volumeNameSize , out uint volumeSerialNumber , out uint maximumComponentLength , out FileSystemFlags fileSystemFlags , StringBuilder fileSystemNameBuffer , uint fileSystemNameSize);
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; }
public static extern bool GetVolumeInformation( string lpRootPathName, StringBuilder lpVolumeNameBuffer, int nVolumeNameSize, out int lpVolumeNameSerialNumber, out int lpMaximumComponentLength, out FileSystemFlags lpFileSystemFlags, StringBuilder lpFileSystemNameBuffer, int nFileSystemNameSize);
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); }
public static extern bool GetVolumeInformationByHandle(IntPtr hFile, IntPtr lpVolumeNameBuffer, int nVolumeNameSize, ref uint lpVolumeSerialNumber, ref int lpMaximumComponentLength, ref FileSystemFlags lpFileSystemFlags, IntPtr lpFileSystemNameBuffer, int nFileSystemNameSize);
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);