2.9 KiB
DisplayFlow IDD Driver Integration Guide
Overview
To achieve a true "Virtual Display" (where Windows thinks a monitor is connected but it's just software), we need to compile and install a User-Mode Driver Framework (UMDF) Indirect Display Driver (IDD).
We will use the Microsoft Indirect Display Driver Sample as a base and modify it to send frames to our shared memory.
Prerequisites
- Visual Studio 2019/2022 with "Desktop development with C++".
- Windows Driver Kit (WDK) compatible with your VS version.
Steps
1. Download the Sample
Clone the Windows Driver Samples repository:
git clone https://github.com/microsoft/Windows-driver-samples.git
cd video/IndirectDisplay/IddCxMonitorDriver
2. Integrate DisplayFlow Code
Copy the following files from demo/windows_driver/src/ to the driver project folder (IddCxMonitorDriver):
IddProducer.hIddProducer.cpp
3. Modify Project Settings
- Open the solution
IddCxMonitorDriver.slnin Visual Studio. - Right-click project -> Add -> Existing Item -> Select
IddProducer.handIddProducer.cpp. - Ensure
IddProducer.cppis not using precompiled headers (Right-click file -> Properties -> C/C++ -> Precompiled Headers -> Not Using Precompiled Headers).
4. Modify IndirectDevice.cpp (or SwapChainProcessor.cpp)
Find the logic where the driver processes frames. In the sample, this is typically in the SwapChainProcessor class (or inside IndirectDevice::Run).
-
Include Header:
#include "IddProducer.h" -
Add Member: Add
IddProducer m_Producer;to the class that handles the swap chain. -
Initialize: In the initialization phase (before the loop):
m_Producer.Initialize(); -
Process Frame: Inside the frame loop, after acquiring the
ID3D11Texture2D*(Surface), map it and submit it.- Note: The surface from
IddCxis usually not CPU readable. You must copy it to a Staging Texture first. - Refer to
demo/windows_driver/src/SwapChainProcessor_Example.cppfor the logic.
- Note: The surface from
5. Build and Install
- Build the solution (Platform: x64, Configuration: Release).
- Locate the output files (
.dll,.inf,.cat). - Install Certificate: The driver is self-signed. You must install the test certificate to
Trusted Root Certification AuthoritiesandTrusted Publishers. - Install Driver:
- Open Device Manager.
- Action -> Add legacy hardware.
- Install from Disk -> Point to
.inffile. - Select "IddCx Monitor Driver".
6. Verification
Once installed, Windows should show a new display. DisplayFlow sender (Consumer) should automatically pick up the frames from the Shared Memory (if running with --source=idd).