fix(windows-drivers): size_of config size (1.0 IddCxStub lacks the version table) + CI builds pf-vdisplay
apple / swift (push) Failing after 2s
apple / screenshots (push) Has been skipped
windows-drivers / probe-and-proto (push) Successful in 19s
windows-drivers / driver-build (push) Successful in 1m5s
windows-host / package (push) Successful in 5m24s
android / android (push) Successful in 3m43s
ci / web (push) Successful in 47s
ci / docs-site (push) Successful in 1m4s
ci / rust (push) Successful in 4m21s
deb / build-publish (push) Successful in 2m14s
decky / build-publish (push) Successful in 11s
docker / build-push (--build-arg FEDORA_VERSION=44, ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora44-rpm) (push) Successful in 5s
docker / build-push (., web/Dockerfile, punktfunk-web) (push) Successful in 4s
docker / build-push (ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora-rpm) (push) Successful in 3s
docker / build-push (ci, ci/rust-ci.Dockerfile, punktfunk-rust-ci) (push) Successful in 4s
docker / build-push (docs-site, docs-site/Dockerfile, punktfunk-docs) (push) Successful in 4s
ci / bench (push) Successful in 4m39s
rpm / build-publish (bazzite, punktfunk-fedora-rpm) (push) Successful in 8m31s
rpm / build-publish (fedora-44, punktfunk-fedora44-rpm) (push) Successful in 8m16s
docker / deploy-docs (push) Successful in 17s

The versioned IDD_STRUCTURE_SIZE path referenced IddClientVersionHigherThanFramework/
IddStructureCount/IddStructures — LNK2019 unresolved, because the WDK links the iddcx
1.0 IddCxStub which lacks those (they are >=1.4). We target 1.10 against a current
framework (higher==false) where size_of is exactly the versioned result, so use it
directly (the surface-assert refs linked only because they were DCE-eliminated).
pf-vdisplay now COMPILES + LINKS IddCxStub on the box (263,680B). Point
windows-drivers.yml at the whole workspace + clear FORCE_INTEGRITY on pf_vdisplay.dll;
drop the obsolete UINT diagnostic dump.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-24 16:16:22 +00:00
parent 4f10f3439d
commit d0d31b1040
3 changed files with 22 additions and 49 deletions
@@ -11,6 +11,7 @@
#![allow(non_snake_case, clippy::missing_safety_doc)]
mod callbacks;
#[allow(dead_code)] // salvaged verbatim; wired into the mode callbacks in STEP 4
mod edid;
mod entry;
mod size;
@@ -1,30 +1,19 @@
//! Versioned IddCx struct sizing — the oracle's `IDD_STRUCTURE_SIZE!` ported to wdk-sys.
//! `.Size` for `IDD_CX_CLIENT_CONFIG`.
//!
//! IddCx structs are versioned: if the running framework is OLDER than the (1.10) headers we built
//! against, our locally-compiled struct may be LARGER than the framework understands, so `.Size` must
//! come from the framework's own size table (`IddStructures[INDEX_<struct>]`), not `size_of`. `None`
//! means the struct is unusable on this framework. When the framework is at least our version,
//! `size_of` is correct. (wdk-sys uses ModuleConsts: `_IDDSTRUCTENUM::INDEX_*`, not the oracle's
//! NewType `.0`.)
//! The oracle uses a *versioned* size — `IddStructures[INDEX]` when the running framework is OLDER than
//! the (1.10) headers we built against (`IddClientVersionHigherThanFramework != 0`). That machinery
//! (`IddClientVersionHigherThanFramework` / `IddStructureCount` / `IddStructures`) only exists in the
//! iddcx ≥1.4 `IddCxStub`; the WDK on the runner/box links the **1.0** stub (the only `IddCxStub.lib`
//! present), which does NOT export those symbols — referencing them is an LNK2019. We target IddCx 1.10
//! against a current framework (framework ≥ client ⇒ `higher == false`), where `size_of` is exactly what
//! the versioned path returns. So use `size_of` directly. (Revisit the versioned path — with a ≥1.4
//! `IddCxStub` linked — only if pre-1.10 Windows must ever be supported, which the punktfunk Windows
//! host does not target.)
use wdk_sys::iddcx;
/// Correct `.Size` for `IDD_CX_CLIENT_CONFIG`, or `None` if it can't be used on this framework.
/// Correct `.Size` for `IDD_CX_CLIENT_CONFIG` on a framework at least as new as our headers.
#[must_use]
pub fn idd_cx_client_config_size() -> Option<u32> {
// SAFETY: read-only access to the stub-provided framework globals.
let higher = unsafe { (&raw const iddcx::IddClientVersionHigherThanFramework).read() } != 0;
if !higher {
return u32::try_from(core::mem::size_of::<iddcx::IDD_CX_CLIENT_CONFIG>()).ok();
}
// SAFETY: read-only.
let count = unsafe { (&raw const iddcx::IddStructureCount).read() };
let index = iddcx::_IDDSTRUCTENUM::INDEX_IDD_CX_CLIENT_CONFIG as u32;
if index >= count {
return None; // struct cannot be used on this (older) framework
}
// SAFETY: `IddStructures` is the framework's size table; `index` is validated `< count`.
let table = unsafe { (&raw const iddcx::IddStructures).read() };
let size = unsafe { table.add(index as usize).read() };
u32::try_from(size).ok()
u32::try_from(core::mem::size_of::<iddcx::IDD_CX_CLIENT_CONFIG>()).ok()
}