Skip to content

Latest commit

 

History

History
88 lines (63 loc) · 3 KB

GetVolumeInformation.md

File metadata and controls

88 lines (63 loc) · 3 KB

Home

Function name : GetVolumeInformation

Group: File System - Library: kernel32


Retrieves information about a file system and volume whose root directory is specified.


Code examples:

Enumerating Volumes and Volume Mounting Points (NTFS)
Basic Volume information
Disk in drive A:
Detecting changes in connections to removable drives (VFP9)

Declaration:

BOOL GetVolumeInformation(
  LPCTSTR lpRootPathName,           // root directory
  LPTSTR lpVolumeNameBuffer,        // volume name buffer
  DWORD nVolumeNameSize,            // length of name buffer
  LPDWORD lpVolumeSerialNumber,     // volume serial number
  LPDWORD lpMaximumComponentLength, // maximum file name length
  LPDWORD lpFileSystemFlags,        // file system options
  LPTSTR lpFileSystemNameBuffer,    // file system name buffer
  DWORD nFileSystemNameSize         // length of file system name buffer
);  

FoxPro declaration:

DECLARE SHORT GetVolumeInformation IN kernel32;
	STRING    lpRootPathName,;
	STRING  @ lpVolumeNameBuffer,;
	INTEGER   nVolumeNameSize,;
	INTEGER @ lpVolumeSerialNumber,;
	INTEGER @ lpMaximumComponentLength,;
	INTEGER @ lpFlags,;
	STRING  @ lpFileSystemNameBuffer,;
	INTEGER   nFileSystemNameSize
  

Parameters:

lpRootPathName [in] Pointer to a string that contains the root directory of the volume to be described.

lpVolumeNameBuffer [out] Pointer to a buffer that receives the name of the specified volume.

nVolumeNameSize [in] Specifies the length, in TCHARs, of the volume name buffer.

lpVolumeSerialNumber [out] Pointer to a variable that receives the volume serial number.

lpMaximumComponentLength [out] Pointer to a variable that receives the maximum length, in TCHARs, of a file name component supported by the specified file system.

lpFileSystemFlags [out] Pointer to a variable that receives flags associated with the specified file system.

lpFileSystemNameBuffer [out] Pointer to a buffer that receives the name of the file system (such as FAT or NTFS).

nFileSystemNameSize [in] Specifies the length, in TCHARs, of the file system name buffer.


Return value:

If all the requested information is retrieved, the return value is nonzero.


Comments:

If you are attempting to obtain information about a floppy drive that does not have a floppy disk or a CD-ROM drive that does not have a compact disc, the system displays a message box asking the user to insert a floppy disk or a compact disc, respectively. To prevent the system from displaying this message box, call the function with SEM_FAILCRITICALERRORS.

With this function you can check "no-disk" status of a floppy drive or CD-ROM drive, and long filenames support on a volume.