CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2006
    Posts
    27

    How to get WMI USB Information

    Hi,

    I require to access Information(version) about Removeable Disk e. g. USB.

    I want to access information(version) of USB Interface Version for selected logical drive (G) where USB is pluged in at USB port.

    I want to check interface supported for that USB is having version greater than or equal to "USB 2.0 Enhanced".

    I tried using WMI classes but from class hierarchy I am not able to get that Information.

    Please see the Image file attached of WMI Browser where Red Mark indicates that accessing "USB 2.0 Enhanced" information from Logicakl Drive = F:.

    How to access information from WMI hierarchy ?.

    First I get input from user as Logical Disk Drive where USB is connected then I want to check that this USB drive is having version "USB 2.0 Enhanced" or not is the problem.

    Is there different method to get "USB 2.0 Enhanced" information from Disk Drive.
    Attached Files Attached Files
    Last edited by RahulKateSys; November 6th, 2006 at 05:53 AM.

  2. #2
    Join Date
    Sep 2002
    Location
    Maryland - Fear The Turtle!
    Posts
    7,537

    Re: How to get WMI USB Information

    Look at the Win32_USBHub class and check the USBVersion.

    http://msdn.microsoft.com/library/de...n32_usbhub.asp

    It's interesting though that I show a null value for this on my machine (idiot coders ) Is that what you are talking about?

    Other than that, I'd have to dig up some code from the DDK that samples the usb. Called usbview if I recall correctly.
    Last edited by Mick; November 6th, 2006 at 06:47 AM. Reason: pOOp wrong link :D

  3. #3
    Join Date
    Jan 2006
    Posts
    27

    Re: How to get WMI USB Information

    Thanks,

    I tried from Win32_USBHub class but it retrieves empty string.

    So I found that path or hierarchy shown in image file attached with this thread. From that thread I can get USB interface information from Logical Disk drive letter. But I don;t know how to traverse in hierarchy of WMI.

    Please see the file attached with this post.

    Waiting for reply.


    ---- Rahul

  4. #4
    Join Date
    Sep 2002
    Location
    Maryland - Fear The Turtle!
    Posts
    7,537

    Re: How to get WMI USB Information

    Quote Originally Posted by RahulKateSys
    Thanks,

    I tried from Win32_USBHub class but it retrieves empty string.

    So I found that path or hierarchy shown in image file attached with this thread. From that thread I can get USB interface information from Logical Disk drive letter. But I don;t know how to traverse in hierarchy of WMI.

    Please see the file attached with this post.

    Waiting for reply.


    ---- Rahul
    Well, like I said, it looks like idiot developers that aren't populating the fields. At any rate, usbview shows the correct 2.0, so I'll post the source for that here. You can muck with it.

    Device Descriptor:
    bcdUSB: 0x0200
    bDeviceClass: 0x00
    bDeviceSubClass: 0x00
    bDeviceProtocol: 0x00
    bMaxPacketSize0: 0x08 (8)
    idVendor: 0x045E (Microsoft Corporation)
    idProduct: 0x009F
    bcdDevice: 0x1111
    iManufacturer: 0x01
    iProduct: 0x02
    iSerialNumber: 0x00
    bNumConfigurations: 0x01

    ConnectionStatus: DeviceConnected
    Current Config Value: 0x01
    Device Bus Speed: Low
    Device Address: 0x01
    Open Pipes: 1

    Endpoint Descriptor:
    bEndpointAddress: 0x81
    Transfer Type: Interrupt
    wMaxPacketSize: 0x0006 (6)
    bInterval: 0x0A
    Device Descriptor:
    bcdUSB: 0x0200
    bDeviceClass: 0x00
    bDeviceSubClass: 0x00
    bDeviceProtocol: 0x00
    bMaxPacketSize0: 0x40 (64)
    idVendor: 0x054C (Sony Corporation)
    idProduct: 0x0253
    bcdDevice: 0x0100
    iManufacturer: 0x01
    iProduct: 0x02
    iSerialNumber: 0x03
    bNumConfigurations: 0x01

    ConnectionStatus: DeviceConnected
    Current Config Value: 0x01
    Device Bus Speed: Full
    Device Address: 0x01
    Open Pipes: 2

    Endpoint Descriptor:
    bEndpointAddress: 0x81
    Transfer Type: Bulk
    wMaxPacketSize: 0x0200 (512)
    bInterval: 0x00

    Endpoint Descriptor:
    bEndpointAddress: 0x02
    Transfer Type: Bulk
    wMaxPacketSize: 0x0200 (512)
    bInterval: 0x00
    Attached Files Attached Files
    Last edited by Mick; November 6th, 2006 at 08:38 AM.

  5. #5
    Join Date
    Jan 2006
    Posts
    27

    Re: How to get WMI USB Information

    I have this code.

    In that code method to access USB Version (BCD Code - 0x0200) is polling to every port by exploring Host Controller Devices and then Expolring Root Hub and then exploring Port then.

    So its polling method that's why I choose through WMI.

    I require different method to access USB Version of particular port.

    Is there any different method?.

    I have one problem with polling method as follows,

    If there are four port
    First port: USB connected for which USB 2.0 interface is connected.
    Second Port: Audio Switching tool is running cand its connected through USB.

    When this polling method executes if its poll to Second Port then my another utility Audio Switching tool is failed. Means driver call will interfere between communication.

    Is WMI internally use the same(Polling) method or it access in a different way ?.


    Please help me waiting for solutions


    ----- Rahul

  6. #6
    Join Date
    Jan 2006
    Posts
    27

    Re: How to get WMI USB Information

    Is there anybody who know abt core of USB Development ?
    Please look to above problem?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured