ntdll: Support querying the Wow64 state of other processes.

This commit is contained in:
Alexandre Julliard 2009-07-07 11:38:19 +02:00
parent 6056e8a52b
commit 12c90b04dc
3 changed files with 15 additions and 2 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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