windows: Map EXE_MACHINE_TYPE_MISMATCH to InvalidExe

Seems to happen if the command trying to be executed has the extension .exe and it's an invalid executable.
This commit is contained in:
Ryan Liptak 2022-12-18 02:24:32 -08:00
parent 6e22b63edb
commit 3ee8c49582

View File

@ -1624,6 +1624,9 @@ pub fn CreateProcessW(
.RING2SEG_MUST_BE_MOVABLE,
.RELOC_CHAIN_XEEDS_SEGLIM,
.INFLOOP_IN_RELOC_CHAIN, // MAX_EXEC_ERROR in errno.cpp
// This one is not mapped to ENOEXEC but it is possible, for example
// when calling CreateProcessW on a plain text file with a .exe extension
.EXE_MACHINE_TYPE_MISMATCH,
=> return error.InvalidExe,
else => |err| return unexpectedError(err),
}