Click here to Skip to main content
12,401,158 members (59,609 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# C#4.0 USB .NET4

I am currently trying to build an application that would program a device through DFU. I have an application programming interface with all the functions and methods I need, my problem is that the API is in C++, I am trying to translate it to C# but I am having a hard time understanding what I need to do. Currently I am able to identify all the usb devices connected to the pc,this link turned out to be very helpful, now I need to get the Symbolic link to the device according to the API guide I found. I am not sure what they mean by symbolic link.

Another question I have is the handle of the device is the device ID or the PnpID?

I know they are very basic concepts, but I am having a hard time to understand them, if you could point me to a tutorial, or article explaining what I need to know I would gladly appreciate it.

Posted 30-May-12 9:03am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1


a symbolic link is a link to a folder/directory within your file system (NTFS,FAT32,ext2,3, ...).
So in this case the symbolic link to your device could be to i.e. I:\ (the device letter of your USB Mass Storage Device).

To Device ID's and PNP-ID's:
All Plug n' Play (so...PNP) devices must contain a deviceID in order to allow the OS to uniquely recognize the device to load the correct driver for this device, the PNP-ID is a combination of the Vendor-ID and device-ID.

Here is a great libraries,infos and examples you can easily work with:

A USB HID Component for C#[^][^][^]

Enumerate and Auto-Detect USB Drives[^]

A USB Library to Detect USB Devices[^]

Unfortunately I don't know what you mean with "that would program a device through DFU."
There are several ways to communicate with RAS/DFU, depends how much code you want to write by yourself.

Using RASAPI32.dll by P/Invoke:[^]

Easy-To-Use Library:[^]

Much Information, more specified questions are always welcome after your research process Wink | ;)


PS: You don't necessarily need to use a C++ API to achieve this.
losmac 30-May-12 16:14pm
Good answer, my 5!
Björn Ranft 30-May-12 16:17pm
Thanks losmac! Regards ;)
nanomass 30-May-12 16:55pm
Thanks for your post Ranft. this info is very helpful!
Björn Ranft 31-May-12 7:15am
Glad it helped you. Good Luck ;)
Sandeep Mewara 31-May-12 0:43am
Björn Ranft 31-May-12 6:28am
Thank you Sandeep. Regards
VJ Reddy 31-May-12 19:55pm
Good answer. 5!
Björn Ranft 1-Jun-12 18:06pm
Thank you ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 30 May 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100