Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

C Programming Language

Scanning USB devices and reading USB descriptors


Hi,

I'm wondering how I can scan the system for USB devices and read off
the USB descriptors such as VID/PID/serial number in C? I have an
external USB HDD that I wish to access, and I'm currently able to do
so with DeviceIoControl by addressing it as PhysicalDriveX, which will
return me information about the device, except it only does it for the
attached fixed disk, rather than the USB device.

Thanks!

galapogos wrote:
> Hi,

Hi,

> I'm wondering how I can scan the system for USB devices and read off
> the USB descriptors such as VID/PID/serial number in C? I have an
> external USB HDD that I wish to access, and I'm currently able to do
> so with DeviceIoControl by addressing it as PhysicalDriveX, which will
> return me information about the device, except it only does it for the
> attached fixed disk, rather than the USB device.

While this is not possible in plain standard C, there are certainly a
few libraries that you can use to access USB devices.
One of those is libusb [1], which is available on quite a few Unix-like
operating system.

[1] http://libusb.sourceforge.net/

> Thanks!

--
Pietro Cerutti

PGP Public Key ID:
http://gahr.ch/pgp

On May 10, 5:55 pm, Pietro Cerutti <g@gahr.ch> wrote:

Thanks. I actually have libusb-win32. I wasn't aware the source code
was included. I'll check it out.

I also checked out MSDN, specifically the "USB Structures and
Enumerations", and several of the functions all depend on usbdlib.h,
but despite copying the file over to my project from libusb I can't
seem to use the functions. How exactly do I use the libusb source
files?

No clue. You better ask to a more specific newsgroup, since your issue
isn't related to the C programming language, but rather to the way you
access some third-party library function.

Please check the libusb website, they surely have documentation on their
product.

--
Pietro Cerutti

PGP Public Key ID:
http://gahr.ch/pgp

galapogos wrote:

> I'm wondering how I can scan the system for USB devices and read
> off the USB descriptors such as VID/PID/serial number in C? I
> have an external USB HDD that I wish to access, and I'm currently
> able to do so with DeviceIoControl by addressing it as
> PhysicalDriveX, which will return me information about the device,
> except it only does it for the attached fixed disk, rather than
> the USB device.

I see no reference to USB in the C standard.  So this is off-topic
in c.l.c.  Follow-ups set.

--
 <http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
 <http://www.securityfocus.com/columnists/423>
 <http://www.aaxnet.com/editor/edit043.html>
 <http://kadaitcha.cx/vista/dogsbreakfast/index.html>
                        cbfalconer at maineline dot net

--
Posted via a free Usenet account from http://www.teranews.com

In article <4643A2B7.3F88@yahoo.com>,

CBFalconer  <cbfalco@maineline.net> wrote:
>galapogos wrote:

>> I'm wondering how I can scan the system for USB devices and read
>> off the USB descriptors such as VID/PID/serial number in C? I
>> have an external USB HDD that I wish to access, and I'm currently
>> able to do so with DeviceIoControl by addressing it as
>> PhysicalDriveX, which will return me information about the device,
>> except it only does it for the attached fixed disk, rather than
>> the USB device.

>I see no reference to USB in the C standard.  So this is off-topic
>in c.l.c.  Follow-ups set.

IOW, ...

(You know the drill)

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc