https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-disablethreadlibrarycalls
use windows::Win32::System::LibraryLoader::{DisableThreadLibraryCalls, GetModuleFileNameW}; pub extern "C" fn DllMain(hmodule: HMODULE, reason: u32) -> bool { // Check if we're attaching to the game if reason != 1 { return true; } unsafe { // SAFETY: Idk man DisableThreadLibraryCalls(hmodule).expect("Could not disable thread library calls"); } }
Injecting a Rust-made DLL containing this code into ELDEN RING causes a crash due to the following:
2025-08-22T05:03:10.324691Z ERROR tracing_panic: A panic occurred panic.payload="Could not disable thread library calls: Error { code: HRESULT(0x8007007E), message: "Module not found." }" panic.location="src\lib.rs:92:44" panic.backtrace=disabled backtrace panic.note="run with RUST_BACKTRACE=1 environment variable to display a backtrace"
Happens when running ELDEN RING via the default version of Proton on a Steam Deck.
The API bindings are from the official Microsoft windows crate.
Hello @ividyon, it's not really clear what the intent is behind your tinkering. This doesn't look like a bug for a Proton dev to ponder.
Closing as invalid.
0x8007007e
https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-disablethreadlibrarycalls
Injecting a Rust-made DLL containing this code into ELDEN RING causes a crash due to the following:
Happens when running ELDEN RING via the default version of Proton on a Steam Deck.
The API bindings are from the official Microsoft windows crate.