Jungo WinDriver  
Official Documentation
Chapter 17: Driver Installation — Advanced Issues

17.1. Windows INF Files

Device information (INF) files are text files that provide information used by the Windows Plug-and-Play mechanism to install software that supports a given hardware device. INF files are required for hardware that identifies itself, such as USB and PCI. An INF file includes all necessary information about a device and the files to be installed. When hardware manufacturers introduce new products, they must create INF files to explicitly define the resources and files required for each class of device.

In some cases, the INF file for your specific device is supplied by the operating system. In other cases, you will need to create an INF file for your device. WinDriver's DriverWizard can generate a specific INF file for your device. The INF file is used to notify the operating system that WinDriver now handles the selected device.

For USB devices, you will not be able to access the device with WinDriver (either from DriverWizard or from the code) without first registering the device to work with windrvr1610.sys. This is done by installing an INF file for the device. DriverWizard will offer to automatically generate the INF file for your device.

You can use DriverWizard to generate the INF file on the development machine and then install the INF file on any machine to which you distribute the driver, as explained in the following sections.

17.1.1. Why Should I Create an INF File?

We recommend creating an INF file for the following reasons:

  • To bind the WinDriver kernel module to a specific device.
  • To override the existing driver (if any).
  • To enable WinDriver applications and DriverWizard to access a device.

17.1.2. How Do I Install an INF File When No Driver Exists?

You must have administrative privileges in order to install an INF file.

You can use the wdreg utility with the install command to automatically install the INF file:

wdreg -inf <path to the INF file> install

On the development PC, you can have the INF file automatically installed when selecting to generate the INF file with DriverWizard, by checking the Automatically Install the INF file option in the DriverWizard's INF generation window (refer to 6.2. DriverWizard Walkthrough).

On the development PC, you can also use the wdreg_frontned utility to install/uninstall INFs and perform other advanced tasks.

It is also possible to install the INF file manually, using either of the following methods:

  • Windows Found New Hardware Wizard: this wizard is activated when the device is plugged in or, if the device was already connected, when scanning for hardware changes from the Device Manager.
  • Windows Add/Remove Hardware Wizard: right-click the mouse on My Computer, select Properties, choose the Hardware tab and click on Hardware Wizard....
  • Windows Upgrade Device Driver Wizard: locate the device in the Device Manager devices list and select the Update Driver... option from the right-click mouse menu or from the Device Manager's Action menu.

In all the manual installation methods above you will need to point Windows to the location of the relevant INF file during the installation.

We recommend using the wdreg utility to install the INF file automatically, instead of installing it manually.

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.

17.1.3. How Do I Replace an Existing Driver Using the INF File?

You must have administrative privileges in order to replace a driver.

  • Install your INF file.

You can use the wdreg utility with the install command to automatically install the INF file:

wdreg -inf <path to INF file> install

On the development PC, you can have the INF file automatically installed when selecting to generate the INF file with DriverWizard, by checking the Automatically Install the INF file option in the DriverWizard's INF generation window. On the development PC, you can also use the wdreg_frontned utility to install/uninstall INFs and perform other advanced tasks.

It is also possible to install the INF file manually, using either of the following methods:

  • Windows Found New Hardware Wizard: this wizard is activated when the device is plugged in or, if the device was already connected, when scanning for hardware changes from the Device Manager.
  • Windows Add/Remove Hardware Wizard: right-click on My Computer, select Properties, choose the Hardware tab and click on Hardware Wizard....
  • Windows Upgrade Device Driver Wizard: locate the device in the Device Manager devices list and select the Update Driver... option from the right-click mouse menu or from the Device Manager's Action menu.

In the manual installation methods above you will need to point Windows to the location of the relevant INF file during the installation. If the installation wizard offers to install an INF file other than the one you have generated, select Install one of the other drivers and choose your specific INF file from the list.

We recommend using the wdreg utility to install the INF file automatically, instead of installing it manually.

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.

17.2. Renaming the WinDriver Kernel Driver

The WinDriver APIs are implemented within the WinDriver kernel driver module (windrvr1610.sys/.dll/.ko — depending on the OS), which provides the main driver functionality and enables you to code your specific driver logic from the user mode.

On Windows and Linux you can change the name of the WinDriver kernel module to your preferred driver name, and then distribute the renamed driver instead of the default kernel module — windrvr1610.sys/.dll/.ko. The following sections explain how to rename the driver for each of the supported operating systems.

For information on how to use the Debug Monitor to log debug messages from your renamed driver, refer to 8.2.1.3. Running wddebug_gui for a Renamed Driver : Running wddebug_gui for a Renamed Driver.

