feat(windows-drivers): pf-vdisplay STEP 2 — IddCx device skeleton

DriverEntry -> driver_add builds the full IDD_CX_CLIENT_CONFIG (14 IddCx callbacks +
PnP EvtDeviceD0Entry, all stubs with correct PFN signatures) sized via the ported
IDD_STRUCTURE_SIZE! (size.rs), runs IddCxDeviceInitConfig -> WdfDeviceCreate ->
WdfDeviceCreateDeviceInterface(the owned pf-vdisplay GUID, not SudoVDA) ->
IddCxDeviceInitialize. callbacks.rs has all 14 + device_d0_entry; query_target_info
implements HIGH_COLOR_SPACE. edid.rs salvaged verbatim from the oracle. proto gains
interface_guid_fields() (u128 -> Windows GUID fields). Links IddCxStub (the CI gate);
adapter/monitor/swapchain/IDD-push fill the stubs in STEP 3-6.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-24 16:12:20 +00:00
parent 990837fb8f
commit d36fe60ea5
7 changed files with 480 additions and 65 deletions
+36 -4
View File
@@ -1,6 +1,38 @@
//! Emits the WDK link flags for the cdylib (wdk-build). STEP 0 needs only the WDF stub link + the
//! `/INTEGRITYCHECK` that the CI step clears; `IddCxStub` (+ `IddMinimumVersionRequired`) is added in
//! STEP 2 when the driver actually calls IddCx — see wdk-probe/build.rs for the glob recipe.
//! WDK link flags for the cdylib (wdk-build) + `IddCxStub` (the driver calls IddCx DDIs via wdk-iddcx,
//! and exports `IddMinimumVersionRequired`). `/INTEGRITYCHECK` (set by wdk-build) is cleared by the CI
//! packaging step. Glob recipe matches wdk-probe/build.rs.
fn main() -> Result<(), wdk_build::ConfigError> {
wdk_build::configure_wdk_binary_build()
wdk_build::configure_wdk_binary_build()?;
link_iddcx_stub();
Ok(())
}
/// Link `IddCxStub.lib`. It ships only under the SDK *version* that includes IddCx, at
/// `Lib\<ver>\um\<arch>\iddcx\<iddcxver>\` — a newer base SDK alongside it lacks the `iddcx` subdir, so
/// glob for the dir that actually contains the lib rather than trusting the max SDK version. x64 only.
fn link_iddcx_stub() {
const ARCH: &str = "x64";
const ROOTS: [&str; 2] = [
r"C:\Program Files (x86)\Windows Kits\10\Lib",
r"C:\Program Files\Windows Kits\10\Lib",
];
for root in ROOTS {
let Ok(versions) = std::fs::read_dir(root) else {
continue;
};
for ver in versions.flatten() {
let iddcx = ver.path().join("um").join(ARCH).join("iddcx");
let Ok(subdirs) = std::fs::read_dir(&iddcx) else {
continue;
};
for sub in subdirs.flatten() {
if sub.path().join("IddCxStub.lib").is_file() {
println!("cargo:rustc-link-search={}", sub.path().display());
println!("cargo:rustc-link-lib=static=IddCxStub");
return;
}
}
}
}
panic!("IddCxStub.lib not found under any Windows Kits Lib\\<ver>\\um\\{ARCH}\\iddcx\\<iddcxver>\\");
}