Appendix B. WinDriver USB Host API Reference

This function reference is C oriented. The WinDriver C# and Visual Basic .NET APIs have been implemented as closely as possible to the C APIs, therefore .NET programmers can also use this reference to better understand the WinDriver APIs for their selected development language. For the exact API implementation and usage examples for your selected language, refer to the WinDriver .NET source code.

B.1. WD_DriverName


Sets the name of the WinDriver kernel module, which will be used by the calling application.

  • The default driver name, which is used if the function is not called, is windrvr1260.
  • This function must be called once, and only once, from the beginning of your application, before calling any other WinDriver function (including WD_Open() / WDU_Init()), as demonstrated in the sample and generated DriverWizard WinDriver applications, which include a call to this function with the default driver name — windrvr1260.
  • On Windows and Linux, if you select to modify the name of the WinDriver kernel module (windrvr1260.sys/.dll/.o/.ko), as explained in Section 11.2, you must ensure that your application calls WD_DriverName() with your new driver name.
  • In order to use the WD_DriverName() function, your user-mode driver project must be built with WD_DRIVER_NAME_CHANGE preprocessor flag (e.g.: -DWD_DRIVER_NAME_CHANGE — for MS Visual Studio, Windows GCC, and GCC).
    The sample and generated DriverWizard Windows and Linux WinDriver projects/makefiles already set this preprocessor flag.
const char* DLLCALLCONV WD_DriverName(const char* sName);
sNameconst char*Input
sName The name of the WinDriver kernel module to be used by the application.
NOTE: The driver name should be indicated without the driver file's extension. For example, use windrvr1260, not windrvr1260.sys or windrvr1260.o.
Return Value

Returns the selected driver name on success; returns NULL on failure (e.g., if the function is called twice from the same application)long.


The ability to rename the WinDriver kernel module is supported on Windows and Linux, as explained in Section 11.2.