WinUSB Component for .Net WinForm
WinUSB is a new technology by Microsoft and part of
the Win32 API. WinUSB library includes a driver and a user-mode wrapper and API.
There is no need to write custom USB device drivers when WinUSB can be used.
Learn more about
WinUSB on the MSDN Library.
This page features a .Net Visual Component as a
wrapper for Bulk devices over WinUSB framework. The code is based on Interop and
sample code by Jan Axelson. For more information see
Jan Axelson's Lakeview Research
page. The version provided here only works with bulk devices and the code was
written to be as simple as possible. If you need to understand the code or learn
how to work with WinUSB, or if you need any method other than Bulk then I
suggest you explore Jan's source code.
The implementation here is a .Net Visual Component.
You can download both the component and the full source code.
To download the component click
Download WinUSB Component for .Net
To download the full source code click
Download WinUSB Component for .Net
Source Code (C#)
To learn more go to
Jan Axelson's Lakeview Research.
Installation Instruction:
Create a new WinForm Application and open the Form
designer view and go to the ToolBox.
Right click the ToolBox and select Choose Items

Click Browse and locate the component dll file which
you downloaded here.

Add the new component to your application

Modify the component's properties:
DeviceGUID to the GUID that you have in your INF
file.
Pipe Indexes to your Read (in) and Write (out) pipe
index values.
You can also set the read and write timeouts. The
default zero means block forever. Note that the read operation will block until
the entire buffer is full according to WinUSB implementation.

There are two sets of functions: Read/Write and
ReadBlocking/WriteBlocking.
If you are using the non-blocking version of the
functions (preferred) then you must also handle the events:

The component has been fairly tested but might still
have a few bugs in it. If you find any then please contact me and I will publish
the fix.
Version Date: Dec 28, 2009