Windows drivers can be implemented as either of the following types:
The WinDriver Windows kernel module — windrvr6.sys — is a fully WDM driver, which can be installed using the wdreg utility, as explained in the following sections.
WinDriver provides a utility for dynamically loading and unloading your driver, which replaces the slower manual process using Windows' Device Manager (which can still be used for the device INF). This utility is provided in two forms: wdreg and wdreg_gui. Both versions can be found in the WinDriver\util directory, can be run from the command line, and provide the same functionality. The difference is that wdreg_gui displays installation messages graphically, while wdreg displays them in console mode.
This section describes the use of wdreg/ wdreg_gui on Windows operating systems.
![]() | |
|
This section explains how to use the wdreg utility to install the WDM windrvr6.sys driver, or to install INF files that register USB devices to work with this driver, on Windows.
![]() | |
|
You can rename the windrvr6.sys kernel module and modify your device
INF file to register with your renamed driver, as explained in
|
Usage: The wdreg utility can be used in two ways as demonstrated below:
wdreg -inf <filename> [-silent] [-log <logfile>][install | preinstall | uninstall | enable | disable]wdreg -rescan <enumerator> [-silent] [-log
<logfile>]
![]() | |
|
To successfully disable/uninstall your driver, make sure that
there are no open handles to the WinDriver service (windrvr6.sys or
your renamed driver (refer to |
When using WinDriver, you develop a user-mode application that controls and
accesses your hardware by using the generic windrvr6.sys driver
(WinDriver's kernel module). Therefore, you might want to dynamically load and
unload the driver windrvr6.sys — which you can do using
wdreg.
In addition, in WDM-compatible operating systems, you also need to dynamically
load INF files for your Plug-and-Play devices.
wdreg enables you to do so automatically on
Windows.
This section includes wdreg usage examples,
which are based on the detailed description of
wdreg contained in the previous section.
wdreg -inf <path to windrvr6.inf> install
To load an INF file named device.inf,
located in the c:\tmp directory —
wdreg -inf c:\tmp\device.inf install
You can replace the install option in the example above with
preinstall to pre-install the device INF file for a device
that is not currently connected to the PC.
![]() | |
If the installation fails with an
ERROR_FILE_NOT_FOUND error, inspect the Windows registry to
see if the RunOnce key exists in
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion.
This registry key is required by Windows Plug-and-Play in order to properly install
drivers using INF files. If the RunOnce key is missing, create
it; then try installing the INF file again.
|
To unload the driver/INF file, use the same commands, but simply replace
install in the examples above with uninstall.