Commit 12c90b04 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Support querying the Wow64 state of other processes.

parent 6056e8a5
......@@ -71,6 +71,7 @@ extern void virtual_init_threading(void);
/* server support */
extern timeout_t server_start_time;
extern unsigned int server_cpus;
extern int is_wow64;
extern void server_init_process(void);
extern NTSTATUS server_init_process_done(void);
......
......@@ -307,7 +307,19 @@ NTSTATUS WINAPI NtQueryInformationProcess(
case ProcessWow64Information:
if (ProcessInformationLength == sizeof(DWORD))
{
*(DWORD *)ProcessInformation = is_wow64;
DWORD val = 0;
if (ProcessHandle == GetCurrentProcess()) val = is_wow64;
else if (server_cpus & (1 << CPU_x86_64))
{
SERVER_START_REQ( get_process_info )
{
req->handle = wine_server_obj_handle( ProcessHandle );
if (!(ret = wine_server_call( req ))) val = (reply->cpu != CPU_x86_64);
}
SERVER_END_REQ;
}
*(DWORD *)ProcessInformation = val;
len = sizeof(DWORD);
}
else ret = STATUS_INFO_LENGTH_MISMATCH;
......
......@@ -94,7 +94,7 @@ static const enum cpu_type client_cpu = CPU_SPARC;
#error Unsupported CPU
#endif
static unsigned int server_cpus;
unsigned int server_cpus = 0;
int is_wow64 = FALSE;
#ifndef HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment