atapi.sys no longer accepts an Inquiry CDB/command?

Anyone know anything about atapi.sys (version 5.1.2600.1135, at least)
no longer emulating Inquiry CDB’s/commands on IDE/ATA drives in WinXP?

I have code that opens “\\.\PhysicalDrive0”, etc. with CreateFile( )
and then uses an IOCTL_SCSI_PASS_THROUGH_DIRECT DeviceIoControl( ) with
an Inquiry CDB to get “Inquiry” data.

For many years now this code has not been touched and it has worked
successfully. To the best of my recollection, it’s worked successfully
in WinXP before.

Now in WinXP, when “\\.\PhysicalDrive” is an IDE/ATA drive rather
than true SCSI, the DeviceIoControl( ) does not succeed and an error
code of “operation not supported” is returned by GetLastError( ).

Anyone know whether or not this is happening “on purpose”? Is IDE/ATA
drive Inquiry CDB/command emulation now “officially” not “supported”?

TIA,
MikeC

You need to use the IOCTL_ATA__PASS_THROUGH_Xxxx commands instead. Using the
SPTI command is rejected by the IDE driver since it no longer uses SCSIPORT.
Also be aware that ATA Pass through does not work out of the box on XP, you
will need the hotfix from Microsoft, Server 2003, or install XP SP2 Beta 1.
You will then build using the Server 2003 DDK to acquire the proper
definitions and documentation for the pass-through commands.


Gary G. Little
Seagate Technologies, LLC

“Mike Colandreo” wrote in message
news:xxxxx@ntdev…
> Anyone know anything about atapi.sys (version 5.1.2600.1135, at least)
> no longer emulating Inquiry CDB’s/commands on IDE/ATA drives in WinXP?
>
> I have code that opens “\\.\PhysicalDrive0”, etc. with CreateFile( )
> and then uses an IOCTL_SCSI_PASS_THROUGH_DIRECT DeviceIoControl( ) with
> an Inquiry CDB to get “Inquiry” data.
>
> For many years now this code has not been touched and it has worked
> successfully. To the best of my recollection, it’s worked successfully
> in WinXP before.
>
> Now in WinXP, when “\\.\PhysicalDrive” is an IDE/ATA drive rather
> than true SCSI, the DeviceIoControl( ) does not succeed and an error
> code of “operation not supported” is returned by GetLastError( ).
>
> Anyone know whether or not this is happening “on purpose”? Is IDE/ATA
> drive Inquiry CDB/command emulation now “officially” not “supported”?
>
>
> TIA,
> MikeC
>

“Mike Colandreo” wrote in message
news:xxxxx@ntdev…
> Anyone know anything about atapi.sys (version 5.1.2600.1135, at least)
> no longer emulating Inquiry CDB’s/commands on IDE/ATA drives in WinXP?
>
> I have code that opens “\\.\PhysicalDrive0”, etc. with CreateFile( )
> and then uses an IOCTL_SCSI_PASS_THROUGH_DIRECT DeviceIoControl( ) with
> an Inquiry CDB to get “Inquiry” data.
>
> For many years now this code has not been touched and it has worked
> successfully. To the best of my recollection, it’s worked successfully
> in WinXP before.
>
> Now in WinXP, when “\\.\PhysicalDrive” is an IDE/ATA drive rather
> than true SCSI, the DeviceIoControl( ) does not succeed and an error
> code of “operation not supported” is returned by GetLastError( ).
>
> Anyone know whether or not this is happening “on purpose”? Is IDE/ATA
> drive Inquiry CDB/command emulation now “officially” not “supported”?

IOCTL_SCSI_GET_INQUIRY_DATA. Should be supported in ATAPI. Do tell if it’s
not.

Phil

Philip D. Barila Windows DDK MVP
Seagate Technology, LLC
(720) 684-1842
As if I need to say it: Not speaking for Seagate.

Sorry, that is incorrect. ATAPI still supports IOCTL_SCSI_PASS_THROUGH*
in addition to ATA_PASS_THROUGH. If you are having a problem sending an
INQUIRY, I’d like to know more. Are you attempting to issue this from a
non-privileged account?

-----Original Message-----
From: Gary G. Little [mailto:xxxxx@sbcglobal.net]
Sent: Thursday, February 05, 2004 7:57 PM
Subject: Re: atapi.sys no longer accepts an Inquiry CDB/command?

