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
Solved

GetASPI32SupportInfo on NT and W2000

Posted on 2000-05-17
10
1,085 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
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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

 
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Suggested Solutions

Title # Comments Views Activity
Vb.Net Loading Word 11 105
Example of WebAPI 7 33
Post a good COM tutorial 1 60
SSRS troubles 4 68
This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

792 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