Driver Internals
zerovdd.dll is a #![no_std] + alloc UMDF 2.33 / IddCx 1.10 Indirect Display Driver engineered to pass Universal Driver (InfVerif /u /h /w, ApiValidator) checks with zero panics and zero idle wakeups.
Universal DIRID 13 INF & Class=Display Coexistence
Section titled “Universal DIRID 13 INF & Class=Display Coexistence”driver-wdk/zerovdd.inf targets Windows 11 22H2+ (NTamd64.10.0...22621 / NTarm64.10.0...22621) with:
Class = Display,ClassVer = 2.0,PnpLockdown = 1DestinationDirs = 13(Driver Store isolation; zero files copied intoSystem32\drivers)UpperFilters = IndirectKmdUmdfLibraryVersion = 2.33.0,UmdfExtensions = IddCx0102
The INF intentionally omits restrictive HKR,,Security overrides on the Class=Display PnP FDO so DWM, DXGI, and non-admin games can open the display adapter normally.
DeviceInterface + \ZeroVddControl Security Gate
Section titled “DeviceInterface + \ZeroVddControl Security Gate”In UMDF 2.33, WdfControlDeviceInitAllocate is KMDF-only. Rather than weakening Class=Display ACLs or granting Everyone (WD) access to privileged IOCTLs, zerovdd-driver isolates control traffic using a dedicated WDF DeviceInterface with a ReferenceString:
evt_driver_device_addcallsWdfDeviceCreateDeviceInterfacewithZEROVDD_CONTROL_INTERFACE_GUID({2963AE53-4CF3-4385-929A-A8348595217E}) andReferenceString = "ZeroVddControl"(no bare DOS symbolic link, because a bare symlink delivers an emptyFileObject->FileName).WdfDeviceInitSetFileObjectConfigattaches per-handleFileContext { is_control, authorized, cleaned_up, in_flight_ioctls }withevt_device_file_create,evt_file_cleanup, andevt_file_close.- On open:
- Non-control opens (empty filename from Display/DXGI/DWM) record
is_control = false; authorized = falseand returnSTATUS_SUCCESS. - Control opens (
\ZeroVddControl) verifyKernelModeor impersonate the caller (WdfRequestImpersonate(SecurityImpersonation)) and check membership inNT AUTHORITY\SYSTEMorBUILTIN\Administrators. Unprivileged callers fail withSTATUS_ACCESS_DENIED.
- Non-control opens (empty filename from Display/DXGI/DWM) record
evt_iddcx_device_io_controlvalidatesis_control && authorized && !cleaned_upbefore dispatching tozerovdd-engine.evt_file_cleanupremoves every handle-bound monitor owned by that handle’sFileKey, preventing ghost monitors if a client process crashes without callingIOCTL_REMOVE_DISPLAY.
Re-Entrancy-Safe Pending -> Active Monitor Registry
Section titled “Re-Entrancy-Safe Pending -> Active Monitor Registry”IddCxMonitorArrival synchronously invokes EvtIddCxParseMonitorDescription2 on the calling thread before returning. Holding a registry mutex across IddCxMonitorArrival would deadlock. zerovdd-engine eliminates lock inversion with a two-phase slot protocol:
- Under lock, allocate a free connector slot and insert
SlotPhase::PendingholdingArc<MonitorSpec>(synthesized or validated custom EDID + precomputed CVT-RBv2 modes). - Drop the lock, call
IddCxMonitorCreate, then callIddCxMonitorArrival. - Synchronous
ParseMonitorDescription2andMonitorQueryTargetModes2callbacks acquire the lock briefly, cloneArc<MonitorSpec>(matchingPendingorActive), and release the lock immediately. - Once
IddCxMonitorArrivalreturns, re-acquire the lock:- On success, promote
Pending -> Active { adapter_luid, target_id }. - On failure, atomically roll back the slot and delete the entry so zero ghost monitors or leaked connector slots remain.
- On success, promote
The registry also guarantees idempotent MonitorGuid reconnects, D0/D3 AdapterState idempotency (IddCxAdapterInitAsync executes once across sleep/resume), and a PendingGpuSwitch circuit breaker (max_attempts) preventing infinite abandon loops on invalid render adapter LUIDs.
Device-Scoped D3D11, Zero-Polling Swapchains & HW Cursor
Section titled “Device-Scoped D3D11, Zero-Polling Swapchains & HW Cursor”- Device-scoped
D3D11DeviceManager(d3d.rs): Lives inside the WDF device context and drops inEvtDeviceReleaseHardware(never inside astaticglobal destroyed under Loader Lock duringDLL_PROCESS_DETACH). CachesID3D11Deviceper adapter LUID, skips WARP software adapters, validatesGetDeviceRemovedReason() == S_OKandIDXGIFactory1::IsCurrent(), and recovers cleanly on TDR (DXGI_ERROR_DEVICE_REMOVED,DXGI_ERROR_DEVICE_RESET,DXGI_ERROR_ACCESS_LOST). - Zero-polling
SwapChainWorker(swapchain.rs): Each assigned swapchain runs an MMCSS"DisplayPostProcessing"worker thread waiting onWaitForMultipleObjects([terminate_event, available_buffer_event], INFINITE)(zero idle polling wakeups;terminate_eventat index0plus a pre-acquire non-blocking check ensures prompt exit under heavy load). An RAIISwapChainGuardexecutesWdfObjectDelete(hSwapChain)on every exit path, andEvtIddCxMonitorUnassignSwapChainjoins the thread synchronously before returning. - Unnamed hardware cursor (
cursor.rs):HardwareCursorHandleallocates an unnamed auto-reset Win32 event closed onDrop, eliminating handle leaks and cross-monitor name collisions, draining shapes viaIddCxMonitorQueryHardwareCursor3/2/1. - Structured ETW TraceLogging (
etw.rs): ProviderZeroVdd.Driver({06714745-69DC-41FF-9684-C532D5183A74}) emits non-blocking diagnostics without pipe or file-I/O deadlocks.