I’m writing a windows application in C# which needs to be multisession-aware.
I’ve done some reading-around to attempt to get up-to-speed, as I’m a relative newcomer to the world of CDROM standards; ECMA-[119, 6, 35, 130, 168], MMC-3, Joliet spec. - admittedly a fair amount of it was skimmed but I feel I have a fair understanding.
I’m currently stalled on something which is central to the application and should be simple; reading sectors [both raw and user-data only] from a multisession CD which is verifiably readable [according to IsoBuster 1.5].
Prior to the reads, I’ve used the Win32 IOCTL_CDROM_READ_TOC_EX with CDROM_READ_TOC_EX_FORMAT_FULL_TOC to return, amongst other things; a list of sessions, the tracks that each session consists of, the start of each track and each session’s lead-out.
These details have been checked against IsoBuster to ensure I’ve read them correctly and indeed I’ve read and displayed various sectors (mainly 16 & 17) and compared them with ISO Buster’s ‘view sector’ dialog as a sanity-check.
I have a CD that has six sessions, the last of which (closed) has 18220 sectors (upto start of lead-out).
If I attempt to read sectors from the cd in the range 0-18219 (which should fall within the first session, whose lead-out begins at LBA 61687), all is well, but any higher and the read attempt fails, despite using various methods to attempt a read (Win32’s ReadFile from the CDROM device handle, SPTI of MMC’s ‘READ CD’ and ‘READ CD MSF’). The same effect is noticeable with different multisession cds [dependent on the size of the final session in each case] yet is absent on single session cds.
Clearly there’s a gap in my understanding. Anyone know what’s happening?
PS. Am I correct in assuming that a M:S:F address always translates to an LBA using the formula:
(M * 60 + S) * 75 + F - 150 - even across session boundaries ?