DeviceIoControl fail in windows server 2003

hi ALL,
my app works fine in XP. but it didn’t work in windows server 2003
standard edition sp2.
I used setupAPI to scan bus to createFile and send handles to
DeviceIoControl.

status = DeviceIoControl(hDriveHandle,
IOCTL_SCSI_GET_INQUIRY_DATA,
NULL,
0,
buffer,
sizeof(buffer),
&returned,
NULL);

I used admin to login this 2003 server, after running this it returned
1 meaning ERROR_INVALID_FUNCTION.
some tips I googled didn’t apply my case.
can anybody help?
Thanks in advance
Fred

Do you mean the variable ‘status’ in the code below is 1? DeviceIoControl
returns BOOL so this indicates that the API succeeded.

wrote in message news:xxxxx@ntdev…
> hi ALL,
> my app works fine in XP. but it didn’t work in windows server 2003
> standard edition sp2.
> I used setupAPI to scan bus to createFile and send handles to
> DeviceIoControl.
>
> status = DeviceIoControl(hDriveHandle,
> IOCTL_SCSI_GET_INQUIRY_DATA,
> NULL,
> 0,
> buffer,
> sizeof(buffer),
> &returned,
> NULL);
>
> I used admin to login this 2003 server, after running this it returned
> 1 meaning ERROR_INVALID_FUNCTION.
> some tips I googled didn’t apply my case.
> can anybody help?
> Thanks in advance
> Fred
>

Not sure if this IOCTL is obsolete in Win 2K3 SP2 (I remember it works
on 2K3 SP1). Anyway, you can try IOCTL_STORAGE_QUERY_PROPERTY.

Cheers,
R. Yang

  • Windows Kernel Developer [Custom Dev and Consulting]

On Fri, 27 Apr 2007 12:40:00 -0400 (EDT), xxxxx@hotmail.com
wrote:

hi ALL,
my app works fine in XP. but it didn’t work in windows server 2003
standard edition sp2.
I used setupAPI to scan bus to createFile and send handles to
DeviceIoControl.

status = DeviceIoControl(hDriveHandle,
IOCTL_SCSI_GET_INQUIRY_DATA,
NULL,
0,
buffer,
sizeof(buffer),
&returned,
NULL);

I used admin to login this 2003 server, after running this it returned
1 meaning ERROR_INVALID_FUNCTION.
some tips I googled didn’t apply my case.
can anybody help?
Thanks in advance
Fred

Thank all.
I rolled back to 2003 SP1.
now I use port driver “scsiN:” which succeeded in IOCTL_SCSI_GET_INQUIRY_DATA. but when I sent scsi commands such as “TEST UNIT READY” CDB over pass through IOCTL_SCSI_PASS_THROUGH_DIRECT . it returned error, last error is 1 and no sense code returned.
My device is blueRay driver.
wonder why it didn’t work in pass through?
Fred

> My device is blueRay driver.

wonder why it didn’t work in pass through?

Use \.\E: and not \.\Scsi3

Send SCSIOP_INQUIRY via passthrough instead of IOCTL_SCSI_GET_INQUIRY_DATA.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Thanks. it works by sending CDB to inquiry devices found by setupAPI.