Link to home
Start Free TrialLog in
Avatar of icd
icd

asked on

GetASPI32SupportInfo on NT and W2000

On W95/98 I obtain the number of SCSI devices connected by using the wnaspi32.dll interface GetASPI32SupportInfo and looking at the LS byte of the return value.

On NT and W2000 there is no wnaspi32.dll (at least not as standard) instead I understand I have to use the SPTI (SCSI Pass Through Interface) instead.

First part of question.
How can I obtain the number of SCSI devices by using SPTI?

Second part.
In general, if I have code written for wnaspi32.dll which generates SRB's (SCSI Request Blocks) is it possible (examples please?) to convert these requests to use the SPTI API?
Avatar of NickRepin
NickRepin

<<On Windows NT, Microsoft provides and supports the SCSI Pass Through Interface (SPTI) as a method to send SCSI requests to peripherals. There is a SCSI Pass Through sample on the Win32 DDK. For Windows NT DDK version 4.0, the SPTI sample is in \ddk\src\storage\class\spti. >>

listening...
ASKER CERTIFIED SOLUTION
Avatar of akey
akey

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of icd

ASKER

akey

I am very interested in your source code examples, it looks like exactly what I need. It is likely to be a couple of weeks however before I can fully evaluate your solution so please be patient. :-)

Can you explain to me please, if I use some of your source code in a commercial product what am I obliged to do as a result of the licence? Is it sufficient to include a reference to your web site in the documentation?

ICD
Hi akey,

you seem to know a lot about CDs. Maybe you can help me with a related question? (Sorry, icd for going off-topic). I would post then a new question for you...
My problem is: I'm reading a data CD with raw-read. Now I need to know how the extra bytes (raw-read gives me some bytes more than a normal sector contains) are structured. Can you help me with that?
I need to simulate a CD drive at driver level, which should even make copy protected CDs run from harddisk...

Thanx, Madshi.
Avatar of icd

ASKER

The normal sector is 2048 bytes (this is 'cooked' mode) If you do a raw mode read you get 2352 bytes.

The extra bytes in a raw sector cannot always be read from a CD-ROM, it depends upon the CD-ROM drive. The full specification for the extra data can be found in the 'yellow book' standard from Philipps.

In general the first 16 bytes are 'header' information giving such information as the Minute,second,frame of the sector. Then come the 2048 bytes of data then the remainder of the sector is error correction data and error detection date. The error correction and detection is calculated using CIRC (Cross Interleaved Reed-Solomon Code) algorithm.

Note also that on some drives you can read the 'scrambled' data, this means the data within the raw sector is shuffled around (with the exception of the header) to aid in error correction and detection.

I have just had a look for the full specification, I have it somewhere but can't just put my hands on it. It may be possible to find it somewhere on the Internet.

If however you are simulating a protected CD at device level then I don't think you need to worry about the contents of the error correction and detection (ECC and EDC) since I am not aware of any copy protection system that actually uses this extra data. All you need to worry about is returning the correct return status (can/can't read sector) which is what most of these protections use!

You will probably realise that I know something about these protections by my alias!

ICD
Hey, ICD, thank you very much!!   =8-D

I've posted a new question for you. Look here please:

https://www.experts-exchange.com/jsp/qShow.jsp?ta=winprog&qid=10361896 
If you use my DLL directly, you'd have to include source code to just the DLL.  My code doesn't export any of the psuedo-aspi functions, so I'd recommend that you look through my code to get an idea of what IOCTLs to use and how, and then download the NT or Win2K DDK and do an implementation that fits what you need.  I implemented just enough to make my ripper work.  But it should at least be a good starting point.
Avatar of icd

ASKER

Comment accepted as answer
Avatar of icd

ASKER

akey

Sorry for the delay in grading your answer. I have implemented your code and it all works fine.

Thanks again for your help.

icd