Function Reference


_WinAPI_GetDriveGeometryEx

Retrieves extended information about the disk's geometry

#include <WinAPIFiles.au3>
_WinAPI_GetDriveGeometryEx ( $iDrive )

Parameters

$iDrive The physical drive number (0, 1, 2, etc) to retrieve information.

Return Value

Success: The array containing the following information:
[0] - The number of cylinders.
[1] - The type of media.
[2] - The number of tracks per cylinder.
[3] - The number of sectors per track.
[4] - The number of bytes per sector.
[5] - The disk size, in bytes.
Failure: Sets the @error flag to non-zero.

See Also

Search IOCTL_DISK_GET_DRIVE_GEOMETRY_EX in MSDN Library.

Example

#include <WinAPIFiles.au3>

Local $aData, $iDrive = 0

While 1
        $aData = _WinAPI_GetDriveGeometryEx($iDrive)
        If @error Then
                ExitLoop
        EndIf
        If Not $iDrive Then
                ConsoleWrite('-------------------------------' & @CRLF)
        EndIf
        ConsoleWrite('Drive: ' & $iDrive & @CRLF)
        ConsoleWrite('Cylinders: ' & $aData[0] & @CRLF)
        ConsoleWrite('Tracks per Cylinder: ' & $aData[2] & @CRLF)
        ConsoleWrite('Sectors per Track: ' & $aData[3] & @CRLF)
        ConsoleWrite('Bytes per Sector: ' & $aData[4] & @CRLF)
        ConsoleWrite('Total Space: ' & $aData[5] & ' bytes' & @CRLF)
        ConsoleWrite('-------------------------------' & @CRLF)
        $iDrive += 1
WEnd