Making and Signing Driver Packages
for NDIS Protocol Drivers
on Windows Vista

Background

A previous article Self-Signing NDIS Protocol Drivers for Windows Vista discussed the basic process of signing a NDIS protocol driver executable. In some cases simply self-signing the NDIS protocol driver executable is all that is required.

However, in other cases a NDIS protocol driver may need a companion INF file to be properly installed. In this case a driver package must be created and signed.

This topic provides a practical illustration of the basic steps used to make self-signed driver package for the WDK NDIS 6.0 NDISPROT sample driver to be installed on Windows Vista x64 edition.

 

Driver Packages

A driver package is simply a collection of all the files that are needed to install a driver. At the minimum the package would include:

bulletDriver Executable (.sys) File
bulletDriver's INF (.inf) File

 

Some NDIS drivers may employ additional components, such as a notify object, to be installed and to operate properly. The files associated with these additional components are referenced in the INF file.

bulletAdditional Components Referenced in the INF, such as Notify Objects

 

The signing process will add a catalog file (.cat) to the driver package. The signed catalog file is used as a digital signature for the collection of files that comprise the driver package. The catalog file includes hashes or thumbprints of each file listed in the catalog. The thumbprints are used to detect If any file in the catalog has been modified since the catalog was signed.

bulletDriver Package Catalog (.cat) File

 

Steps to Self-Sign a NDIS Protocol Driver Driver Package

Step 1 - Make the Driver Package

First build the WDK 6000 NDISPROT driver sample using the Windows Vista x64 Free Build Environment. Copy the driver and the companion INF file to a folder. The contents will be:

bulletndisprot.inf
bulletndisprot.sys

This is the baseline driver package for NDISPROT.

 

Step 2 - Self-Sign the Driver Executable

See the article Self-Signing NDIS Protocol Drivers for Windows Vista for information about using the basic signing tools and the steps used to self-sign the driver executable.

 

Step 3 - Modify and Check the INF File

If you must create your own INF file, then the most frequently recommended strategy is to search for an existing INF for a similar driver. Then modify that INF to suit your needs.

The in-box INF files are located in the \Windows\INF folder. Of course, you must also read the WDK documentation that specifies the INF layout and usage.

Once you have a basic INF file the next step is to begin the iterative process of verifying that it is correct. Use the WDK ChkINF tool to verify the structure and syntax of your setup information and make iterative changes until there are no warnings or errors.

bulletUse ChkINF to verify the structure and syntax of your INF file. ChkINF is included in the WDK.

 

This note uses the NDISPROT INF file from the WDK. When ChkINF is run on this INF file there are (thankfully...) no reported errors or warnings.

Even though ChkINF reports no warnings or errors on NDISPROT.INF, there are changes to be made.

  1. Add CatalogFile=filename.cat directive in the INF Version section of the driver package INF file.
     
  2. Change the date in the DriverVer directive in the INF Version section of the driver package INF file.

The second change is because the DriverVer date must later than an arbitrary date loosely tied to the release of the OS version for outside testing. For example, Vista drivers must have a DriverVer date after 04/01/2006 or they cannot be signed.

The modified Version section of the NDIS 6 NDISPROT driver is shown below. Fields highlighted in red have been changes from the stock WDK version.

[version]
Signature   = "$Windows NT$"
Class       = NetTrans
ClassGUID   = {4d36e975-e325-11ce-bfc1-08002be10318}
Provider    = %Msft%
DriverVer   = 11/22/2006,6.0.5019.0
CatalogFile = NDISPROT.cat

 

Step 4 - Make the Catalog File

There are several tools that can be used to make the catalog file for the driver package:

bulletMakeCat Tool - Makes an unsigned catalog file for files listed in a catalog definition file (.cdf). MakeCat is included in the WDK.

    See: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/seccrypto/security/using_makecat.asp
 
bulletInf2Cat Tool - Is a standalone tool that verifies driver packages are valid by executing signability tests. Inf2Cat will transfer INF’s into a catalog file format. Inf2Cat is a stand-alone tool that is part of the Winqual Submission Tool.

    See: https://winqual.microsoft.com/Help/Inf2cat_FAQ.htm
 
bulletSignability Tool - Signability checks driver package INF files for structural errors and verifies that a driver package can be digitally signed. The tool can optionally generate a catalog file. The Signability tool is included in the WDK.

    See: http://msdn2.microsoft.com/en-us/library/aa906345.aspx

 

The MakeCat tool is only sparsely documented, and involves making a catalog definition file (.cdf) file using a text editor. There is only one short example of a .CDF file and very little guidance. Nevertheless, MakeCat certainly works as advertised and .CDF files seem to actually require no more documentation than Microsoft has chosen to provide.

Inf2Cat, as well as the Signability tool, both read the INF file to extract the information necessary to build the catalog file. This eliminates the need to even bother with the .CDF file.

Early on I used the Signability tool to generate catalog files. It has a GUI interface as well as a command-line interface. It does get the job done, but leaves result logs in an open Notepad window. This is a nuisance if you are building and signing multiple drivers.

A note on OSR Online suggested using Inf2Cat, and it is better for making multiple catalog files in an automated build environment.

 If you actually encounter a need to make a driver package submission to WHQL, then you must use Signability,

Regardless of which tool you use, you will generate a NDISPROT.CAT file that becomes a new member of your driver package.

 

Step 5 - Self-Sign the Catalog File

The steps described in the article Self-Signing NDIS Protocol Drivers for Windows Vista are used to self-sign the catalog file.

 

Step 6 - Test the Driver Package Installation

You may need to test installation many times on a fresh image of the operating system.

 

Topic Status

November 22, 2006 Initial release.

 

PCAUSA Home · Privacy Statement · Products · Ordering · Support · Utilities · Resources
Mailing Lists  · PCAUSA Newsletter · PCAUSA Discussion List
Rawether for Windows, Rawether .NET, WinDis 32 and NDIS Press are trademarks of Printing Communications Assoc., Inc. (PCAUSA)
Microsoft, MS, Windows, Windows Vista, Windows 95, Windows 98, Windows Millennium, Windows 2000, and Win32 are registered trademarks and Visual C++ and Windows NT are trademarks of the Microsoft Corporation.
Copyright © 1996-2007 Printing Communications Assoc., Inc. (PCAUSA)
Last modified: January 20, 2007