authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2022-12-18 02:24:32-08:00
committergravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2022-12-18 02:31:34-08:00
log3ee8c4958259efa07968818ae62ba6078e319d1b
tree3a09fd0d3e72d776d655d5cd4ea14403f066db60
parent6e22b63edb8f87144b93dfd593e162f7c4129e8e

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.

1 files changed, 3 insertions(+), 0 deletions(-)

lib/std/os/windows.zig+3
......@@ -1624,6 +1624,9 @@ pub fn CreateProcessW(
16241624 .RING2SEG_MUST_BE_MOVABLE,
16251625 .RELOC_CHAIN_XEEDS_SEGLIM,
16261626 .INFLOOP_IN_RELOC_CHAIN, // MAX_EXEC_ERROR in errno.cpp
1627 // This one is not mapped to ENOEXEC but it is possible, for example
1628 // when calling CreateProcessW on a plain text file with a .exe extension
1629 .EXE_MACHINE_TYPE_MISMATCH,
16271630 => return error.InvalidExe,
16281631 else => |err| return unexpectedError(err),
16291632 }