GetDiskInfo
InstallShield 2022 » InstallScript Language Reference
The GetDiskInfo function gets information about a specified disk drive. By inspecting the values assigned to members of this variable, your script can determine the information about a disk drive.
Syntax
GetDiskInfo ( _DISK_INFO& pdi );
Parameters
| Parameter | Description | 
| _DISK_INFO& pdi | Specifies a pointer to an existing _DISK_INFO structure (allocated by the installation before calling the function) that specifies the information to retrieve and contains the specified information after the function returns. | 
The following table shows the meaning of each _DISK_INFO member:
| Member | Meaning | |||||||||||||||||||||
| szDiskPath[_MAX_PATH] | Specifies the fully qualified path of the drive to return the information for. | |||||||||||||||||||||
| nInfoToQuery | Specifies the information to query. Possible values are the following: 
 
 
 
 
 | |||||||||||||||||||||
| nBytesPerCluster | Returns the number of bytes per cluster if DISK_INFO_QUERY_BYTES_PER_CLUSTER was specified in nInfoToQuery. | |||||||||||||||||||||
| nTotalSpaceHigh | Returns the upper 31 bits of the total space on the target drive. | |||||||||||||||||||||
| nTotalSpaceLow | Returns the lower 31 bits of the total space on the target drive. | |||||||||||||||||||||
| nFreeSpaceHigh | Returns the upper 31 bits of the free space on the target drive. | |||||||||||||||||||||
| nFreeSpaceLow | Returns the lower 31 bits of the free space on the target drive. | |||||||||||||||||||||
| nDriveType | Returns the drive type using the same constants returned by the Windows API GetDriveType. For convenience, the following constants are predefined: 
 
 
 
 
 
 
 | |||||||||||||||||||||
| nResultDiskSpace | This member contains valid information on return when any of the following flags are specified: 
 
 
 This member returns the result of querying the information. | 
Return Values
| Return Value | Description | 
| ISERR_SUCCESS | Indicates that the function was successful. | 
| < ISERR_SUCCESS | Indicates that the function was unsuccessful. If a null pointer is passed to the function, this value is returned. | 
You can check the nResultDiskSpace member to determine whether the query was successful.
See Also