You need to use the IOCTL_ATA__PASS_THROUGH_Xxxx commands instead. Using
the
SPTI command is rejected by the IDE driver since it no longer uses
SCSIPORT.
Also be aware that ATA Pass through does not work out of the box on XP,
you
will need the hotfix from Microsoft, Server 2003, or install XP SP2 Beta
1.
You will then build using the Server 2003 DDK to acquire the proper
definitions and documentation for the pass-through commands.


Gary G. Little
Seagate Technologies, LLC

“Mike Colandreo” wrote in message
news:xxxxx@ntdev…
> Anyone know anything about atapi.sys (version 5.1.2600.1135, at least)
> no longer emulating Inquiry CDB’s/commands on IDE/ATA drives in WinXP?
>
> I have code that opens “\\.\PhysicalDrive0”, etc. with CreateFile(
)
> and then uses an IOCTL_SCSI_PASS_THROUGH_DIRECT DeviceIoControl( )
with
> an Inquiry CDB to get “Inquiry” data.
>
> For many years now this code has not been touched and it has worked
> successfully. To the best of my recollection, it’s worked successfully
> in WinXP before.
>
> Now in WinXP, when “\\.\PhysicalDrive” is an IDE/ATA drive
rather
> than true SCSI, the DeviceIoControl( ) does not succeed and an error
> code of “operation not supported” is returned by GetLastError( ).
>
> Anyone know whether or not this is happening “on purpose”? Is IDE/ATA
> drive Inquiry CDB/command emulation now “officially” not “supported”?
>
>
> TIA,
> MikeC
>

you’re not dealing with scsi so this may not apply.

But when talking to scsiport (on Win2k and beyond) this can cause a
rescan of the bus. I put in a timer to mitigate some apps that were
calling it frequently (like once or twice a second) but it’s still not
something you should call frequently.

if you need the identity of the device you can use
IOCTL_STORAGE_QUERY_PROPERTY to get the device descriptor. This is our
interpretation of the inquiry data. If you need the specific inquiry
data you need to send a pass-through request.

As to why atapi is refusing PASS_THROUGH requests I’m not sure. I’d be
surprised if atapi didn’t support the basic command … perhaps it
doesn’t the inquiry data page you’re asking for?

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Phil Barila
Sent: Thursday, February 05, 2004 9:12 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] atapi.sys no longer accepts an Inquiry CDB/command?

“Mike Colandreo” wrote in message
news:xxxxx@ntdev…
> Anyone know anything about atapi.sys (version 5.1.2600.1135, at least)

> no longer emulating Inquiry CDB’s/commands on IDE/ATA drives in WinXP?
>
> I have code that opens “\\.\PhysicalDrive0”, etc. with CreateFile(
> ) and then uses an IOCTL_SCSI_PASS_THROUGH_DIRECT DeviceIoControl( )
> with an Inquiry CDB to get “Inquiry” data.
>
> For many years now this code has not been touched and it has worked
> successfully. To the best of my recollection, it’s worked successfully

> in WinXP before.
>
> Now in WinXP, when “\\.\PhysicalDrive” is an IDE/ATA drive
> rather than true SCSI, the DeviceIoControl( ) does not succeed and an
> error code of “operation not supported” is returned by GetLastError(
).
>
> Anyone know whether or not this is happening “on purpose”? Is IDE/ATA
> drive Inquiry CDB/command emulation now “officially” not “supported”?

IOCTL_SCSI_GET_INQUIRY_DATA. Should be supported in ATAPI. Do tell if
it’s not.

Phil

Philip D. Barila Windows DDK MVP
Seagate Technology, LLC
(720) 684-1842
As if I need to say it: Not speaking for Seagate.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

I don’t know where Gary got this information, but I have it on *really*
good authority that this ATAPI.SYS still supports
IOCTL_SCSI_PASS_THROUGH.

Perhaps your user-mode buffer doesn’t meet the alignment requirements of
the device (ATAPI requires all buffers to be WORD aligned)? Perhaps
your user-mode buffer’s length isn’t a multiple of the device’s
alignment requirements?

.

-----Original Message-----
From: Gary G. Little [mailto:xxxxx@sbcglobal.net]
Sent: Thursday, February 05, 2004 7:57 PM
Subject: Re: atapi.sys no longer accepts an Inquiry CDB/command?

