From 02d1302ea0e22db7fec4832fe14219eba706fe47 Mon Sep 17 00:00:00 2001 From: ivall Date: Mon, 23 Nov 2026 12:25:21 +0100 Subject: [PATCH] GameInput: refused QueryInterface IIDs are logged MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #100 answers only the v0 interfaces' IIDs (and IUnknown); before, any IID got the object. A title built against a newer GameInput would ask for its interfaces this way – one line per refused IID (16 at most) shows it. --- crates/xcl/src/hle/gameinput.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/xcl/src/hle/gameinput.rs b/crates/xcl/src/hle/gameinput.rs index a9509fe..402d4c7 100644 --- a/crates/xcl/src/hle/gameinput.rs +++ b/crates/xcl/src/hle/gameinput.rs @@ -537,6 +537,18 @@ unsafe fn qi_for(this: *mut c_void, iid: *const GUID, out: *mut *mut c_void, own *out = this; return S_OK; } + if !iid.is_null() { + // refused interfaces are worth a line each (a title built for a newer GameInput asks + // for its interfaces this way – before #100 it got the v0 object for any IID) + static SEEN: Mutex> = Mutex::new(Vec::new()); + let i = &*iid; + let g = (i.data1 as u128) << 96 | (i.data2 as u128) << 80 | (i.data3 as u128) << 64 | u64::from_be_bytes(i.data4) as u128; + let mut seen = SEEN.lock().unwrap_or_else(|e| e.into_inner()); + if !seen.contains(&g) && seen.len() < 16 { + seen.push(g); + crate::xlog_warn!("GameInput: QueryInterface({g:032x}) refused (E_NOINTERFACE)"); + } + } *out = std::ptr::null_mut(); E_NOINTERFACE }