Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Access USB device properties using C#

512 views
Skip to first unread message

Andrew Falanga

unread,
Jul 17, 2008, 2:54:12 PM7/17/08
to
Hi,

I asked a question about accessing USB devices previously and
incorrectly stated my question. I'd like to know how I can obtain
information about USB devices using C# such as the USB VID/PID. What
is necessary for this?

Sorry for the incorrectly worded question.

Andy

Christian ASTOR

unread,
Jul 17, 2008, 3:31:26 PM7/17/08
to
Andrew Falanga wrote:

> I asked a question about accessing USB devices previously and
> incorrectly stated my question. I'd like to know how I can obtain
> information about USB devices using C# such as the USB VID/PID. What
> is necessary for this?

USB devices and their properties can be enumerated with Setup apis
(USBView.c sample in DDK)

Andrew Falanga

unread,
Jul 17, 2008, 3:39:32 PM7/17/08
to

Christian,

Thanks. Sorry for the ignorance here, but I'm really very unfamiliar
with all things MS. Where is this DDK? Is it part of VS2008? In
what, or where, do I look?

Andy

Kellie Fitton

unread,
Jul 17, 2008, 5:23:27 PM7/17/08
to
On Jul 17, 12:31 pm, Christian ASTOR <casto...@club-internet.fr>
wrote:

Hi,

Did you try registry mining in the following registry keys:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB

Kellie.

Kellie Fitton

unread,
Jul 17, 2008, 5:31:58 PM7/17/08
to
On Jul 17, 12:31 pm, Christian ASTOR <casto...@club-internet.fr>
wrote:

Hi,

I think Christian is referring to the following article & setupDi
APIs:

http://msdn.microsoft.com/en-us/library/cc526325.aspx

http://msdn.microsoft.com/en-us/library/ms791137.aspx

http://msdn.microsoft.com/en-us/library/ms792967.aspx

Kellie.

Jerry Coffin

unread,
Jul 18, 2008, 12:15:42 AM7/18/08
to
In article <2c12c6f6-76c6-4eaf-b7af-5d0c41816368
@e39g2000hsf.googlegroups.com>, af30...@gmail.com says...

[ ...

> Thanks. Sorry for the ignorance here, but I'm really very unfamiliar
> with all things MS. Where is this DDK? Is it part of VS2008? In
> what, or where, do I look?

http://www.microsoft.com/whdc/devtools/ddk/default.mspx

--
Later,
Jerry.

The universe is a figment of its own imagination.

Andrew Falanga

unread,
Jul 18, 2008, 9:00:58 AM7/18/08
to
On Jul 17, 10:15 pm, Jerry Coffin <jcof...@taeus.com> wrote:
> In article <2c12c6f6-76c6-4eaf-b7af-5d0c41816368
> @e39g2000hsf.googlegroups.com>, af300...@gmail.com says...

>
> [ ...
>
> > Thanks.  Sorry for the ignorance here, but I'm really very unfamiliar
> > with all things MS.  Where is this DDK?  Is it part of VS2008?  In
> > what, or where, do I look?
>
> http://www.microsoft.com/whdc/devtools/ddk/default.mspx
>
> --
>     Later,
>     Jerry.
>
> The universe is a figment of its own imagination.

Everyone, thanks for your help. I'm almost afraid to ask but because
of the answers I'm getting here, is there no way to get information
like VID/PID from outside the DDK (meaning libraries that would be
part of Visual Studio)?

Andy

Christian ASTOR

unread,
Jul 18, 2008, 11:20:27 AM7/18/08
to
On 18 juil, 15:00, Andrew Falanga <af300...@gmail.com> wrote:

> Everyone, thanks for your help.  I'm almost afraid to ask but because
> of the answers I'm getting here, is there no way to get information
> like VID/PID from outside the DDK (meaning libraries that would be
> part of Visual Studio)?

Setup apis used by USBView.c are not part of DDK (WDK). It's just the
sample that MS put there
They are User mode apis

Jerry Coffin

unread,
Jul 18, 2008, 11:34:35 AM7/18/08
to
In article <74232135-f36d-4283-aed8-7dd3385ab920
@y22g2000prd.googlegroups.com>, af30...@gmail.com says...

[ ... ]

> Everyone, thanks for your help. I'm almost afraid to ask but because
> of the answers I'm getting here, is there no way to get information
> like VID/PID from outside the DDK (meaning libraries that would be
> part of Visual Studio)?

In theory, you were on the right track with WMI -- CIM_USBDEvice defines
a GetDescriptor method that would let you retrieve that data.

Unfortunately, while Microsoft has a matching GetDescriptor method for
Win32_USBHub, they don't appear to have anything similar for any USB
devices other than hubs...

0 new messages