Jump to content

Help to get started with ASPI/SPTI


Recommended Posts

Hi @all, hi @LIGHTNING UK!


At first i must say, wow, Imgburn blows all the commercial products away.


Now what i want to know, because i am also a developer (but not so hard like you hehe) and its time for me to get into this stuff. Actually i developing with c++ and the winapi and doing some things with mysql, so the most time i spent time for developing database applications. And now i want to expand my knowledge on aspi/spti after i saw your imgburn.


My problem is how to get started ?


Should i read directly the scsi and mmc specs from t10 or should i first inform about how cd drives and cd works in general (so i think there are some unclear definitions for me, like pre gap)


It would also be great if someone have links to interesting code snippets, becaue google does not know so much about aspi and mmc commands :)



Thanks for help and have a nice day !




Link to comment
Share on other sites

Start by looking at the mmc command specs document and then all you really need to do is figure out how to enumerate the drives and send a command to them - this is done via the functions CreateFile and DeviceIoControl (with the parameter 'SCSI_PASS_THROUGH_DIRECT').


Microsoft have a few basic examples of how to communicate with drives. You just have to swap out the MMC commands they issue for the ones you want to issue - and that's just a case of changing what's in the CDB (command descriptor block).

Link to comment
Share on other sites

ahh okay thank you.


Okay thats great, because i also often works with the DeviceIoControl function. It sounds really easy, but i think the hard stuff is to setup the CDB right? How do you enumerate the drives? Do you test all the 26 possible combinations or do you use the SetupDi functions of windows?


And the CDB, would it be a help to test CDB structures with the DVDInfoPro tool or ist it not recommend?


The next point is, i haven't so many information about cd roms and so on. if i understand right, the data on a disc is exactly what an iso-image is ?






Link to comment
Share on other sites

Nope the CDB's are pretty straight forward. It's all explained and broken down with the MMC docs.


Byte 0 in the CDB is always the command operation code - i.e. where you tell it you want to Read a sector or write to one.

and then maybe bytes 3 - 6 will be the LBA address of where to read from / write to.

and bytes 8 - 9 will be the number of sectors to read.


(that's simplified but you get the idea)


Yes you can test CDB's with DVDInfoPro if you like. I'm sure you'll find it's more fun to code your own functions though. :)


There are 3 ways to enumerate really. Go by the drive letters, go by the CdRom class or use the SetupDi functions.

ImgBurn can use either of the first 2.


Yes an ISO is created by reading a sector from the disc and writing it out to a file, moving onto the next sector and repeating the process.

It's a 1:1 copy of the disc.


So when you burn you read the first sectors worth of data from the image and then write it to the appropriate lba on the disc.

Link to comment
Share on other sites

Now i spend some time to test some little things and also used google with different types of keywords, without luck.


The SCSI and MMC definitions are clear. But the ECMA-119 document ist very bad i think. To get into this stuff (because i will backup my customer database and create an iso and then burn it to a disc) i created a small image file with imgburn. Only 2 files, not more , level 1, all other options off.


After going through the file with an hex editor and the ecma specs, i am stuck at the data of the stored files.


First i read out the primary volume descriptor to getting the offset of the path table. Using the new offset then i enumerate all the entries by checking first byte of the data if its a valid directory entry. So now i get the filesize and the offset of the file.


The problem is, should all data split in 2048 byte blocks, because i am wondering why there are some 00 bytes after the first file before the second starts (this also happens with lots of 00 after the volume terminate set) ?



A small question to your program:

Imgburn gives a warning message if anydvd is on, why is that, because i have the option to select the elbycdio scsi layer, but if i am right anydvd also uses this layer. Whats the different or more precisly whats the problem if both programs are running?


Thanks again for help and a beautiful program :)




Link to comment
Share on other sites

Yes you need to burn/think in chunks of 2048 - because that's the size of a sector.


If the last part of a file doesn't fill a sector then the rest should be filled with zeroes.


Likewise, a file cannot start mid sector, it always starts at the first byte of a given sector number.



AnyDVD changes I/O data on the fly. If you burn and then verify a disc, it can be chaging the I/O data and thus cause the verify to error out with a 'mismatch'.

ImgBurn displays the log entry when AnyDVD.exe is found in your process list.

Link to comment
Share on other sites

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.