Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

number of sectors on drive

Status
Not open for further replies.

john829

Programmer
Sep 14, 1999
10
US
I need to find the number of sectors on a drive(LBA). I have used the DeviceIocontrol and the IOCTL_DISK_GET_DRIVE_GEOMETRY, then accessed the data members, but these seem to return the CHS capacity. my 14 GB drive returns cylinders =1024 head = 255 Sector =63 bytes per sector =512. This results in 1024*255*63*512/1mil which is about 8.4 gigs, the chs limit. This would indicate that the drive has 16514064 sectors, but I don't think that this is correct. Does anyone have an idea of how to do this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top