There may be times when you choose to write your driver directly, without using DriverWizard. In such cases, either follow the steps outlined in this section to create a new driver project, or select a WinDriver sample that most closely resembles your target driver and modify it to suit your specific requirements.
Include the relevant WinDriver header files in your driver project.
All header files are found under the
WinDriver/include directory.
All WinDriver projects require the windrvr.h
header file.
When using the WDU_xxx WinDriver USB API
Include any other header file that provides APIs that you wish to use from your code (e.g., files from the WinDriver/samples/shared directory, which provide convenient diagnostics functions.)
#include "wdu_lib.h"
You can also include the library's source files in your project instead of linking the project with the library. The C source files are located under the WinDriver/src/wdapi directory.
![]() | |
|
When linking your project with the WDAPI library/shared object, you will need to
distribute this binary with your driver. For Windows, get wdapi1130.dll / wdapi1130_32.dll (for 32-bit applications targeted at 64-bit platforms) from the WinDriver\redist directory. For Linux, get libwdapi1130.so / libwdapi1130_32.so (for 32-bit applications targeted at 64-bit platforms) from the WinDriver/lib directory. |
Note: On Windows and Linux, when using the DLL/shared object file
for 32-bit applications on 64-bit platforms
(wdapi1130_32.dll /
libwdapi1130_32.so), rename
the copy of the file in the distribution package, by removing the
_32 portion
For detailed distribution instructions, refer to
WDU_Init()WDU_Transfer()WDU_Uninit()After including the required files and writing your code, make sure that the required build flags and environment variables are set, then build your code.
![]() | |
Before building your code, verify that the WD_BASEDIR environment
variable is set to the location of the of the WinDriver installation directory.
On Windows, Windows CE, and Linux you can define the WD_BASEDIR
environment variable globally — as explained in
|