Dear all,
Kindly find my code which i wrote to get get vendor id and product id of a USB device on windows system
// Creates or opens a file or I/O device.
HANDLE hDevice = CreateFile(TEXT("\\\\.\\G:"), // drive to open
0, // no access to the drive
FILE_SHARE_READ | // share mode
FILE_SHARE_WRITE,
NULL, // default security attributes
OPEN_EXISTING, // disposition
0, // file attributes
NULL);
PUSB_DEVICE_DESCRIPTOR pDevDesc;
DeviceIoControl(hDevice,// device handle
IOCTL_USB_GET_NODE_CONNECTION_INFORMATION , // info of device property
NULL,
0,
pDevDesc, sizeof(PUSB_DEVICE_DESCRIPTOR), // output data buffer
&dwOutBytes, // out's length
(LPOVERLAPPED)NULL);
qDebug ()<<pDevDesc->iManufacturer;
qDebug ()<<pDevDesc->idProduct;
qDebug ()<<pDevDesc->bLength;
qDebug ()<<pDevDesc->idVendor;
qDebug ()<<pDevDesc->iSerialNumber;
when i print this i get the below output
0
0
3
0
13
are the above output are correct?
if not how can i achive this please guide me i need to get vendor id and product id from the connected usb device?
Any info would be great help
Thank you for your time.
Bookmarks