pub enum Arch {
X86_64,
I386,
Aarch64,
}Expand description
The architecture of the program a process runs, which is that of its main executable.
Wine itself, the unix side with ntdll.so and this library, is built for
arm64 and runs natively; x86 code is emulated inside the process.
Variants§
X86_64
A 64-bit x86 program. It runs in an ARM64EC process with its x86 code emulated.
I386
A 32-bit x86 program, run through wow64 with its x86 code emulated.
Aarch64
A native ARM64 program.
Implementations§
Source§impl Arch
impl Arch
Sourcepub const fn pe_dir(self) -> &'static str
pub const fn pe_dir(self) -> &'static str
The <arch>-windows builtin directory name. The builtins of an
x86_64 process load from aarch64-windows, as upstream Wine does on
an arm64 host: they are ARM64X modules that serve the process’s
ARM64EC side.
Sourcepub const fn of_process(wow64: bool, machine: Option<u16>) -> Self
pub const fn of_process(wow64: bool, machine: Option<u16>) -> Self
The arch of the current process. wow64 says whether it is a wow64
(32-bit) process; machine is the Machine field of its main image’s
COFF header, when it could be read.
The bundle only runs x86 programs under wow64, so a wow64 process is
i386. A 64-bit process is always native from Wine’s side (ARM64EC for
an x86_64 program), so the main image decides:
IMAGE_FILE_MACHINE_ARM64 is a native ARM64 program, and anything
else, an unreadable header included, counts as x86_64. An ARM64EC
executable carries the AMD64 machine in its header and so also counts
as x86_64, which is what it presents itself as.