Developing Drivers with the Windows Driver Foundation (Pro Developer)
To prepare a driver for installation, you must create a package that has everything that is required to perform the installation tasks. A key component of the package is an INF file that contains a set of data and instructions for the target system. The core elements of the package are essentially the same, regardless of how the driver is to be installed. Driver installation is thus largely about assembling the package and implementing the package's INF.
A released WDF driver package consists of the following components:
-
Driver binaries At a minimum, the package must include the driver's .dll or .sys files, depending on whether it is a UMDF or KMDF driver. The driver binary should be built against the version of the framework that is specified in the INF, but it can also be built against a newer minor version. The package can optionally include a variety of other binaries, such as supporting DLLs, property sheet providers, and associated applications.
-
Either or both WDF co-installers UMDF and KMDF drivers must include their respective co-installers. However, some drivers must include both:
-
UMDF USB drivers must have both co-installers because they depend on the system-provided WinUSB component, which is KMDF based. The package must also include the WinUSB co-installer.
-
Hybrid drivers have both UMDF and KMDF components, so they must have co-installers for both frameworks.
-
-
INFs The INF is the core of the installation package. It is a text file that contains directives that instruct Windows how to install the driver. Typically, the package includes either a single INF for the entire package or separate INFs for each CPU architecture.
An INF for a WDF driver includes the following data:
-
General information about the device such as the device's manufacturer, installation class, and version number.
-
Names and locations of files on the distribution disk and where they should be installed on the user's system.
-
Directives for creating or modifying registry entries for the driver or device.
-
Installation directives for which drivers are to be installed, which binaries contain the driver, and a list of drivers to be loaded on the device.
-
Directives for setting WDF-specific configuration information.
-
-
A digitally signed catalog (.cat) file A signed catalog file acts as a signature for the files in the package. The catalog file is required for 64-bit editions of Windows Vista and later versions and is strongly recommended for all drivers.
Digitally signing the package simplifies the installation process and provides customers with two very important additional benefits:
-
Customers can use the signature to identify the origin of the package.
-
Customers can use the signature to verify that the contents of the package have not been tampered with since it was signed. For example, this assures them that the driver has not been modified into a rootkit or infected with a virus.
See "How to Sign and Distribute a Driver Package" later in this chapter for details.
-
-
Optional components These can include such things as related applications, supporting DLLs, or icons.
Категории