In DDK2000...WDK 5112, CDROM.SYS!CdRomInterpretReadCapacity contains the
following code:
----------------------------
//
// Calculate media capacity in bytes.
//
commonExtension->PartitionLength.QuadPart = (LONGLONG)(lastSector + 1);
//
// we've defaulted to 32/64 forever. don't want to change this now...
//
fdoExtension->DiskGeometry.TracksPerCylinder = 0x40;
fdoExtension->DiskGeometry.SectorsPerTrack = 0x20;
//
// Calculate number of cylinders.
//
fdoExtension->DiskGeometry.Cylinders.QuadPart = (LONGLONG)((lastSector +
1) / (32 * 64));
commonExtension->PartitionLength.QuadPart =
(commonExtension->PartitionLength.QuadPart <<
fdoExtension->SectorShift);
----------------------
The code rounds the number of cylinders to (32*64) for DISK_GEOMETRY, which
results
in a wrong value returned to the caller. The number of sectors becomes
wrong, too (TracksPerCylinder * SectorsPerTrack * Cylinders).
IOCTL_DISK_GET_DRIVE_LAYOUT and IOCTL_DISK_GET_PARTITION_INFO return the
correct media capacity in
PARTITION_INFORMATION.PartitionLength. The difference between
PARTITION_INFORMATION and DISK_GEOMETRY prevents
certain filesystems, including NTFS, from being mounted from
CD/DVD/BD/HDDVD/...
>> // we've defaulted to 32/64 forever. don't want to change this now...
I think now it's a good time to fix it at last, at least for Vista.
Thanks