You need to use the IOCTL_ATA__PASS_THROUGH_Xxxx commands instead. Using
the SPTI command is rejected by the IDE driver since it no longer uses
SCSIPORT.
Also be aware that ATA Pass through does not work out of the box on XP,
you will need the hotfix from Microsoft, Server 2003, or install XP SP2
Beta 1.
You will then build using the Server 2003 DDK to acquire the proper
definitions and documentation for the pass-through commands.


Gary G. Little
Seagate Technologies, LLC

“Mike Colandreo” wrote in message
news:xxxxx@ntdev…
> Anyone know anything about atapi.sys (version 5.1.2600.1135, at least)

> no longer emulating Inquiry CDB’s/commands on IDE/ATA drives in WinXP?
>
> I have code that opens “\\.\PhysicalDrive0”, etc. with CreateFile(
> ) and then uses an IOCTL_SCSI_PASS_THROUGH_DIRECT DeviceIoControl( )
> with an Inquiry CDB to get “Inquiry” data.
>
> For many years now this code has not been touched and it has worked
> successfully. To the best of my recollection, it’s worked successfully

> in WinXP before.
>
> Now in WinXP, when “\\.\PhysicalDrive” is an IDE/ATA drive
> rather than true SCSI, the DeviceIoControl( ) does not succeed and an
> error code of “operation not supported” is returned by GetLastError(
).
>
> Anyone know whether or not this is happening “on purpose”? Is IDE/ATA
> drive Inquiry CDB/command emulation now “officially” not “supported”?
>
>
> TIA,
> MikeC
>

Jeffrey,

No, it’s not being issued from a non-privileged account. It’s being issued
from an account that is a member of the Administrators group, but it’s not
the “Administrator” user account.

As I indicated, this code has been in use and working successfully for
years (in hundreds of places around the world). I invented this particular
piece of code in 02(Feb)/2000. But, it’s derived from code I invented long
before that.

I’ve done some further debugging and I’ve determined that both atapi.sys
5.1.2600.1106 and atapi.sys 5.1.2600.1135 are broken.

At the moment, I have four machines on hand here:

  • one with a 40GB Maxtor,
  • one with an 80GB WD,
  • one with two 80GB WD’s, and
  • one with a 20GB IBM and a 10GB IBM.

Things “work”- i.e., the DeviceIoControl( ) succeeds and the Inquiry
CDB/command succeeds (sptInfo->Direct.ScsiStatus == SCSISTAT_GOOD) - on
both of the two machines with only one drive in them.

Things don’t “work” on either of the two machines with two drives in them:
the DeviceIoControl( ) fails as I’ve indicated on “\\.\PhysicalDrive0”,
and on “\\.\PhysicalDrive1”, both the DeviceIoControl( ) and Inquiry
CDB/command succeed, but the “Inquiry” data is wrong.

In other words, there is a bug in the Inquiry CDB/command processing in
both 5.1.2600.1106 and 5.1.2600.1135 if/when there is more than one drive
in a machine.

Regards,
MikeC

“Jeffrey Goldner” wrote in news:xxxxx@ntdev:

> Sorry, that is incorrect. ATAPI still supports IOCTL_SCSI_PASS_THROUGH*
> in addition to ATA_PASS_THROUGH. If you are having a problem sending an
> INQUIRY, I’d like to know more. Are you attempting to issue this from a
> non-privileged account?
>
> -----Original Message-----
> From: Gary G. Little [mailto:xxxxx@sbcglobal.net]
> Sent: Thursday, February 05, 2004 7:57 PM
> Subject: Re: atapi.sys no longer accepts an Inquiry CDB/command?
>
> You need to use the IOCTL_ATA__PASS_THROUGH_Xxxx commands instead. Using
> the
> SPTI command is rejected by the IDE driver since it no longer uses
> SCSIPORT.
> Also be aware that ATA Pass through does not work out of the box on XP,
> you
> will need the hotfix from Microsoft, Server 2003, or install XP SP2 Beta
> 1.
> You will then build using the Server 2003 DDK to acquire the proper
> definitions and documentation for the pass-through commands.
>

All,

Thanks very much to everyone for the responses.

It looks like there is a bug in atapi.sys 5.1.2600.1106 and atapi.sys
5.1.2600.1135.

