I need to programmatically determine out how many sectors, heads, and cylinders are on a physical disk from Windows XP. Does anyone know the API for determining this? Where might Windows expose this information?
Use DeviceIoControl with control code IOCTL_DISK_GET_DRIVE_GEOMETRY or IOCTL_DISK_GET_DRIVE_GEOMETRY_EX.
There's sample code in MSDN to do this here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With