Helene19@web.de | 27 Jan 09:25 2012
Picon

Hardware ID from usb-stick

Hi,
I found the libusb0.dll and wanted to ask if there is a function to get 
the hardware-id from the usb-stick??
Thank you!

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
Xiaofan Chen | 27 Jan 10:52 2012
Picon

Re: Hardware ID from usb-stick

On Fri, Jan 27, 2012 at 4:25 PM, Helene19 <at> web.de <Helene19 <at> web.de> wrote:
> Hi,
> I found the libusb0.dll and wanted to ask if there is a function to get
> the hardware-id from the usb-stick??
> Thank you!

I do not quite understand your question, what do you really want
to achieve?

Do you mean you want to know the VID/PID (Vendor ID and
Product ID) of a particular USB Mass Storage Device? In order
to use libusb-win32, you have to use libusb-win32 device driver
or filter driver, in that case, you will have to know the VID/PID
(the GUI wizard will tell you as well).

If you want to know the VID/PID of all USB Mass Storage Device,
then you have to use the class filter driver which we do not
recommend to be used. In that case, libusb-win32 is probably
not the right solution.

--

-- 
Xiaofan

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
(Continue reading)

Helene19@web.de | 27 Jan 11:51 2012
Picon

Re: Hardware ID from usb-stick

Hi,

thank you! It is the first time, that I want to use a dll in my c-code.
I was reading the lusb0_usb.h but I am not quite sure how I can get the 
VID and the PID from an USB Mass Storage Device.
Can anybody gibe my an example or the functions names??

Am 27.01.2012 10:52, schrieb Xiaofan Chen:
> On Fri, Jan 27, 2012 at 4:25 PM, Helene19 <at> web.de<Helene19 <at> web.de>  wrote:
>> Hi,
>> I found the libusb0.dll and wanted to ask if there is a function to get
>> the hardware-id from the usb-stick??
>> Thank you!
> I do not quite understand your question, what do you really want
> to achieve?
>
> Do you mean you want to know the VID/PID (Vendor ID and
> Product ID) of a particular USB Mass Storage Device? In order
> to use libusb-win32, you have to use libusb-win32 device driver
> or filter driver, in that case, you will have to know the VID/PID
> (the GUI wizard will tell you as well).
>
> If you want to know the VID/PID of all USB Mass Storage Device,
> then you have to use the class filter driver which we do not
> recommend to be used. In that case, libusb-win32 is probably
> not the right solution.
>

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
(Continue reading)

Xiaofan Chen | 27 Jan 12:10 2012
Picon

Re: Hardware ID from usb-stick

On Fri, Jan 27, 2012 at 6:51 PM, Helene19 <at> web.de <Helene19 <at> web.de> wrote:

> thank you! It is the first time, that I want to use a dll in my c-code.
> I was reading the lusb0_usb.h but I am not quite sure how I can get the
> VID and the PID from an USB Mass Storage Device.
> Can anybody gibe my an example or the functions names??

There is no libusb-win32 function name to get that.

As answered before, you have to tell us what you really
want to achieve.

--

-- 
Xiaofan

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
Ekkehard | 27 Jan 13:18 2012

Re: Hardware ID from usb-stick

Beside the fact that it is not a libusb question and therefore off-topic,
there exists 3 methods to gather additional hardware information, including
the serialnumber which you are probably looking for
1. acting only on attaching the device
2. dealing with the registry
3. using the device and setup manager API

To 1. You have to listen to the WM_DEVICECHANGE message, which will be send
only to registered applications via RegisterDeviceNotification function. In
the WM_DEVICECHANGE you can access the full device name, which includes the
serialnumber

To 2. The registry HKLM\system\CurrentControlSet\Enum\USBSTOR\ contains all
information, you have to iterate thru all keys and values. Not recommended
since key meaning may not the same in all versions of windows

To 3. You have to implement tons of function from the SetupAPI, maybe there
exists some C code which encapsulate the stuff to a simple Device
enumeration function.

Regards
Ekkehard

--
View this message in context: http://libusb.6.n5.nabble.com/Hardware-ID-from-usb-stick-tp5434769p5435179.html
Sent from the LibUSB Dev - Win32 mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
(Continue reading)


Gmane