ntdll: Add management of the Wow64 filesystem redirection flag.
This commit is contained in:
parent
4f8ce1b2f2
commit
747d58d211
|
@ -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.@)
|
* RtlDoesFileExists_U (NTDLL.@)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -913,6 +913,8 @@
|
||||||
@ stdcall -arch=x86_64 RtlVirtualUnwind(long long long ptr ptr ptr ptr ptr)
|
@ stdcall -arch=x86_64 RtlVirtualUnwind(long long long ptr ptr ptr ptr ptr)
|
||||||
@ stub RtlWalkFrameChain
|
@ stub RtlWalkFrameChain
|
||||||
@ stdcall RtlWalkHeap(long ptr)
|
@ stdcall RtlWalkHeap(long ptr)
|
||||||
|
@ stdcall RtlWow64EnableFsRedirection(long)
|
||||||
|
@ stdcall RtlWow64EnableFsRedirectionEx(long ptr)
|
||||||
@ stub RtlWriteMemoryStream
|
@ stub RtlWriteMemoryStream
|
||||||
@ stdcall RtlWriteRegistryValue(long ptr ptr long ptr long)
|
@ stdcall RtlWriteRegistryValue(long ptr ptr long ptr long)
|
||||||
@ stub RtlZeroHeap
|
@ stub RtlZeroHeap
|
||||||
|
|
|
@ -71,7 +71,7 @@ extern void virtual_init_threading(void);
|
||||||
|
|
||||||
/* server support */
|
/* server support */
|
||||||
extern timeout_t server_start_time;
|
extern timeout_t server_start_time;
|
||||||
extern unsigned int server_cpus;
|
extern int is_wow64;
|
||||||
extern void server_init_process(void);
|
extern void server_init_process(void);
|
||||||
extern NTSTATUS server_init_process_done(void);
|
extern NTSTATUS server_init_process_done(void);
|
||||||
extern size_t server_init_thread( void *entry_point );
|
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 request_fd; /* 1e0/310 fd for sending server requests */
|
||||||
int reply_fd; /* 1e4/314 fd for receiving server replies */
|
int reply_fd; /* 1e4/314 fd for receiving server replies */
|
||||||
int wait_fd[2]; /* 1e8/318 fd for sleeping server requests */
|
int wait_fd[2]; /* 1e8/318 fd for sleeping server requests */
|
||||||
void *vm86_ptr; /* 1f0/320 data for vm86 mode */
|
BOOL wow64_redir; /* 1f0/320 Wow64 filesystem redirection flag */
|
||||||
pthread_t pthread_id; /* 1f4/328 pthread thread id */
|
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)
|
static inline struct ntdll_thread_data *ntdll_get_thread_data(void)
|
||||||
|
|
|
@ -307,11 +307,7 @@ NTSTATUS WINAPI NtQueryInformationProcess(
|
||||||
case ProcessWow64Information:
|
case ProcessWow64Information:
|
||||||
if (ProcessInformationLength == sizeof(DWORD))
|
if (ProcessInformationLength == sizeof(DWORD))
|
||||||
{
|
{
|
||||||
#ifdef __i386__
|
*(DWORD *)ProcessInformation = is_wow64;
|
||||||
*(DWORD *)ProcessInformation = (server_cpus & (1 << CPU_x86_64)) != 0;
|
|
||||||
#else
|
|
||||||
*(DWORD *)ProcessInformation = FALSE;
|
|
||||||
#endif
|
|
||||||
len = sizeof(DWORD);
|
len = sizeof(DWORD);
|
||||||
}
|
}
|
||||||
else ret = STATUS_INFO_LENGTH_MISMATCH;
|
else ret = STATUS_INFO_LENGTH_MISMATCH;
|
||||||
|
|
|
@ -94,7 +94,8 @@ static const enum cpu_type client_cpu = CPU_SPARC;
|
||||||
#error Unsupported CPU
|
#error Unsupported CPU
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
unsigned int server_cpus = 0;
|
static unsigned int server_cpus;
|
||||||
|
int is_wow64 = FALSE;
|
||||||
|
|
||||||
#ifndef HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS
|
#ifndef HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS
|
||||||
/* data structure used to pass an fd with sendmsg/recvmsg */
|
/* 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;
|
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)
|
||||||
{
|
{
|
||||||
if (ret == STATUS_NOT_SUPPORTED)
|
if (ret == STATUS_NOT_SUPPORTED)
|
||||||
|
|
|
@ -2512,6 +2512,8 @@ NTSYSAPI BOOLEAN WINAPI RtlValidSid(PSID);
|
||||||
NTSYSAPI BOOLEAN WINAPI RtlValidateHeap(HANDLE,ULONG,LPCVOID);
|
NTSYSAPI BOOLEAN WINAPI RtlValidateHeap(HANDLE,ULONG,LPCVOID);
|
||||||
NTSYSAPI NTSTATUS WINAPI RtlVerifyVersionInfo(const RTL_OSVERSIONINFOEXW*,DWORD,DWORDLONG);
|
NTSYSAPI NTSTATUS WINAPI RtlVerifyVersionInfo(const RTL_OSVERSIONINFOEXW*,DWORD,DWORDLONG);
|
||||||
NTSYSAPI NTSTATUS WINAPI RtlWalkHeap(HANDLE,PVOID);
|
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 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 RtlpNtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG);
|
||||||
NTSYSAPI NTSTATUS WINAPI RtlpNtEnumerateSubKey(HANDLE,UNICODE_STRING *, ULONG);
|
NTSYSAPI NTSTATUS WINAPI RtlpNtEnumerateSubKey(HANDLE,UNICODE_STRING *, ULONG);
|
||||||
|
|
Loading…
Reference in New Issue