Skip to main content

Prerequisites

Before building, ensure you have all build requirements installed:
  • Visual Studio 2019 or 2022
  • Windows Driver Kit (WDK)
  • Windows 10/11 SDK
Building drivers requires administrator privileges and proper development certificates. Never build drivers from untrusted sources.

Getting the Source Code

Clone the Repository

git clone https://github.com/VirtualDrivers/Virtual-Display-Driver.git
cd Virtual-Display-Driver

Repository Structure

Key directories:
Virtual-Display-Driver/
├── Virtual Display Driver (HDR)/
│   ├── MttVDD/                 # Main driver project
│   │   ├── Driver.cpp          # Driver implementation (~5000 lines)
│   │   ├── Driver.h            # Driver header
│   │   ├── MttVDD.inf          # Driver installation file
│   │   ├── MttVDD.sln          # Solution file
│   │   └── MttVDD.vcxproj      # Project file
│   ├── EDID/                   # EDID profile files
│   ├── GetIddCx/               # IddCx version query tool
│   └── vdd_settings.xml        # Default driver configuration
├── Common/
│   └── Include/
│       └── AdapterOption.h     # GPU adapter selection logic
├── ThirdParty/
│   └── Windows-Driver-Frameworks/  # UMDF headers
└── Community Scripts/          # PowerShell utilities

Opening the Solution

Main Driver Solution

  1. Navigate to Virtual Display Driver (HDR)/
  2. Open MttVDD.sln in Visual Studio
  3. Visual Studio will load the driver project
There are two .sln files in the HDR directory. Use the one in the MttVDD subdirectory for the main driver, or the root one which includes the same project.

Selecting Build Configuration

Platform Selection

For most users: Select x64 platform
  1. In Visual Studio, use the platform dropdown (toolbar)
  2. Select your target platform:
    • x64 - Modern 64-bit systems (recommended)
    • ARM64 - ARM-based Windows devices
    • Win32 - Legacy 32-bit systems

Configuration Selection

  • Debug: For development and testing
    • Includes debug symbols
    • Enables additional logging
    • Uses SHA1 signing (faster)
    • Larger binary size
  • Release: For production use
    • Optimized code
    • Smaller binary size
    • Uses SHA256 signing
    • IddCx 1.10 with minimum version 3 required
Start with Debug | x64 configuration for your first build. It provides better diagnostic information if issues occur.

Building the Driver

Standard Build

From Visual Studio:
  1. Select your configuration (Debug/Release) and platform (x64/ARM64)
  2. Right-click the MttVDD project in Solution Explorer
  3. Select Build or press Ctrl+Shift+B
From Command Line (Developer Command Prompt):
cd "Virtual Display Driver (HDR)"
msbuild MttVDD.sln /p:Configuration=Release /p:Platform=x64

Build Output Location

Compiled files are placed in:
Virtual Display Driver (HDR)/MttVDD/[Platform]/[Configuration]/
For example, Release x64 build:
Virtual Display Driver (HDR)/MttVDD/x64/Release/MttVDD/

Build Artifacts

A successful build produces:
  • MttVDD.dll - Driver binary
  • MttVDD.inf - Driver installation file
  • MttVDD.cat - Catalog file (security)
  • vdd_settings.xml - Configuration file (copied via post-build)
  • MttVDD.pdb - Debug symbols (Debug builds)

Build Process Details

Compilation Steps

  1. WPP Preprocessing: Processes tracing macros in Trace.h
  2. C++ Compilation: Compiles Driver.cpp with C++17 standard
  3. PREfast Analysis: Runs static code analysis
  4. Linking: Links with UMDF and system libraries
  5. INF Processing: Processes driver installation file
  6. Catalog Creation: Creates security catalog
  7. Post-build: Copies vdd_settings.xml to output

Compiler Flags

Key compilation flags (Release x64):
/D_ATL_NO_WIN_SUPPORT
/DUMDF_DRIVER
/DIDDCX_VERSION_MAJOR=1
/DIDDCX_VERSION_MINOR=10
/DIDDCX_MINIMUM_VERSION_REQUIRED=3

