CD media capacity

Hi all!

How does WinXP read the CD media capacity, that is shown by Explorer.

I tried to do it in some ways and here are results for my CD:

  1. IOCTL_CDROM_GET_DRIVE_GEOMETRY/IOCTL_DISK_GET_DRIVE_GEOMETRY

Total capacity is 8192 sectors (cyl * tracks * sectors)

  1. IOCTL_DISK_GET_DRIVE_LAYOUT

Total capacity is 10127 sectors

  1. IOCTL_SCSI_PASS_THROUGH_DIRECT (SCSIOP_READ_CAPACITY)

Total capacity is 10127 sectors

  1. IOCTL_DISK_GET_DRIVE_GEOMETRY_EX

Total capacity is 10127 sectors (DiskSize field)

  1. IO fails starting from sector #9827

  2. The capacity shown by Explorer is 9827 sectors

Where is the number 9827 taken from?

Thanks,

Dani

> How does WinXP read the CD media capacity, that is shown by Explorer.

It is taken from CDFS or UDFS, not from the underlying MMC size data.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Just guessing, but the IO you are sending is via the file system, which
will limit the IO to the volume space that the file system knows about.
If you send reads direct to the CDROM device (not through the FS), does
it still fail after only 9827 sectors?

.

From: Dani Polovets [mailto:xxxxx@safend.com]
Sent: Wednesday, February 21, 2007 5:33 AM
Subject: CD media capacity

Hi all!

How does WinXP read the CD media capacity, that is shown by Explorer.

I tried to do it in some ways and here are results for my CD:

  1. IOCTL_CDROM_GET_DRIVE_GEOMETRY/IOCTL_DISK_GET_DRIVE_GEOMETRY

Total capacity is 8192 sectors (cyl * tracks * sectors)

  1. IOCTL_DISK_GET_DRIVE_LAYOUT

Total capacity is 10127 sectors

  1. IOCTL_SCSI_PASS_THROUGH_DIRECT (SCSIOP_READ_CAPACITY)

Total capacity is 10127 sectors

  1. IOCTL_DISK_GET_DRIVE_GEOMETRY_EX

Total capacity is 10127 sectors (DiskSize field)

  1. IO fails starting from sector #9827

  2. The capacity shown by Explorer is 9827 sectors

Where is the number 9827 taken from?

Thanks,

Dani