The Microsoft Windows Driver Kit (WDK) Version 7.0.0 contains a set of tools, code samples, documentation, compilers, headers, and libraries that driver developers can use to create drivers for Windows 7, Windows Vista, Windows XP, Windows Server 2008 R2, Windows Server 2008, and Windows Server 2003.
[RTM] End User License Agreement
The contents included in the Windows Driver Kit (WDK) are licensed to you, the end user. Your use of the WDK is subject to the terms of an End User License Agreement (EULA) that accompanies the WDK and is located in the WDK installation directory. The name of the file is License.rtf. Before you access or use the WDK, you must read and accept the terms of the EULA. If you do not agree to the terms of the EULA, you are not authorized to use the WDK.
[RTM] Active Perl
The Windows Driver Kit contains Active Perl. For more information about ActiveState Corporation's Active Perl, see the
ActiveState Web site.
Complete information about WDK installation can be found in the Installation Guide.
[RTM] Installation Information
[RTM] IA64 is not supported as an installation platform
[RTM] Debugger Installation
If you install the Windows Debugger by using Kitsetup, the debugger tool will be installed in a folder called Debuggers in the installation path that you selected. If you install the debugger tool along with other WDK components, they will all have the same root installation path. If you do not want the debugger tool to be installed in the same root path as the other WDK components, you can do one of the following:
1. | Run the Debugger MSI on the media directly. |
2. | Run Kitsetup, install ONLY the debugger, and choose an installation path for the Debugger. When you rerun Kitsetup to install the other WDK components, choose a different installation path for the other WDK components. |
[RTM] MSXML 6.0 required for the Mc.exe tool to run
The Message Compiler (Mc.exe) tool has a dependency on Microsoft Core XML Services (MSXML) 6.0 to run correctly. If you have the Windows Driver Kit installed on Windows XP with Service Pack 3 (SP3) or later versions of Windows, MSXML 6.0 is already installed. If you have the Windows Driver Kit installed on an earlier version of the Windows operating system, download MSXML 6.0. To download MSXML 6.0 services, go to the Microsoft Download Center Web site.
[RTM] Kit Content Layout
By default, the WDK is installed to your local disk in the locations below. The default installation path for this WDK is C:\WinDDK\7600.0.0.
| Directory | Contents |
\Bin | WDK build tools |
\Debug | Files used during debugging |
\Help | WDK documentation |
\Inc | WDK headers |
\Lib | Import libraries |
\OACR | Microsoft Auto Code Review |
\Redist | Redistributable files |
\Src | WDK samples |
\Tools | Development, Debug, and Test tools |
\Debuggers | Windows Debugger |
[RTM] Possible installation problems with WinUSB on Vista RTM
Issue: On Windows Vista with no service packs installed, the installation can fail and the device will not work when installing WinUSB2.
Workaround: To mitigate the problem, install the Microsoft Knowledge Base fixes 949939 and 937287, or update your system to Vista with Service Pack 1 (SP1) or Vista SP2.
This section contains information about the changes that have been made to the Build Environment since the WDK for Server 2008 (6001.18002).
[RTM] Windows 2000 Build Environment no longer supported
The libraries for Microsoft Windows 2000 have been removed from the WDK. _NT_Target_Version=$(NT_TARGET_VERSION_WIN2K) will result in an error. _NT_Target_Version must be Windows XP or a later version of Windows.
[RTM] KMDF and UMDF Version Macros changed
The macros to indicate KMDF and UMDF versions have changed syntax. For Windows 7, the old syntax produces a warning.
| • | KMDF_VERSION changed to KMDF_VERSION_MAJOR |
| • | UMDF_VERSION changed to UMDF_VERSION_MAJOR |
| • | KMDF_MINOR_VERSION changed to KMDF_VERSION_MINOR |
| • | UMDF_MINOR_VERSION changed to UMDF_VERSION_MINOR |
[RTM] Microsoft Auto Code Review (OACR) added
Microsoft Auto Code Review tools (OACR) have been added to the WDK Build Environment. OACR starts automatically when a WDK Build Environment window is opened. It runs in the background and runs PreFast for Drivers (PFD) after every build. An icon in the taskbar indicates if the build contains PFD errors and warnings. For more information about OACR, see the WDK documentation.
[RTM] Changes to code signing tools
Signtool has been updated with the following changes:
| • | Removed dependency on CAPICOM |
| • | Supports SHA-2 digest algorithm use in signatures |
| • | Supports RFC 3161 timestamping when used on Windows 7 |
| • | Fixes to the /ac and /kp switches |
[RTM] ATL 2.1 and ATL 3.0 headers removed
The headers for ATL 2.1 and ATL 3.0 have been removed. ATL 7.1 headers have been moved from …\inc\crt\atl71 to …\inc\atl71. Changes were made to the Build Environment to use the ATL 7.1 header files in the new location. If your Sources file contains ATL_VER, the value should be 70 or 71.
[RTM] Header files added and removed
The following headers were included in the WDK for Server 2008 (6001.18002), but are not included in this release:
| • | DDK:
| ||||||||||||||||
| • | API:
|
The following DDK header files have been added to the WDK:
| • | DDK:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| • | API:
|
[RTM] KMDF/UMDF Version 1.9
KMDF and UMDF have been updated to version 1.9. Changes include the following:
| • | Guaranteed forward progress for KMDF drivers |
| • | Performance improvements in KMDF |
| • | Security hardening of the UMDF host process |
| • | Improvements in the UMDF Plug and Play (PnP) model |
| • | Ability to use kernel-mode drivers in the user-mode stack |
KMDF continues to support execution on Windows 2000 and later systems. UMDF supports execution on Windows XP and later systems. For more information, see the WDK documentation.
[RTM] KMDF filter driver for HID device may fail to send I/O
Issue: For filter drivers, the I/O type information that is used by WDFIOTARGET objects and created before the device is started, might not match the I/O type information of the target device object that is represented by the iotarget object. As a result, when the filter driver formats the request, the underlying IRP might get formatted incorrectly. Currently the problem occurs only if the filter driver is used for HID devices because HIDClass changes the I/O type of its device (PDO) during IRP_MN_START_DEVICE processing. This issue impacts default I/O targets and other WDFIOTARGET objects that are created by the driver in EvtDriverDeviceAdd callback.
Workaround: To work around this problem, create an I/O target in the EvtDeviceSelfManagedIoInit() callback instead of the EvtDriverDeviceAdd() callback to the lower device object and use it. The following sample code is provided:
WDF_IO_TARGET_OPEN_PARAMS_INIT_EXISTING_DEVICE(&openParams,
WdfDeviceWdmGetAttachedDevice (device));
status = WdfIoTargetCreate(device,
WDF_NO_OBJECT_ATTRIBUTES,
&devExt->IoTarget);
status = WdfIoTargetOpen(devExt->IoTarget, &openParams);
This section contains information about the changes that have been made to the redistributable files since the WDK for Server 2008 (6001.18002).
[RTM] WDF Co-installers
Co-installers for WDF version 1.9 are included. The co-installers for WDF version 1.7 have been removed. The WDF 1.9 co-installers are backward compatible with prior versions of WDF.
[RTM] WinUSB Co-installers
Co-installers for WinUSB v2 have been added to the kit.
[RTM] DIFx
The DIFx redistributable files have been updated.
[RTM] Offreg
Offreg DLLs have been added.
This section contains information about the changes that have been made to the Samples since the WDK for Server 2008 (6001.18002).
[RTM] Sample Folder Reorganization
The samples have been reorganized. The KMDF and UMDF samples have been moved into the folders for their appropriate device areas. Some of the WDM samples have been removed. Those that are still in the WDK can be found in the same location.
[RTM] Signing Sample
The signing sample, Selfsign_example.cmd, has been moved from …\bin\selfsign to …\src\general\build\driversigning.
[RTM] Samples added and removed
The following samples were included in the WDK for Server 2008 (6001.18002), but are not included in this release:
| • | HID: Virtual HID (Vhidmini.sys) | ||||||||||
| • | File System:
| ||||||||||
| • | PnPI8042 | ||||||||||
| • | Mouser | ||||||||||
| • | Kernel Samples:
| ||||||||||
| • | MCA Management Application | ||||||||||
| • | Network:
| ||||||||||
| • | Storage:
| ||||||||||
| • | Video: R200 Sample |
The following samples have been added to the WDK:
| • | 1394: Hybrid (UMDF/KMDF) 1394VDEV driver | ||||||||||
| • | Audio: Mic Array | ||||||||||
| • | Biometric samples | ||||||||||
| • | Build.exe samples | ||||||||||
| • | Bus:
| ||||||||||
| • | File System: Simrep Minifilter | ||||||||||
| • | General:
| ||||||||||
| • | HID: EloMT | ||||||||||
| • | Input: Moufilter driver converted to KMDF | ||||||||||
| • | Network: Xframe II | ||||||||||
| • | Print: XPS Raster Filter | ||||||||||
| • | Sensors samples | ||||||||||
| • | Storage: Storport Miniports | ||||||||||
| • | WMI Sample | ||||||||||
| • | WPD:
|
Additional information about these samples can be found in the WDK Documentation, or in a file in the directory with the sample.
[RTM] SWTuner Sample
The SWTuner sample supports the following digital network types:
| • | ATSC |
| • | QAM |
| • | DVB-T |
| • | DVB-S |
| • | DVB-C |
| • | ISDB-T |
| • | ISDB-S |
| • | Netop |
Main differentiation is the demodulator node type, which identifies the standard that is currently used. The framework exposes all necessary BDA definitions for the KS Proxy to control tuner and demodulator parameters. However the SWTuner internally process only the frequency to select a transport stream that is streamed from HDD. Enhancements in the PAL/Secam Tuner show how to implement Exhaustive Scanning for analog TV. To enable tuner hardware-based scanning, registry key HardwareScanning=1 has to be set. The sample shows how to set up a scan thread that scans in 250khz steps from low to high frequency. The analog framework exposes the filters tuner, audio, crossbar, capture, and encoder. Enhancement for DVB-S show how to implement DiSEqC into the tuning.
PBDA interfaces are incorporated for the DVB-S sample. This explains how to enhance a BDA tuner with PBDA interfaces, for example, eventing and MMI.
Additionally, the Netop Tuner type uses the full PBDA schema and implements all possible PBDA interfaces such as the following services. The Netop Tuner is adjusted as DVB-T network type in the GPNV value Source Types.
Eventing Service:
Eventing manager that handle the transfer of queued events to the PBDA user-mode ESEvents
Debug Service:
Manage to queue debug messages to user mode.
GPNV Service:
Implementation of necessary Name values that show the basic use for an operation, set up, and MMI
A real tuner shall not set the variables Device Id and Tuner Id and instead store the values persistent for the tuner.
CAS Service:
The implementation shows how to use MMIs for the Diagnostic and Setup page. Broadcast MMI's are shown by the change of a channel.
MUX Service:
The service transfer PID mapping information, which allows the control of transport stream mapping and the identification of the current selected service. A PBDA tuner can control its own demultiplexer and can map all PIDs to the output transport stream (if the hardware cannot deliver a full mpeg2 transport stream).
DRM Service:
Entry points for all DRM related functions.
Scanning/Tuning:
Scanning the frequency range and set/get the tuning parameters with xml tuning parameters. Tuners can use the scanning to scan from low to high frequency and determine the modulation parameters. These parameters are read every time the tuner finds a signal by using PBDA_Tuning_GetTunerState.
GDDS:
Loading the PBDA services and there tuning parameters, interface to load guide data. Be aware that only if the data type is PBDA_GUIDE_DATATYPE services and guide data is loaded by using GDDS. In all other cases the services and guide data is determined by in-band transport stream data.
UserActivity:
Interfaces for this PBDA service
[RTM] Memory leaks in Portable Devices (WPD) Driver Samples
Issue: The following application scenarios result in memory leaks in the driver. As a result, memory usage accumulates in the WUDFHost.exe process until the driver shuts down.
To fix these leaks, update the driver sample code as described in the workaround section.
1. | During object enumeration, the enumerator context is not released in WpdObjectEnumerator::OnFindNext. Affects: WpdHelloWorldDriver, WpdMultiTransportDriver, WpdBasicHardwareDriver, WpdServicesSampleDriver |
2. | During object deletion, the destructors for the fake content object(s) are not called before deleting their references from the m_Content array. Affects: WpdWudfSampleDriver |
3. | In WpdObjectResources::OnClose, an additional reference to the resource context is not released. Affects: WpdWudfSampleDriver |
Workarounds:
1. | In WpdObjectEnum.cpp, SAFE_RELEASE pEnumeratorContext before WpdObjectEnumerator::OnFindNext() returns. |
2. | In WpdWudfSampleDriver\FakeDevice.h, RemoveObjectsMarkedForDeletion(), delete the FakeContent object before removing its reference from the m_Content array. |
3. | In WpdWudfSampleDriver\WpdObjectResources.cpp, SAFE_RELEASE pContext before WpdObjectResources::OnClose() returns. |
[RTM] DSF: Incorrectly configured bulk endpoints in the Loopback sample
Issue: Per the USB 2.0 specification, bulk endpoints can have a maximum packet size of 512 bytes. The endpoint descriptors of the bulk endpoints in the DSF Loopback sample are incorrectly configured to be 1024 bytes.
Workaround: In src/test/dsf/usb/softusbloopback/LoopbackDevice.cpp, in CLoopbackDevice::ConfigureINEndpoint and ConfigureOUTEndpoint, set the endpoint descriptors as bulk endpoints with a maximum packet size of 512 bytes and then recompile the sample.
[RTM] Memory leaks in Sensor driver samples
Issue: There are memory leaks in the Sensor samples (both Sensor Skeleton and Time Sensor). These leaks occur one time per driver process (WUDFHost.exe) when the computer starts up.
To fix these leaks, update the driver sample code as described in the workaround section.
Note:
1. | The Sensor Skeleton Sample needs all of the following workarounds |
2. | The Time Sensor Sample needs only the first two workarounds. |
Workaround:
1. | In Device.cpp, SAFE_RELEASE pMyDevice before CMyDevice::CreateInstance returns. |
2. | In Queue.cpp, SAFE_RELEASE pMyQueue before CMyQueue::CreateInstance returns. |
3. | In Device.cpp, SAFE_RELEASE pSensorDdi before CMyDevice::OnPrepareHardware returns. |
This section contains information about the changes that have been made to the Tools since the WDK for Server 2008 (6001.18002).
[RTM] Tools added and removed
The following tools were included in the WDK for Server 2008 (6001.18002), but are not included in this release:
| • | Rpat.exe |
| • | AMCap2.exe |
| • | MCStream.exe |
| • | Nxdemo.exe |
The following tools have been added to the WDK:
| • | Biometrics – Biotest.exe, WBDIDriverTest.exe |
| • | Bluetooth – Sdpverify.exe |
| • | Driver Coverage – Drvcov.exe |
| • | Enhanced Storage – EhStorCertMgrCmd.exe |
| • | Test Tools – IOSpyCmd.exe, IOAttack.exe |
| • | Networking – WwanDriverTestApp.exe |
| • | General – ComputerHardwareIds.exe |
| • | Print – XpsAnalyzer.exe |
Additional information about how to use these tools is available in the WDK Documentation.
[RTM] Improvements to PFD
Improvements to PFD include the following:
| • | PFD now supports a broader range of expressions for analysis. For example: Const, Member names, ‘Side-effect-free’ C expressions. |
| • | Better annotation error checking. |
| • | Improved defect detection including “Banned API” checking. |
| • | PFD now generates warnings that help you to analyze a driver with Static Driver Verifier. SDV requires drivers to have declarations that define the role of the driver-supplied callback functions. PFD indicates when you need to add these Role type declarations to the driver code. |
[RTM] Improvements to Static Driver Verifier
Improvements to Static Driver Verifier include the following:
| • | DV support for NDIS Miniport Drivers. |
| • | An expanded set of rules for WDM and KMDF. |
| • | Role-type declarations. |
| • | Driver Property Rules. |
| • | Per Entry Verification. |
| • | Improved performance, scalability, and accuracy. |
[RTM] Permission denied exception during verification resulting in a Tool Error
Issue: When an antivirus program is running and the driver source code directory is not excluded from runtime scanning, there are rare chances that SDV may abort verification with the "Sys_error("slam.bp: Permission denied") " exception.
Workaround: Disable simultaneous access of the driver source code source tree, such as adding driver verification path in the antivirus exclude directories list.
[RTM] Static Driver Verifier: Recommendations for troubleshooting
Issue: When you run Static Driver Verifier (SDV) on your driver source code and SDV reports Timeouts, GiveUps, or Spaceouts.
Workaround: If Static Driver Verifier (SDV) reports Timeouts, GiveUps, or Spaceouts, try the following actions:
1. | Run SDV using the /refine command option. For example: staticdv /refine /rule:* Be aware that if SDV finds a NUR result during a run, it will emit the exact command line to be used on the console in cyan. This command line includes a reference to a configuration file named refine.sdv, which lists all rules that reported NURs. The command line will look like this: Staticdv /config:"refine.sdv" /refine The following two recommendations require changes to the options file, sdv-defaults.xml. The default file is specific to the driver model and can be found in the \tools\sdv\data\model\ directory, where model is WDM, WDF, or NDIS. |
2. | If your computer has a multi-core processor, reduce to 1 the number of threads that are used during verification. In the SDV defaults file, change the value for SDV_SlamConfig_NumberOfTheads to 1. |
3. | If SDV reports Timeouts, increase the Timeout limit. For example, double the value for SDV_SlamConfig_Timeout to 4000. |
4. | Use all these techniques together, if none of them helps when they are applied alone. Be aware that these techniques increase the actual duration of a run, but they also make easier for SDV to finish its job with a useful result (Pass or Defect). |
Issue: The Sensor Skeleton sample uses an incorrect data type for the following property:
SENSOR_DATA_TYPE_ALTITUDE_SEALEVEL_METERS.
The correct data type is a Double (VT_R8) and not Float (VT_R4).
Workaround: Replace the code in CSensorDDI::InitializeGpsSensor with the following:
// Altitude Value
var.vt = VT_R8;
var.dblVal = ALTITUDE_VALUE_METERS;
m_pGpsSensorDataFieldValues->SetValue(SENSOR_DATA_TYPE_ALTITUDE_SEALEVEL_METERS, &var);
ATL is included in the WDK as a convenience for driver developers who need to create Windows applets for their drivers. ATL should not be used for software development beyond this scope. The ATL that is available through Visual Studio provides a more complete and current set of libraries and should be used for development of software and web applications. Visual C++ Express Edition is available for free from MSDN.
The build environment and target operating system settings are incomplete for the Windows Portable Devices Samples. Refer to the following sections for the complete list.
Sample name: Comprehensive WPD Sample Driver
Build Environment:
| • | Windows XP (x86) |
| • | Windows Vista (x86, amd64) |
| • | Windows 7 (x86, amd64) |
Target Operating System:
| • | Windows XP (x86) |
| • | Windows Vista (x86, amd64) |
| • | Windows 7 (x86, amd64) |
Sample name: Windows Portable Devices Hello World Driver
Build Environment:
| • | Windows XP (x86) |
| • | Windows Vista (x86, amd64) |
| • | Windows 7 (x86, amd64) |
Target Operating System:
| • | Windows XP (x86) |
| • | Windows Vista (x86, amd64) |
| • | Windows 7 (x86, amd64) |
Sample name: Windows Portable Devices Basic Hardware Driver
Build Environment:
| • | Windows XP (x86) |
| • | Windows Vista (x86, amd64) |
| • | Windows 7 (x86, amd64) |
Target Operating System:
| • | Windows XP (x86) |
| • | Windows Vista (x86, amd64) |
| • | Windows 7 (x86, amd64) |
Sample name: Windows Portable Devices Multi-Transport Driver
Build Environment:
| • | Windows 7 (x86, amd64) |
Target Operating System:
| • | Windows 7 (x86, amd64) |
Sample name: Windows Portable Devices Service Sample Driver
Build Environment:
| • | Windows 7 (x86, amd64) |
Target Operating System:
| • | Windows 7 (x86, amd64) |
Additional Requirements for Windows XP: Windows Portable Devices binaries are not included with Windows XP. To enable drivers (built for Windows XP) to load, the Windows Media Format SDK 11 runtime must be installed.
Issue: The device ID that is specified for the Devcon.exe command line is incorrect for the Windows Portable Devices Multi-Transport Driver. As a result, the WpdMultiTransportDriver does not install properly. To properly install the driver, use the following updated instructions.
Workaround: The installation instructions (with the corrected device ID highlighted) are as follows:
1. | Launch the desired build environment from the Start menu. |
2. | Build the sample (“build –cZ”). |
3. | Copy WUDFUpdate_0xxxx.dll to the directory that contains the driver DLL. |
4. | Install the driver ("devcon install Wpdmultitransportdriver.inf WUDF\MultiTransport") |
Issue: The 64-bit compiler that is included with the WDK can potentially generate invalid assembly when performing optimized float to integer conversions. The generated assembly includes instructions that use source registers that are not supported for the instruction.
To determine if your code has this issue, follow these steps:
1. | Compile your source code with the /FAsc option to generate a compiler listing (by default in a .cod file). |
2. | Filter it for all occurrences of CVTTSD2SI, CVTTSS2SI, VCVTTSD2SI, and VCVTTSS2SI instructions. |
3. | Use the DUMPBIN tool to disassemble the binary like the following : DUMPBIN /DISASM binary-file |
4. | Filter this output for all occurrences of CVTTSD2SI, CVTTSS2SI, VCVTTSD2SI, and VCVTTSS2SI. |
5. | Compare the convert instructions from the compiler listing with those from the disassembly. If there are any differences, the compiler has generated a bad instruction for those conversions. |
Workaround: Option 1: Use a pair of pragmas to turn off optimizations for the affected functions.
Example:
#pragma optimize(“”, off)
// user’s function goes here.
#pragma optimize(“”, on)
Option 2: Declare the source variable that is involved in the conversion as 'volatile'. This may help the compiler avoid the problematic conversion, but is not guaranteed.
Issue: The Windows 7 WDK has a known issue with the Unicode versions of the formatting and parsing functions that make up the Security Enhancements in the CRT.
http://msdn.microsoft.com/library/8ef0s5kh.aspx. These security enhancements cause incorrect results or AVs when code that is built for Windows 7 is run on Windows Vista or Windows Server 2008. For example, using Point-and-Print with a Windows 7 printer driver results in a driver that does not run correctly on Windows Vista or Windows Server 2008.
Workaround: To avoid this AV, use the "non _S versions" (for example, swscanf instead of swscanf_s) with this version of the WDK any time the Unicode functions are being used and a target operating system earlier than Windows 7 is involved.
Issue: The platform-specific versions of WttLogCm.dll are not included when WDTF is installed by using the WDK. This .dll is required when you run WDTF scripts, such as Common_Scenario_Stress_With_IO.wsf. These scripts fail when they are run by using Cscript.exe, and the following error message appears:
WTT Logger unavailable! Please reinstall WDTF.
If you install WDTF by using the WLK, you will not encounter this problem.
Workaround:
To work around this problem, follow these steps:
1. | If you have not installed WDK for Windows Server 2008, obtain a copy of this WDK and install it on a local computer. This version of the WDK is available for download from the |
2. | Copy the platform-specific version of WttLogCm.dll from the Windows Server 2008 WDK to the SampleScripts directory in your WDTF installation. The platform-specific version of WttLogCm.dll is located in the following directory: Server2008WDKPath\tools\WDTF\%PROCESSOR_ARCHITECTURE%fre\redist\Extras Server2008WDKPath represents the path of the directory where you installed the Microsoft Server 2008 WDK (for example C:\WINDDK\6601.18002). |
3. | Open an elevated command prompt and navigate to the SampleScripts directory in your WDTF installation. Afterwards, type the following at the command prompt and press Enter: |