Include Paths

The build uses these include directories:
  • Windows SDK UMDF headers
  • Windows SDK IddCx headers (version 1.10 for x64/ARM64)
  • Third-party WDF headers (UMDF 2.15)
  • Common project headers (Common/Include)

Code Analysis

PREfast Static Analysis

Enabled by default:
<RunCodeAnalysis>true</RunCodeAnalysis>
<EnablePREfast>true</EnablePREfast>
Benefits:
  • Catches potential bugs at compile time
  • Enforces driver coding standards
  • Identifies security issues
Suppressing Warnings: If needed, suppress specific warnings:
#pragma warning(disable: 28118) // Example: suppress specific warning

Common Build Issues

Error C1083: Cannot open include file

Symptom: fatal error C1083: Cannot open include file: 'IddCx.h' Cause: WDK not installed or paths not configured Solution:
  1. Verify WDK installation
  2. Restart Visual Studio
  3. Check project properties → VC++ Directories → Include Directories

LNK2001: Unresolved external symbol

Symptom: Linker errors about missing symbols Cause: Missing library dependencies Solution:
  1. Verify Additional Dependencies include:
    • OneCoreUAP.lib
    • avrt.lib
    • setupapi.lib
  2. Check WDK library paths are configured

MSB8036: Windows SDK not found

Symptom: SDK version mismatch Solution:
  1. Right-click project → Properties
  2. General → Windows SDK Version
  3. Select an installed SDK version or “Use latest”
  4. Rebuild

MIDL2011: Unresolved type declaration

Symptom: Interface definition errors Cause: UMDF/IddCx version mismatch Solution: Verify WDK version matches project requirements (IddCx 1.10)

Post-build event failed

Symptom: copy "..\vdd_settings.xml" failed Cause: vdd_settings.xml not found Solution: Ensure vdd_settings.xml exists in the parent directory

Advanced Build Options

Building All Platforms

To build all platform configurations:
msbuild MttVDD.sln /p:Configuration=Release /p:Platform=x64
msbuild MttVDD.sln /p:Configuration=Release /p:Platform=ARM64
msbuild MttVDD.sln /p:Configuration=Release /p:Platform=Win32

Clean Build

Force a complete rebuild:
msbuild MttVDD.sln /t:Clean /p:Configuration=Release /p:Platform=x64
msbuild MttVDD.sln /t:Rebuild /p:Configuration=Release /p:Platform=x64

Verbose Build Output

For detailed build diagnostics:
msbuild MttVDD.sln /p:Configuration=Debug /p:Platform=x64 /v:detailed

Testing the Build

Verify Build Artifacts

After building, verify:
dir "Virtual Display Driver (HDR)\MttVDD\x64\Release\MttVDD"
Expected files:
  • MttVDD.dll (~200-300 KB)
  • MttVDD.inf
  • MttVDD.cat
  • vdd_settings.xml

Check Driver Properties

Right-click MttVDD.dll → Properties → Details:
  • File version should match your build
  • Product name: “Virtual Display Driver”
Do NOT install unsigned or improperly signed drivers on production systems. See Driver Signing before installation.

Next Steps

Driver Signing

Sign your driver for installation and testing

Testing

Safely test your custom driver build

Building Additional Components

GetIddCx Utility

To build the IddCx version query tool:
  1. Navigate to Virtual Display Driver (HDR)/GetIddCx/
  2. Open the project or build from command line
  3. This utility helps identify installed IddCx versions

Community Scripts

PowerShell scripts in Community Scripts/ don’t require building but may be useful for:
  • Automated driver installation
  • Display configuration
  • Testing utilities
See the Community Scripts README for details.

Continuous Integration

For automated builds, see the GitHub Actions workflows in .github/workflows/ for examples of CI/CD configuration.

Additional Resources

Build docs developers (and LLMs) love