See my followup in the thread to Jeffrey Goldner’s message for the details.

Regards,
MikeC

Mike Colandreo wrote in news:xxxxx@ntdev:

> Anyone know anything about atapi.sys (version 5.1.2600.1135, at least)
> no longer emulating Inquiry CDB’s/commands on IDE/ATA drives in WinXP?
>
> I have code that opens “\\.\PhysicalDrive0”, etc. with CreateFile( )
> and then uses an IOCTL_SCSI_PASS_THROUGH_DIRECT DeviceIoControl( ) with
> an Inquiry CDB to get “Inquiry” data.
>
> For many years now this code has not been touched and it has worked
> successfully. To the best of my recollection, it’s worked successfully
> in WinXP before.
>
> Now in WinXP, when “\\.\PhysicalDrive” is an IDE/ATA drive rather
> than true SCSI, the DeviceIoControl( ) does not succeed and an error
> code of “operation not supported” is returned by GetLastError( ).
>
> Anyone know whether or not this is happening “on purpose”? Is IDE/ATA
> drive Inquiry CDB/command emulation now “officially” not “supported”?
>
>
> TIA,
> MikeC
>

Well, I got my information from dealing with Microsoft a few months back and
convincing them that we really do need a functional ATA pass-through
capability. However, that only applies to drivers using the “System Support
for Buses” section of the DDK and who are developing IDE/ATA mini-drivers,
or applications that work with that interface. That then generated the
hotfix I mentioned and the resulting fix in ATAPI.SYS for XP SP2 Beta 1.

In early testing of the work I am doing with those fixes, I was sending an
IOCTL_ATA_PASS_THROUGH_Xxxx command down to an ATA controller that was
supported via a SCSI miniport. THAT was the command that was rejected,
because it was not IOCTL_SCSI_PASS_THROUGH.

Sorry about the confusion, I must’a crossed my eyes in my tri-focals.


Gary G. Little
Seagate Technologies, LLC

“Henry Gabryjelski” wrote in message
news:xxxxx@ntdev…

I don’t know where Gary got this information, but I have it on really
good authority that this ATAPI.SYS still supports
IOCTL_SCSI_PASS_THROUGH.

Perhaps your user-mode buffer doesn’t meet the alignment requirements of
the device (ATAPI requires all buffers to be WORD aligned)? Perhaps
your user-mode buffer’s length isn’t a multiple of the device’s
alignment requirements?

.

-----Original Message-----
From: Gary G. Little [mailto:xxxxx@sbcglobal.net]
Sent: Thursday, February 05, 2004 7:57 PM
Subject: Re: atapi.sys no longer accepts an Inquiry CDB/command?

You need to use the IOCTL_ATA__PASS_THROUGH_Xxxx commands instead. Using
the SPTI command is rejected by the IDE driver since it no longer uses
SCSIPORT.
Also be aware that ATA Pass through does not work out of the box on XP,
you will need the hotfix from Microsoft, Server 2003, or install XP SP2
Beta 1.
You will then build using the Server 2003 DDK to acquire the proper
definitions and documentation for the pass-through commands.


Gary G. Little
Seagate Technologies, LLC

“Mike Colandreo” wrote in message
news:xxxxx@ntdev…
> Anyone know anything about atapi.sys (version 5.1.2600.1135, at least)

> no longer emulating Inquiry CDB’s/commands on IDE/ATA drives in WinXP?
>
> I have code that opens “\\.\PhysicalDrive0”, etc. with CreateFile(
> ) and then uses an IOCTL_SCSI_PASS_THROUGH_DIRECT DeviceIoControl( )
> with an Inquiry CDB to get “Inquiry” data.
>
> For many years now this code has not been touched and it has worked
> successfully. To the best of my recollection, it’s worked successfully

> in WinXP before.
>
> Now in WinXP, when “\\.\PhysicalDrive” is an IDE/ATA drive
> rather than true SCSI, the DeviceIoControl( ) does not succeed and an
> error code of “operation not supported” is returned by GetLastError(
).
>
> Anyone know whether or not this is happening “on purpose”? Is IDE/ATA
> drive Inquiry CDB/command emulation now “officially” not “supported”?
>
>
> TIA,
> MikeC
>

Please check your buffer alignments per Henry’s mail and we will check
the two drive scenario more closely as well. Are both devices on one IDE
channel or doesn’t it matter?

