Menu

#1204 BusType returned in IOCTL_STORAGE_QUERY_PROPERTY is invalid

WSL
closed
None
rejected
No_User_Response
2013-01-25
2008-09-16
Raj Divecha
No

Build setup:

Windows XP Professional Version 2002 SP 2.

I had used MinGW-5.1.4.exe and MSYS-1.0.10.exe for installation. Once the installation was completed, I upgraded win32api and mingwrt to...
w32api-3.12
mingwrt-3.15

$ uname -a
MINGW32_NT-5.1 ICTRDIVECH16281 1.0.10(0.46/3/2) 2004-03-15 07:17 i686 unknown

$ gcc -v
Reading specs from c:/mingw/bin/../lib/gcc/mingw32/3.4.5/specs
Configured with: ../gcc-3.4.5-20060117-3/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-synchronization --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.5 (mingw-vista special r3)

$ ld -v
GNU ld version 2.17.50 20060824

Test setup:

Windows Server 2003 Enterprise Edition SP 1
HBA: Adaptec AIC-7899 Ultra160 PCI SCSI Card

Problem Description:

I downloaded a sample program for scaning SCSI devices from http://support.microsoft.com/kb/308669

Made minimal changes...
1) changed the #include to...

#include <ddk/cfgmgr32.h> // for SetupDiXxx functions.
//#include <devioctl.h>
#include <ddk/ntdddisk.h>
#include <ddk/ntddscsi.h>

2) Modified lines 382, 424 to use LPCTSTR instead of PCTSTR.

3) Modified lines 456, 472 to use GUID_DEVINTERFACE_STORAGEPORT instead of StoragePortClassGuid

And compiled it using...
gcc -o rescan.exe rescan.c -luuid -lsetupapi

On executing rescan.exe, I found it failing after the following was printed...
Adapter Properties
------------------

This was because adpDesc->BusType had invalid values (0x2FA01 and 0x24A01 on my setup).

If I comment out the line that uses adpDesc->BusType, the program prints valid values for the rest of the fields.

The attached zip file contains the modified source files, executable made on mingw and the original executable that I downloaded from the microsoft's website.

The original executable is renamed to rescan.exe.ori. Executing the original executable prints the correct information. The problem is only with the BusType field.

Discussion

  • Raj Divecha

    Raj Divecha - 2008-09-16

    This contains the files that are slightly modified to compline under mingw

     
  • Raj Divecha

    Raj Divecha - 2008-09-16

    I modified line 588 to the following and the program works fine.
    DebugPrint( 1, "Bus Type : %s\n", BusType[(BYTE)adpDesc->BusType]);

     
  • Chris Sutcliffe

    Chris Sutcliffe - 2009-11-21
    • assigned_to: nobody --> ir0nh34d
     
  • Chris Sutcliffe

    Chris Sutcliffe - 2009-11-21

    Can you please capture all your changes to the w32api in one file (perhaps as a proper patch), so I can see all the required changes?

    Thank you.

     
  • Earnie Boyd

    Earnie Boyd - 2012-08-01

    OP did not respond to requests.

     
  • Earnie Boyd

    Earnie Boyd - 2012-08-01
    • milestone: --> Known_bugs
    • status: open --> closed-rejected
     
  • Earnie Boyd

    Earnie Boyd - 2013-01-25
    • labels: w32api (deprecated use WSL) -->
    • status: closed-rejected --> closed
    • resolution: --> rejected
    • category: --> No_User_Response
    • milestone: Known_bugs --> WSL