Getting Started with Universal Windows drivers
Universal Windows drivers enable developers to create a single driver package that runs across multiple different device types, from embedded systems to tablets and desktop PCs.
A Universal Windows driver is a driver package that contains an INF file and binaries that will install and run on Universal Windows Platform (UWP) based editions of Windows 10, such as Windows 10 for desktop editions (Home, Pro, and Enterprise), Windows 10 S, Windows 10 Mobile, Windows 10 IoT Core, Windows Server 2016, as well as other Windows 10 editions that share a common set of interfaces.
Any binaries referenced by the Universal INF file must use only device driver interfaces (DDI) that are included in UWP-based editions of Windows 10. These DDIs are marked as Universal on the corresponding documentation reference pages. The driver binary can use KMDF, UMDF 2 or the Windows Driver Model (WDM).
Other binaries contained in your Universal Windows driver must pass the API validation tests.
When you write a universal driver package, there are four design principles to consider:
- Declarative: Use directives in the INF file for installation operations and not extension points such as co-installers, RegisterDlls, etc.
- Componentized: System and/or OEM-specific customizations are in an extension INF driver package separate from the base driver package, facilitating independent updates of different components owned by different organizations.
- Hardware Support Apps (HSA): Use custom capabilities to associate a hardware-specific UWP (Universal Windows Platform) application with your driver. The resulting app can be delivered and serviced from the Microsoft Store.
- Universal API compliance: Binaries in the universal driver package only call APIs and DDIs that are included in the OneCore subset. INF files use only universal INF syntax.
Below, you'll find requirements and recommendations related to these principles. Also check out Universal Driver Scenarios, which describes how the DCHU universal driver sample applies the DCHU design principles.
The following are required when writing a universal driver package:
- Create a universal INF file for your driver:
- Use the ApiValidator tool to verify that the APIs your binaries call are valid for a universal driver package. See Validating Universal Windows drivers.
Use the following best practices:
If you are using the WDK with Visual Studio, set the Target Platform value in the driver project properties to
Universal. This will automatically pull in the correct libraries, as well as running the Universal INF validation and APIValidator as a part of build. To do this:
- Open the driver project properties.
- Select Driver Settings.
- Use the drop-down menu to set Target Platform to
If your INF performs any custom setup actions that depend on the target platform, consider separating them out into an extension INF. You can update an extension INF independently from the base driver package to improve robustness and servicing. See Using an Extension INF File.
- If you would like to provide an application that works with your device, please provide a UWP app. For details, see Hardware access for Universal Windows Platform apps. In Windows 10, version 1703, the OEM needs to pre-load such an app using DISM - Deployment Image Servicing and Management. Alternatively, users can manually download the app from the Microsoft Store.
- In the INF DestinationDirs Section, set the destination directories to dirid 13 to make the driver run from the Driver Store. This will not work for some devices.
Submit your universal driver package for certification in the Windows Hardware Compatibility Program. See these topics for more details: