| Previous | Next |
| ERROR_ALREADY_WIN32 | ERROR_NO_YIELD_PERFORMED |
ERROR_IMAGE_MACHINE_TYPE_MISMATCH_EXE
An executable image targets a different processor architecture
ERROR_IMAGE_MACHINE_TYPE_MISMATCH_EXE corresponds to Win32 error value documented as: {Machine Type Mismatch} The image file %hs is valid, but is for a machine type other than the current machine. The file is structurally valid but its machine type cannot be executed by the current process or operating environment. Typical examples are trying to start an ARM64 image on x64 without suitable emulation or loading an x64 helper from a 32-bit-only environment.
Where the result appears in real systems
- CreateProcess and loader startup.
- Installers selecting architecture-specific binaries.
- Launchers extracting the wrong payload.
- Recovery environments with limited architecture support.
Evidence to collect before changing the system
inspect the PE Machine field with dumpbin /headers or another PE parser; record OS architecture, process architecture, and file path; verify that redirects and package selection did not substitute another binary
Keep the original numeric value, symbolic name, API return path, thread and process identity, and the exact timestamp in one diagnostic record. Those fields prevent later layers from replacing this specific result with a generic failure and make correlation with ETW or Event Viewer practical.
Handling and recovery
Install or select the build matching the target architecture. A launcher should choose payloads from reliable architecture detection and should validate the PE header before attempting execution.
Code that receives this result should classify it according to the operation that produced it: completion information, a recoverable environmental condition, or a programming defect. The result classification should be made at the API boundary where the caller still knows the handle, object, flags, and expected state.
What not to infer from this code
The EXE-specific result concerns the main executable. ERROR_BAD_EXE_FORMAT can instead indicate broader corruption or an unsupported image format, while DLL mismatch errors arise during dependency loading.
Implementation guidance
Preserve this result through logging and telemetry instead of immediately converting it to free-form text. When it crosses an HRESULT boundary, record both the original Win32 value and the converted HRESULT; when it crosses RPC, JSON, or another protocol, include an explicit error-domain field so the receiver does not convert it twice.
A useful automated test for this Win32 error should reproduce the relevant state transition, assert the exact returned value, and verify cleanup after both the normal and exceptional path. The test for this Win32 error should also check that a retry is performed only when the underlying state can genuinely change, because unconditional retries often hide ownership, architecture, power, or resource-negotiation defects.
References
Looking for a different code? Search another status or error code.