ntdll: Add management of the Wow64 filesystem redirection flag.

This commit is contained in:
Alexandre Julliard 2009-07-06 15:08:39 +02:00
parent 4f8ce1b2f2
commit 747d58d211
6 changed files with 39 additions and 9 deletions

View File

@ -2129,6 +2129,29 @@ done:
}
/******************************************************************
* RtlWow64EnableFsRedirection (NTDLL.@)
*/
NTSTATUS WINAPI RtlWow64EnableFsRedirection( BOOLEAN enable )
{
if (!is_wow64) return STATUS_NOT_IMPLEMENTED;
ntdll_get_thread_data()->wow64_redir = enable;
return STATUS_SUCCESS;
}
/******************************************************************
* RtlWow64EnableFsRedirectionEx (NTDLL.@)
*/
NTSTATUS WINAPI RtlWow64EnableFsRedirectionEx( ULONG enable, ULONG *old_value )
{
if (!is_wow64) return STATUS_NOT_IMPLEMENTED;
*old_value = ntdll_get_thread_data()->wow64_redir;
ntdll_get_thread_data()->wow64_redir = enable;
return STATUS_SUCCESS;
}
/******************************************************************
* RtlDoesFileExists_U (NTDLL.@)
*/

View File

@ -913,6 +913,8 @@
@ stdcall -arch=x86_64 RtlVirtualUnwind(long long long ptr ptr ptr ptr ptr)
@ stub RtlWalkFrameChain
@ stdcall RtlWalkHeap(long ptr)
@ stdcall RtlWow64EnableFsRedirection(long)
@ stdcall RtlWow64EnableFsRedirectionEx(long ptr)
@ stub RtlWriteMemoryStream
@ stdcall RtlWriteRegistryValue(long ptr ptr long ptr long)
@ stub RtlZeroHeap

View File

@ -71,7 +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);
extern size_t server_init_thread( void *entry_point );
@ -198,8 +198,9 @@ struct ntdll_thread_data
int request_fd; /* 1e0/310 fd for sending server requests */
int reply_fd; /* 1e4/314 fd for receiving server replies */
int wait_fd[2]; /* 1e8/318 fd for sleeping server requests */
void *vm86_ptr; /* 1f0/320 data for vm86 mode */
pthread_t pthread_id; /* 1f4/328 pthread thread id */
BOOL wow64_redir; /* 1f0/320 Wow64 filesystem redirection flag */
void *vm86_ptr; /* 1f4/328 data for vm86 mode */
pthread_t pthread_id; /* 1f8/330 pthread thread id */
};
static inline struct ntdll_thread_data *ntdll_get_thread_data(void)

View File

@ -307,11 +307,7 @@ NTSTATUS WINAPI NtQueryInformationProcess(
case ProcessWow64Information:
if (ProcessInformationLength == sizeof(DWORD))
{
#ifdef __i386__
*(DWORD *)ProcessInformation = (server_cpus & (1 << CPU_x86_64)) != 0;
#else
*(DWORD *)ProcessInformation = FALSE;
#endif
*(DWORD *)ProcessInformation = is_wow64;
len = sizeof(DWORD);
}
else ret = STATUS_INFO_LENGTH_MISMATCH;

View File

@ -94,7 +94,8 @@ static const enum cpu_type client_cpu = CPU_SPARC;
#error Unsupported CPU
#endif
unsigned int server_cpus = 0;
static unsigned int server_cpus;
int is_wow64 = FALSE;
#ifndef HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS
/* data structure used to pass an fd with sendmsg/recvmsg */
@ -1081,6 +1082,11 @@ size_t server_init_thread( void *entry_point )
}
SERVER_END_REQ;
#ifndef _WIN64
is_wow64 = (server_cpus & (1 << CPU_x86_64)) != 0;
#endif
ntdll_get_thread_data()->wow64_redir = is_wow64;
if (ret)
{
if (ret == STATUS_NOT_SUPPORTED)

View File

@ -2512,6 +2512,8 @@ NTSYSAPI BOOLEAN WINAPI RtlValidSid(PSID);
NTSYSAPI BOOLEAN WINAPI RtlValidateHeap(HANDLE,ULONG,LPCVOID);
NTSYSAPI NTSTATUS WINAPI RtlVerifyVersionInfo(const RTL_OSVERSIONINFOEXW*,DWORD,DWORDLONG);
NTSYSAPI NTSTATUS WINAPI RtlWalkHeap(HANDLE,PVOID);
NTSYSAPI NTSTATUS WINAPI RtlWow64EnableFsRedirection(BOOLEAN);
NTSYSAPI NTSTATUS WINAPI RtlWow64EnableFsRedirectionEx(ULONG,ULONG*);
NTSYSAPI NTSTATUS WINAPI RtlWriteRegistryValue(ULONG,PCWSTR,PCWSTR,ULONG,PVOID,ULONG);
NTSYSAPI NTSTATUS WINAPI RtlpNtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
NTSYSAPI NTSTATUS WINAPI RtlpNtEnumerateSubKey(HANDLE,UNICODE_STRING *, ULONG);