Detect x86_64 process in Windows 10 ARM64 OS #8991
Replies: 5 comments 14 replies
-
@jeremyd2019 Here is the sample code. typedef enum _MACHINE_ATTRIBUTES
{
UserEnabled = 1,
KernelEnabled = 2,
Wow64Container = 4,
} MACHINE_ATTRIBUTES, * PMACHINE_ATTRIBUTES;
typedef struct _PROCESS_MACHINE_INFORMATION
{
/* 0x0000 */ USHORT ProcessMachine;
/* 0x0002 */ USHORT Res0;
/* 0x0004 */ MACHINE_ATTRIBUTES MachineAttributes;
} PROCESS_MACHINE_INFORMATION, * PPROCESS_MACHINE_INFORMATION; /* size: 0x0008 */
int main()
{
#define ProcessMachineTypeInfo 9
PROCESS_MACHINE_INFORMATION buf;
memset(&buf, 0, sizeof buf);
BOOL ret = GetProcessInformation(-1, ProcessMachineTypeInfo, &buf, sizeof buf);
printf("ret: %d\n", ret);
printf("ProcessMachine: 0x%x\n", buf.ProcessMachine);
printf("Res0: 0x%x\n", buf.Res0);
printf("MachineAttributes: %d\n", buf.MachineAttributes);
return 0;
} Here is the output in Windows 10 ARM64 machine (tiny Rpi4)
Please reply on different line. GitHub seems to hide many nested discussion. |
Beta Was this translation helpful? Give feedback.
-
Sweet, that's exactly what I want to know. Do you happen to know the minimum Windows version of that call (or I guess If you put that on my Q&A question I can give you the answer points (if you are on there and care about such things) |
Beta Was this translation helpful? Give feedback.
-
So it looks like the way to go is, if |
Beta Was this translation helpful? Give feedback.
-
There is another way to detect with NtQuerySystemInformationEx(SystemSupportedProcessorArchitectures, ...) but that code will be overwhelming for this little goal. It returns an array of SYSTEM_SUPPORTED_PROCESSOR_ARCHITECTURES_INFORMATION structure. The first one is native and rest is the supported architecture. I will contribute the code to ProcessHacker and let you know the details. |
Beta Was this translation helpful? Give feedback.
-
Is it possible to use autoload in cygwin to get those APIs instead of GetProcAddress? Just asking. |
Beta Was this translation helpful? Give feedback.
-
How to detect x86_64 process in Windows ARM64 OS? Extending discussion from msys2/msys2-runtime#47
Beta Was this translation helpful? Give feedback.
All reactions