USB device information-2

Source: Internet
Author: User
This idea is correct.
Use this GUID: 53f56307-b6bf-11d0-94f2-00a0c91efb8b
First, setupdigetclassdevs
Then setupdienumdeviceinterfaces
Setupdigetdeviceinterfacedetail can be used to obtain a device path. You can use this device path to createfile to open the device and obtain the handle. Then, use the deviceiocontrol function to obtain the serial number.
Structure: ioctl_storage_query_property?
 
 
 
In fact, based on your ideas, you can add several more actions to obtain the serial number of the USB mass storage device.
For me, there are two methods:
(1) send a command to the hardware through the driver to obtain the device instance IDs of the storage device instance. This is similar to the following string:
Hard Disk: pciide/idechannel/4 & e3ec092 & 0 & 0
USB memory: USB/vid_04a5 & pid_6130/0002f0eb6d990414
For example, 0002f0eb6d990414 is the serial number you want.
(2) access the USB device directly with DDK to obtain it.
You have compiled the USB view in the DDK, which is very good. The reason for this is: iserialnumber: 0x03, because you have not performed config descriptors on the device. You can try to make an action:
Start USB view.exe and plug the USB device in. select the "Config Descriptors" item under the "options" menu, and then under the "file" menu, click the "Refresh F5" sub-menu item, so that the serial number will be displayed.
The following are my results:
Device descriptor:
Bcdusb: 0x0110
Bdeviceclass: 0x00
Bdevicesubclass: 0x00
Bdeviceprotocol: 0x00
Bmaxpacketsize0: 0x40 (64)
Idvendor: 0x04a5 (Acer peripherals Inc .)
Idproduct: 0x6130
Bcddevice: 0x1001
Imanufacturer: 0x01
0x0409: "<usb mf>"
Iproduct: 0x02
0x0409: "<USB product>"
Iserialnumber: 0x03
0x0409: "0002f0eb6d9c050b"
Bnumconfigurations: 0x01
 
Connectionstatus: deviceconnected
Current Config value: 0x01
Device bus speed: full
Device address: 0x02
Open Pipes: 2
 
Endpoint descriptor:
Bendpointaddress: 0x81
Transfer Type: Bulk
Wmaxpacketsize: 0x0040 (64)
Binterval: 0x00
 
Endpoint descriptor:
Bendpointaddress: 0x02
Transfer Type: Bulk
Wmaxpacketsize: 0x0040 (64)
Binterval: 0x00
 
Configuration descriptor:
Wtotallength: 0x0020
Bnuminterfaces: 0x01
Bconfigurationvalue: 0x01
Iconfiguration: 0x04
0x0409: "USB/msc LCD player"
Bmattributes: 0x80 (bus powered)
Maxpower: 0x32 (100 mA)
 
Interface descriptor:
Binterfacenumber: 0x00
Balternatesetting: 0x00
Bnumendpoints: 0x02
Binterfaceclass: 0x08
Binterfacesubclass: 0x06
Binterfaceprotocol: 0x50
Iinterface: 0x05
0x0409: "internal device"
 
Endpoint descriptor:
Bendpointaddress: 0x81
Transfer Type: Bulk
Wmaxpacketsize: 0x0040 (64)
Binterval: 0x00
 
Endpoint descriptor:
Bendpointaddress: 0x02
Transfer Type: Bulk
Wmaxpacketsize: 0x0040 (64)
Binterval: 0x00

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.