Nothing was done to intentionally break this code path and yes, it is
still supported.

-----Original Message-----
From: Mike Colandreo [mailto:xxxxx@mcolandreo.fastmail.fm]
Sent: None
Subject: Re: atapi.sys no longer accepts an Inquiry CDB/command?

All,

Thanks very much to everyone for the responses.

It looks like there is a bug in atapi.sys 5.1.2600.1106 and atapi.sys
5.1.2600.1135.

See my followup in the thread to Jeffrey Goldner’s message for the
details.

Regards,
MikeC

Mike Colandreo wrote in
news:xxxxx@ntdev:

> Anyone know anything about atapi.sys (version 5.1.2600.1135, at least)

> no longer emulating Inquiry CDB’s/commands on IDE/ATA drives in WinXP?
>
> I have code that opens “\\.\PhysicalDrive0”, etc. with CreateFile(
)
> and then uses an IOCTL_SCSI_PASS_THROUGH_DIRECT DeviceIoControl( )
with
> an Inquiry CDB to get “Inquiry” data.
>
> For many years now this code has not been touched and it has worked
> successfully. To the best of my recollection, it’s worked successfully
> in WinXP before.
>
> Now in WinXP, when “\\.\PhysicalDrive” is an IDE/ATA drive
rather
> than true SCSI, the DeviceIoControl( ) does not succeed and an error
> code of “operation not supported” is returned by GetLastError( ).
>
> Anyone know whether or not this is happening “on purpose”? Is IDE/ATA
> drive Inquiry CDB/command emulation now “officially” not “supported”?
>
>
> TIA,
> MikeC
>

Jeffery,

The buffer is allocated by malloc( ). Over the years, in stepping through
the code with a dedugger, the buffer has been aligned on either an eight
byte boundry (0x…8) or a sixteen byte boundry (0x…0).

On the machine with the two 80GB WD’s, both are on the primary IDE channel.

On the machine with the 20GB and 10GB IBM’s, the 20GB is the primary IDE
channel master and the 10GB is the secondary IDE channel slave.

Do a “Google Groups”, “Advanced Groups Search”, “message ID” search with
this message ID…

O0HKIFYd$xxxxx@cppssbbsa02.microsoft.com

…to peruse a fragment of the code.

Regards,
MikeC

“Jeffrey Goldner” wrote in news:xxxxx@ntdev:

> Please check your buffer alignments per Henry’s mail and we will check
> the two drive scenario more closely as well. Are both devices on one IDE
> channel or doesn’t it matter?
>
> Nothing was done to intentionally break this code path and yes, it is
> still supported.
>
> -----Original Message-----
> From: Mike Colandreo [mailto:xxxxx@mcolandreo.fastmail.fm]
> Sent: None
> Subject: Re: atapi.sys no longer accepts an Inquiry CDB/command?
>
> All,
>
> Thanks very much to everyone for the responses.
>
> It looks like there is a bug in atapi.sys 5.1.2600.1106 and atapi.sys
> 5.1.2600.1135.
>
> See my followup in the thread to Jeffrey Goldner’s message for the
> details.
>
>
> Regards,
> MikeC
>
>
> Mike Colandreo wrote in
> news:xxxxx@ntdev:
>
>> Anyone know anything about atapi.sys (version 5.1.2600.1135, at least)
>
>> no longer emulating Inquiry CDB’s/commands on IDE/ATA drives in WinXP?
>>
>> I have code that opens “\\.\PhysicalDrive0”, etc. with CreateFile(
> )
>> and then uses an IOCTL_SCSI_PASS_THROUGH_DIRECT DeviceIoControl( )
> with
>> an Inquiry CDB to get “Inquiry” data.
>>
>> For many years now this code has not been touched and it has worked
>> successfully. To the best of my recollection, it’s worked successfully
>> in WinXP before.
>>
>> Now in WinXP, when “\\.\PhysicalDrive” is an IDE/ATA drive
> rather
>> than true SCSI, the DeviceIoControl( ) does not succeed and an error
>> code of “operation not supported” is returned by GetLastError( ).
>>
>> Anyone know whether or not this is happening “on purpose”? Is IDE/ATA
>> drive Inquiry CDB/command emulation now “officially” not “supported”?
>>
>>
>> TIA,
>> MikeC
>>
>
>