GetVolumeInformation

  BOOL GetVolumeInformation(lpRootPathName, lpVolumeNameBuffer, nVolumeNameSize, lpVolumeSerialNumber, lpMaximumComponentLength, lpFileSystemFlags, lpFileSystemNameBuffer, nFileSystemNameSize)    
  LPTSTR lpRootPathName; /* root dir of the file system */
  LPTSTR lpVolumeNameBuffer; /* name of the volume */
  DWORD nVolumeNameSize; /* length of lpVolumeNameBuffer */
  LPDWORD lpVolumeSerialNumber; /* points to volume serial number */
  LPDWORD lpMaximumComponentLength; /* system's max length of filename */
  LPDWORD lpFileSystemFlags; /* file system flags */
  LPTSTR lpFileSystemNameBuffer; /* name of file system */
  DWORD nFileSystemNameSize; /* length of lpFileSystemNameBuffer */

The GetVolumeInformation function returns information about the file system whose root directory is specified.

Parameters

lpRootPathName

An optional parameter that, if specified, supplies the root directory of the file system being described. If this parameter is not specified, then the root of the current directory is used.

lpVolumeNameBuffer

An optional parameter that, if specified, returns the name of the specified volume.

nVolumeNameSize

Specifies the length in characters of the volume name buffer. This parameter is ignored if the volume name buffer is not supplied.

lpVolumeSerialNumber

An optional parameter that, if specified, points to a pair of DWORDs. The first DWORD contains the low-order 32-bits of the volume serial number. The second DWORD contains the high-order 32-bits of the volume serial number. If the file system does not support 64-bit volume serial numbers, then the high-order 32-bits are zero.

lpMaximumComponentLength

An optional parameter that, if specified, returns the maximum length in characters of a filename component supported by the specified file system. A filename component is that portion of a filename between pathname separators.

lpFileSystemFlags

An optional parameter that, if specified, returns flags associated with the specified file system. This parameter can be any combination of the following flags:

Value Meaning

FS_CASE_IS_PRESERVED  
  Indicates that the case of filenames is preserved when the name is placed on disk.
FS_CASE_SENSITIVE  
  Indicates that the file system supports case sensitive filename lookup.
FS_UNICODE_STORED_ON_DISK  
  Indicates that the file system supports Unicode in filenames as they appear on disk.

lpFileSystemNameBuffer

An optional parameter that, if specified, returns the name of the file system (e.g. FAT, HPFS . . . ).

nFileSystemNameSize

Specifies the length of the file system name buffer in characters. This parameter is ignored if the file system name buffer is not supplied.

Return Value

The return value is TRUE if all the requested information was retrieved, or FALSE if an error occurred. Use the GetLastError function to obtain extended error information.

Comments

The GetVolumeInformation function may be used as either a wide-character function (where text arguments must use Unicode) or an ANSI function (where text arguments must use characters from the Windows 3.x character set installed).