A renamed WinDriver kernel driver can be installed on the same machine as the original kernel module. You can also install multiple renamed WinDriver drivers on the same machine, simultaneously.

💡 Recommendation

Try to give your driver a unique name in order to avoid a potential conflict with other drivers on the target machine on which your driver will be installed.

17.2.1. Windows Driver Renaming

DriverWizard automates most of the work of renaming the Windows WinDriver kernel driver — windrvr1610.sys.

When renaming the driver, the CPU architecture (32-/64-bit) of the development platform and its WinDriver installation, should match the target platform.

Renaming the signed windrvr1610.sys driver nullifies its signature. In such cases you can select either to sign your new driver, or to distribute an unsigned driver. For more information on driver signing and certification, refer to 17.3. Windows Digital Driver Signing and Certification. For guidelines for signing and certifying your renamed driver, refer to 17.3.2. Driver Signing and Certification of WinDriver-Based Drivers.

⚠ Attention

References to xxx in this section should be replaced with the name of your generated DriverWizard driver project.

To rename your Windows WinDriver kernel driver, follow these steps:

  • Use the DriverWizard utility to generate driver code for your hardware on Windows (refer to 6.2. DriverWizard Walkthrough), using your preferred driver name (xxx) as the name of the generated driver project. The generated project directory (xxx) will include an xxx_installation directory with the following files and directories:
    • redist directory:
      File                                      Description
      xxx.sys Your new driver, which is actually a renamed copy of the windrvr1610.sys driver. The properties of the generated driver file (such as the file's version, company name, etc.) are identical to the properties of the original windrvr1610.sys driver. You can rebuild the driver with new properties using the files from the generated xxx_installation\sys directory, as explained below.
      xxx_driver.inf A modified version of the windrvr1610.inf file, which will be used to install your new xxx.sys driver. You can make additional modifications to this file, if you wish — namely, changing the string definitions and/or comments in the file.
      xxx_device.inf A modified version of the standard generated DriverWizard INF file for your device, which registers your device with your driver (xxx.sys).You can make additional modifications to this file, if you wish, such as changing the manufacturer or driver provider strings.
      wdapi1610.dll A copy of the WinDriver-API DLL. The DLL is copied here in order to simplify the driver distribution, allowing you to use the generated xxx\redist directory as the main installation directory for your driver, instead of the original WinDriver\redist directory.
      wdreg.exe, wdreg_gui.exe, and devcon.exe Copies of the CUI and GUI versions of the wdreg WinDriver driver installation utility, and the Device Console app required by this utility, (respectively). These files are copied from the WinDriver\util directory, to simplify the installation of the renamed driver.
      xxx_install.bat An installation script that executes the wdreg commands for installing the xxx_driver.inf and xxx_device.inf files. This script is designed to simplify the installation of the renamed xxx_driver.sys driver, and the registration of your device with this driver.
    • sys directory:
      This directory contains files for advanced users, who wish to change the properties of their driver file. Changing the file's properties requires rebuilding of the driver module using the Windows Driver Kit (WDK).
      To modify the properties of your xxx.sys driver file:
      • Verify that you have WDK 8 or above and its corresponding Windows SDK installed on your development PC.
      • Modify the xxx.rc resources file in the generated sys directory in order to set different driver file properties.
      • Compile xxx.vcxproj with MsBuild or Visual Studio.
      • After rebuilding the xxx.sys driver, copy the new driver file to the generated xxx_installation\redist directory.
  • Verify that your user-mode application calls the WD_DriverName() function with your new driver name before calling any other WinDriver function. Note that the sample and generated DriverWizard WinDriver applications already include a call to this function, but with the default driver name (windrvr1610), so all you need to do is replace the driver name that is passed to the function in the code with your new driver name.
  • Verify that your user-mode driver project is built with the WD_DRIVER_NAME_CHANGE preprocessor flag (e.g., -DWD_DRIVER_NAME_CHANGE). Note: The sample and generated DriverWizard WinDriver kernel projects/makefiles already set this preprocessor flag by default.
  • Install your new driver by following the instructions in 15.2. Windows Driver Distribution of the manual, using the modified files from the generated xxx_installation directory instead of the installation files from the original WinDriver distribution. Note that you can use the generated xxx_install.bat installation script to simplify the installation.

17.2.1.1 Rebuilding with Custom Version Information (Windows)

WinDriver for Windows allows building your driver with custom version information (Provider, Date, Version, etc…). This information can be seen upon entering the Device Properties of your device in the Device Manager or by right-clicking the driver binary and selecting the “Details” tab.

Visual Studio is required in order to perform the following procedure. In the following instructions xxx stands for your generated driver name.

  • In your generated code folder go to the xxx_installation\sys subfolder.
  • Edit xxx.rc and modify the details in it to suit your needs.
  • Open the xxx.vcxproj with Visual Studio and build the project. Make sure you compile the driver in Release configuration for your platform (32 or 64 bits).
  • The resulting xxx.sys file should include your custom version information.

17.2.2. Linux Driver Renaming

DriverWizard automates most of the work of renaming the Linux WinDriver kernel driver — windrvr1610.ko.

⚠ Attention

References to xxx in this section should be replaced with the name of your generated DriverWizard driver project.

To rename your Linux WinDriver kernel driver, follow these steps:

  • Use the DriverWizard utility to generate driver code for your hardware on Linux
    (refer to 6.2. DriverWizard Walkthrough), using your preferred driver name (xxx) as the name of the generated driver project. The generated project directory (xxx) will include an xxx_installation directory with the following files and directories:

redist directory: This directory contains copies of the files from the original WinDriver/redist installation directory, but with the required modifications for building your xxx.ko driver instead of windrvr1610.ko. lib and include directories: Copies of the library and include directories from the original WinDriver distribution. These copies are created since the supported Linux WinDriver kernel driver build method relies on the existence of these directories directly under the same parent directory as the redist directory.

  • Verify that your user-mode application calls the WD_DriverName() function with your new driver name before calling any other WinDriver function. Note that the sample and generated DriverWizard WinDriver applications already include a call to this function, but with the default driver name (windrvr1610), so all you need to do is replace the driver name that is passed to the function in the code with your new driver name.
  • Verify that your user-mode driver project is built with the WD_DRIVER_NAME_CHANGE preprocessor flag (-DWD_DRIVER_NAME_CHANGE). Note that the sample and generated DriverWizard WinDriver kernel projects/makefiles already set this preprocessor flag by default. If you have created a Kernel PlugIn driver, you will need to add this flag by uncommenting the following line in the Kernel PlugIn driver's configuration script:
# ADDITIONAL_FLAGS="-DWD_DRIVER_NAME_CHANGE"
  • Install your new driver by following the instructions in 15.3. Linux Driver Distribution of the manual, using the modified files from the generated xxx_installation directory instead of the installation files from the original WinDriver distribution.

As part of the installation, build your new kernel driver module(s) by following the instructions in
15.3. Linux Driver Distribution, using the files from your new installation directory.

17.3. Windows Digital Driver Signing and Certification

17.3.1. Windows Digital Driver Signing and Certification Overview

Before distributing your driver, you may digitally sign it using Microsoft's Authenticode mechanism, and/or certify it by submitting it to Microsoft's Windows Certification Program (HLK/HCK/WLP).

Some Windows operating systems, do not require installed drivers to be digitally signed or certified. Only a popup with a warning will appear. There are, however, advantages to getting your driver digitally signed or fully certified, including the following:

  • Driver installation on systems where installing unsigned drivers has been blocked.
  • Avoiding warnings during driver installation.
  • Full pre-installation of INF files.

64-bit versions of Windows 8 and higher require Kernel-Mode Code Signing (KMCS) of software that loads in kernel mode. This has the following implications for WinDriver-based drivers:

  • Drivers that are installed via an INF file must be distributed together with a signed catalog file. During driver development, please configure your Windows OS to temporarily allow the installation of unsigned drivers.

For more information about digital driver signing and certification, refer to the following documentation in the Microsoft Development Network (MSDN) library:

  • Driver Signing Requirements for Windows.
  • Introduction to Code Signing.
  • Digital Signatures for Kernel Modules on Windows.

This white paper contains information about kernel-mode code signing, test signing, and disabling signature enforcement during development.

Some of the documentation may still use old terminology. For example, references to the Windows Logo Program (WLP) or to the Windows Hardware Quality Labs (WHQL) or to the Windows Certification Program or to the Windows Hardware Certification Kit (HCK) should be replaced with the Windows Hardware Lab Kit (HLK), and references to the Windows Quality Online Services (Winqual) should be replaced with the Windows Dev Center Hardware Dashboard Services (the Hardware Dashboard).

17.3.1.1. Authenticode Driver Signature

The Microsoft Authenticode mechanism verifies the authenticity of a driver's provider. It allows driver developers to include information about themselves and their code with their programs through the use of digital signatures, and informs users of the driver that the driver's publisher is participating in an infrastructure of trusted entities.

The Authenticode signature does not, however, guarantee the code's safety or functionality.

The WinDriver\redist\windrvr1610.sys driver has an Authenticode digital signature.

17.3.1.2. Windows Certification Program

Microsoft's Windows Certification Program (previously known as the Windows Logo Program (WLP)), lays out procedures for submitting hardware and software modules, including drivers, for Microsoft quality assurance tests. Passing the tests qualifies the hardware/software for Microsoft certification, which verifies both the driver provider's authenticity and the driver's safety and functionality.

To digitally sign and certify a device driver, a Windows Hardware Lab Kit (HLK) package, which includes the driver and the related hardware, should be submitted to the Windows Certification Program for testing, using the Windows Dev Center Hardware Dashboard Services (the Hardware Dashboard).

Jungo's professional services unit provides a complete Windows driver certification service for Jungo-based drivers. Professional engineers efficiently perform all the tests required by the Windows Certification Program, relieving customers of the expense and stress of in-house testing. Jungo prepares an HLK / HCK submission package containing the test results, and delivers the package to the customer, ready for submission to Microsoft.

For more information, refer to https://www.jungo.com/st/services/windows_drivers_certification/.

For detailed information regarding Microsoft's Windows Certification Program and the certification process, refer to the MSDN Windows Hardware Certification page — https://msdn.microsoft.com/library/windows/hardware/gg463010.aspx — and to the documentation referenced from that page, including the MSDN Windows Dev Center — Hardware Dashboard Services page — https://msdn.microsoft.com/library/windows/hardware/gg463091.

17.3.2. Driver Signing and Certification of WinDriver-Based Drivers

As indicated above, The WinDriver\redist\windrvr1610.sys driver has an embedded Authenticode signature. Since WinDriver's kernel module (windrvr1610.sys) is a generic driver, which can be used as a driver for different types of hardware devices, it cannot be submitted to Microsoft's Windows Certification Program as a standalone driver. However, once you have used WinDriver to develop a Windows driver for your selected hardware, you can submit both the hardware and driver for Microsoft certification, as explained below.

The driver certification and signature procedures — either via Authenticode or the Windows Certification Program — require the creation of a catalog file for the driver. This file is a sort of hash, which describes other files. The signed windrvr1610.sys driver is provided with a matching catalog file — WinDriver\redist\windrvr1610.cat. This file is assigned to the CatalogFile entry in the windrvr1610.inf file (provided as well in the redist directory). This entry is used to inform Windows of the driver's signature and the relevant catalog file during the driver's installation.

When the name, contents, or even the date of the files described in a driver's catalog file is modified, the catalog file, and consequently the driver signature associated with it, become invalid. Therefore, if you select to rename the windrvr1610.sys driver (17.2. Renaming the WinDriver Kernel Driver) and/or the related windrvr1610.inf file, the windrvr1610.cat catalog file and the related driver signature will become invalid.

In addition, when using WinDriver to develop a driver for your Plug-and-Play device, you normally also create a device-specific INF file that registers your device to work with the windrvr1610.sys driver module (or a renamed version of this driver). Since this INF file is created at your site, for your specific hardware, it is not referenced from the windrvr1610.cat catalog file and cannot be signed by Jungo a priori.

When renaming windrvr1610.sys and/or creating a device-specific INF file for your device, you have two alternative options regarding your driver's digital signing:

  • Do not digitally sign your driver. If you select this option, remove or comment-out the reference to the windrvr1610.cat file from the windrvr1610.inf file (or your renamed version of this file).
  • Submit your driver to the Windows Certification Program, or have it Authenticode signed.

Note that while renaming WinDriver\redist\windrvr1610.sys nullifies the driver's digital signature, the driver is still compliant with the certification requirements of the Windows Certification Program.

To digitally sign/certify your driver, follow these steps:

  • Create a new catalog file for your driver, as explained in the Windows Certification Program documentation. The new file should reference both windrvr1610.sys (or your renamed driver) and any INF files used in your driver's installation.
  • Assign the name of your new catalog file to the CatalogFile entry in your driver's INF file(s). (You can either change the CatalogFile entry in the windrvr1610.inf file to refer to your new catalog file, and add a similar entry in your device-specific INF file; or incorporate both windrvr1610.inf and your device INF file into a single INF file that contains such a CatalogFile entry).
  • Submit your driver to Microsoft's Windows Certification Program or for an Authenticode signature. If you wish to submit your driver to the Windows Certification Program, refer to the additional guidelines in 17.3.2.1. HCK/HLK Test Notes.

Many WinDriver customers have already successfully digitally signed and certified their WinDriver-based drivers.

17.3.2.1. HCK/HLK Test Notes

As indicated in Microsoft's documentation, before submitting the driver for testing and certification you need to download the Windows Hardware Certification Kit (HCK) (for Windows 8) or the Windows Hardware Lab Kit (HLK) (for Windows 10), and run the relevant tests for your hardware/software. After you have verified that you can successfully pass the HCK/HLK tests, create the required logs package and proceed according to Microsoft's documentation.

For more information, refer to the MSDN Windows Hardware Certification Kit (HCK) page — https://msdn.microsoft.com/library/windows/hardware/hh833788.

17.3.3. Secure Boot and Driver Development

Secure boot is a security standard developed by Microsoft to help make sure that a PC boots using only software that is trusted by the Original Equipment Manufacturer (OEM). When the PC starts, the firmware checks the signature of each piece of boot software (UEFI, EFI apps, etc.) and blocks the loading of unsigned drivers.

⚠ Attention

Disabling Secure Boot and Digital signature enforcement is recommended during driver development and testing. However, a signed driver (Attestation Signing or HLK/WHQL) is required in order to install the driver after it has been distributed.

You can check if Secure Boot is enabled on your system by following one of the procedures below:

17.3.3.1. Through System Information

  • Press on Windows + R to open Run window.

Run window

  • Run msinfo32.exe to open the system information.
  • Look for “Secure Boot State and check its status under “System Summary”.

System Information

  • If the state is “Off” / “Unsupported” or if “Secure Boot State” is not listed under “System Summary” – that means that Secure Boot is disabled.

17.3.3.2. Through PowerShell

  • Open PowerShell with administrator privileges.
  • Enter the command Confirm-SecureBootUEFI and press Enter.

PowerShell

  • Any result other than True means that Secure Boot is disabled

17.3.3.3. Through WinDriver User-Mode API

Starting from WinDriver 12.8 the user-mode API (e.g. wdapi1280.dll)
includes the function check_secureBoot_enabled() that can be used as follows:

DWORD dwStatus = check_secureBoot_enabled();
if (dwStatus == WD_STATUS_SUCCESS)
printf("Secure Boot is enabled");
else
printf("Secure Boot is disabled / unsupported");
@ WD_STATUS_SUCCESS
[0] Operation completed successfully
Definition: windrvr.h:1043
DWORD DLLCALLCONV check_secureBoot_enabled(void)
Checks whether the Secure Boot feature is enabled on the system.

17.3.3.4. Disabling Secure Boot

In order to install and load unsigned drivers Secure Boot must be disabled.

Secure Boot can be disabled as follows:

  • Open PC BIOS menu (this can be done by restarting your PC).
  • Find the Secure Boot setting (usually under “Boot Manager”) and set it to “Disabled”.
  • Save the settings and Exit. PC will reboot.

For more information on Secure Boot setting, please see Microsoft Documentation.

17.3.4. Temporary disabling digital signature enforcement in Windows 10

Windows 10 (and other Windows versions) requires kernel drivers to be digitally signed. The WinDriver virtual device, which is installed during WinDriver installation process, is digitally signed. However, INF files that are generated by the DriverWizard utility are not signed and therefore will fail to install on Windows 10. In order to install them, it is required to digitally sign them. To bypass this requirement, it is possible to temporarily disable digital driver signing enforcement and install your INF file while the enforcement is disabled.

You can do this by following the procedure below:

  • Click on the Start menu button.
  • Hold down the Shift button in the keyboard, and click the Power icon on the left side of the Start menu.
  • From the menu that will open, choose Restart.
  • In the screen that will open, choose Troubleshoot.
  • Choose Advanced options.
  • Choose Start-up Settings.
  • The computer will restart and load a Startup Settings screen. Press F7 to disable driver signature enforcement.
  • Your INF should install successfully.

This operation mode (Disabled Digital Signature Enforcement), which allows you to freely install INF files generated by WinDriver, will last until the next reboot. Your newly installed INF files should work properly even after the Digital Signature Enforcement will automatically be switched on again in the next reboot. Other ways are available to permanently disable Digital Signature Enforcement, and are dependent on your Windows version. Full explanation for these ways can be found online.

ℹ️ Note

Jungo provides Digital Signature Services for drivers developed with WinDriver. In order to find ore information, please send us an e-mail to sales.nosp@m.@jun.nosp@m.go.co.nosp@m.m.