• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1104
  • Last Modified:

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?
0
icd
Asked:
icd
  • 4
  • 3
  • 2
  • +1
1 Solution
 
NickRepinCommented:
<<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. >>

0
 
MadshiCommented:
listening...
0
 
akeyCommented:
The short answer is that you probably need a kernel-mode driver to accurately find all of the SCSI devices.

You might want to take a look at the AKRip32 audio extraction dll (that I incidentally wrote).  Since I already had a large base of code written that uses the ASPI-style calls, I implemented an pseudo-ASPI emulation layer that translated ASPI calls to SPTI calls.  Specifically, look at scsipt.c in the source to the DLL for an example of how to implement a (very) minimal ASPI layer.

The URL is http://akrip.sourceforge.net/
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
icdAuthor Commented:
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
0
 
MadshiCommented:
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.
0
 
icdAuthor Commented:
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
0
 
MadshiCommented:
Hey, ICD, thank you very much!!   =8-D

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

http://www.experts-exchange.com/jsp/qShow.jsp?ta=winprog&qid=10361896 
0
 
akeyCommented:
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.
0
 
icdAuthor Commented:
Comment accepted as answer
0
 
icdAuthor Commented:
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
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now