Solved

GetASPI32SupportInfo on NT and W2000

Posted on 2000-05-17
10
1,089 Views
Last Modified: 2013-12-03
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
Comment
Question by:icd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 15

Expert Comment

by:NickRepin
ID: 2819148
<<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
 
LVL 20

Expert Comment

by:Madshi
ID: 2820113
listening...
0
 
LVL 1

Accepted Solution

by:
akey earned 400 total points
ID: 2832336
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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 5

Author Comment

by:icd
ID: 2854901
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
 
LVL 20

Expert Comment

by:Madshi
ID: 2855222
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
 
LVL 5

Author Comment

by:icd
ID: 2855830
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
 
LVL 20

Expert Comment

by:Madshi
ID: 2856018
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
 
LVL 1

Expert Comment

by:akey
ID: 2869254
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
 
LVL 5

Author Comment

by:icd
ID: 2985736
Comment accepted as answer
0
 
LVL 5

Author Comment

by:icd
ID: 2985737
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question