#224·Detours

Improve failure mode if `DetourCreateProcessWithDllEx` is supplied with a DLL of wrong bitness

Author: criemenCreated Jan 17, 2022Updated Nov 6, 2025
Labelsbug

Describe the bug When using DetourCreateProcessWithDllEx from a 32-bit process to create a new process, while pointing lpDllName at a 64-bit DLL, strange failures occur.

I assumed that, because DetourCreateProcessWithDllEx auto-chooses the correct bitness for injection, I'd be safe to always pass the 64-bit DLL name into it. However, that's not true (and a close read of the documentation confirms this). Still, it would be great to either warn in the documentation about this, and/or improve the handling of this in DetourCreateProcessWithDllEx - either also auto-choose the correct bitness if parent-bitness==child-bitness, or return an error.

Detours version https://github.com/microsoft/Detours/commit/66d6f2d34aba564d373083621cacf66ec51199b2