From f34e956818e2820d6aa3c69abf4685e36f94a53d Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Wed, 24 Jun 2026 14:40:25 +0000 Subject: [PATCH] fix(windows-drivers): emit OPM struct tags + D3DCOLORVALUE + shim UINT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DXGI resolved. Remaining iddcx type gaps: OPM typedefs need their _OPM_* struct tags too (recursively(false) drops them), D3DCOLORVALUE (an OPM field), and UINT (unsigned int — absent from crate::types, and allowlist_type does not emit bare primitive aliases). Broaden to _?OPM_.* + _?D3DCOLORVALUE and raw_line the UINT alias. Co-Authored-By: Claude Opus 4.8 (1M context) --- packaging/windows/drivers/vendor/wdk-sys/build.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packaging/windows/drivers/vendor/wdk-sys/build.rs b/packaging/windows/drivers/vendor/wdk-sys/build.rs index b4defa1..b4b6964 100644 --- a/packaging/windows/drivers/vendor/wdk-sys/build.rs +++ b/packaging/windows/drivers/vendor/wdk-sys/build.rs @@ -375,8 +375,14 @@ fn generate_iddcx(out_path: &Path, config: &Config) -> Result<(), ConfigError> { // missing), so this stays type-identical for the WDF surface. .allowlist_type("DXGI_.*") .allowlist_type("IDXGI.*") - .allowlist_type("OPM_.*") - .allowlist_type("UINT") + // OPM types are `typedef struct _OPM_X {..} OPM_X` — allowlist BOTH the tag and the typedef + // (allowlist_recursively(false) won't pull the tag in from the typedef). Plus D3DCOLORVALUE, + // referenced by an OPM struct. + .allowlist_type("_?OPM_.*") + .allowlist_type("_?D3DCOLORVALUE") + // `UINT` is `unsigned int`; wdk-sys never references it so it's absent from crate::types and + // allowlist_type won't emit a bare primitive alias. Shim it (unambiguous on Windows). + .raw_line("pub type UINT = ::core::ffi::c_uint;") }; trace!(bindgen_builder = ?bindgen_builder);