IsWow64Process2 function (wow64apiset.h)

Determines whether the specified process is running under WOW64; also returns additional machine process and architecture information.

Syntax

BOOL IsWow64Process2(
  [in]            HANDLE hProcess,
  [out]           USHORT *pProcessMachine,
  [out, optional] USHORT *pNativeMachine
);

Parameters

[in] hProcess

A handle to the process. The handle must have the PROCESS_QUERY_INFORMATION or PROCESS_QUERY_LIMITED_INFORMATION access right. For more information, see Process Security and Access Rights.

[out] pProcessMachine

On success, returns a pointer to an IMAGE_FILE_MACHINE_* value. The value will be IMAGE_FILE_MACHINE_UNKNOWN if the target process is not a WOW64 process; otherwise, it will identify the type of WoW process.

[out, optional] pNativeMachine

On success, returns a pointer to a possible IMAGE_FILE_MACHINE_* value identifying the native architecture of host system.

Return value

If the function succeeds, the return value is a nonzero value.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

IsWow64Process2 provides an improved direct replacement for IsWow64Process. In addition to determining if the specified process is running under WOW64, IsWow64Process2 returns the following information:

  • Whether the target process, specified by hProcess, is running under Wow or not.
  • The architecture of the target process.
  • Optionally, the architecture of the host system.

Requirements

Requirement Value
Minimum supported client Windows 10, version 1709 [desktop apps | UWP apps]
Minimum supported server Windows Server 2016, version 1709 [desktop apps | UWP apps]
Target Platform Windows
Header wow64apiset.h
Library Kernel32.lib
DLL Kernel32.dll