Solved

GetASPI32SupportInfo on NT and W2000

Posted on 2000-05-17
10
1,074 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
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 15

Expert Comment

by:NickRepin
Comment Utility
<<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
Comment Utility
listening...
0
 
LVL 1

Accepted Solution

by:
akey earned 400 total points
Comment Utility
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
 
LVL 5

Author Comment

by:icd
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 5

Author Comment

by:icd
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Comment accepted as answer
0
 
LVL 5

Author Comment

by:icd
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now