Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
3e3af62b
Commit
3e3af62b
authored
Mar 09, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wow64: Create the WOW64INFO structure.
parent
a8f11bb8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
0 deletions
+25
-0
syscall.c
dlls/wow64/syscall.c
+8
-0
cpu.c
dlls/wow64cpu/cpu.c
+3
-0
winternl.h
include/winternl.h
+14
-0
No files found.
dlls/wow64/syscall.c
View file @
3e3af62b
...
...
@@ -97,6 +97,7 @@ SYSTEM_DLL_INIT_BLOCK *pLdrSystemDllInitBlock = NULL;
/* wow64win syscall table */
static
const
SYSTEM_SERVICE_TABLE
*
psdwhwin32
;
static
HMODULE
win32u_module
;
static
WOW64INFO
*
wow64info
;
/* cpu backend dll functions */
static
void
*
(
WINAPI
*
pBTCpuGetBopCode
)(
void
);
...
...
@@ -783,6 +784,7 @@ static const WCHAR *get_cpu_dll_name(void)
*/
static
DWORD
WINAPI
process_init
(
RTL_RUN_ONCE
*
once
,
void
*
param
,
void
**
context
)
{
TEB32
*
teb32
=
(
TEB32
*
)((
char
*
)
NtCurrentTeb
()
+
NtCurrentTeb
()
->
WowTebOffset
);
HMODULE
module
;
UNICODE_STRING
str
=
RTL_CONSTANT_STRING
(
L"ntdll.dll"
);
SYSTEM_BASIC_INFORMATION
info
;
...
...
@@ -793,6 +795,11 @@ static DWORD WINAPI process_init( RTL_RUN_ONCE *once, void *param, void **contex
NtQuerySystemInformation
(
SystemEmulationBasicInformation
,
&
info
,
sizeof
(
info
),
NULL
);
highest_user_address
=
(
ULONG_PTR
)
info
.
HighestUserAddress
;
default_zero_bits
=
(
ULONG_PTR
)
info
.
HighestUserAddress
|
0x7fffffff
;
wow64info
=
(
WOW64INFO
*
)((
PEB32
*
)
ULongToPtr
(
teb32
->
Peb
)
+
1
);
wow64info
->
NativeSystemPageSize
=
0x1000
;
wow64info
->
NativeMachineType
=
native_machine
;
wow64info
->
EmulatedMachineType
=
current_machine
;
NtCurrentTeb
()
->
TlsSlots
[
WOW64_TLS_WOW64INFO
]
=
wow64info
;
#define GET_PTR(name) p ## name = RtlFindExportedRoutineByName( module, #name )
...
...
@@ -836,6 +843,7 @@ static void thread_init(void)
void
*
cpu_area_ctx
;
RtlWow64GetCurrentCpuArea
(
NULL
,
&
cpu_area_ctx
,
NULL
);
NtCurrentTeb
()
->
TlsSlots
[
WOW64_TLS_WOW64INFO
]
=
wow64info
;
if
(
pBTCpuThreadInit
)
pBTCpuThreadInit
();
/* update initial context to jump to 32-bit LdrInitializeThunk (cf. 32-bit call_init_thunk) */
...
...
dlls/wow64cpu/cpu.c
View file @
3e3af62b
...
...
@@ -290,6 +290,7 @@ NTSTATUS WINAPI BTCpuProcessInit(void)
HMODULE
module
;
UNICODE_STRING
str
;
void
**
p__wine_unix_call_dispatcher
;
WOW64INFO
*
wow64info
=
NtCurrentTeb
()
->
TlsSlots
[
WOW64_TLS_WOW64INFO
];
if
((
ULONG_PTR
)
syscall_32to64
>>
32
)
{
...
...
@@ -297,6 +298,8 @@ NTSTATUS WINAPI BTCpuProcessInit(void)
return
STATUS_INVALID_ADDRESS
;
}
wow64info
->
CpuFlags
|=
WOW64_CPUFLAGS_MSFT64
;
RtlInitUnicodeString
(
&
str
,
L"ntdll.dll"
);
LdrGetDllHandle
(
NULL
,
0
,
&
str
,
&
module
);
p__wine_unix_call_dispatcher
=
RtlFindExportedRoutineByName
(
module
,
"__wine_unix_call_dispatcher"
);
...
...
include/winternl.h
View file @
3e3af62b
...
...
@@ -1085,6 +1085,7 @@ typedef struct _TEB64
#define WOW64_TLS_USERCALLBACKDATA 5
#define WOW64_TLS_APCLIST 7
#define WOW64_TLS_FILESYSREDIR 8
#define WOW64_TLS_WOW64INFO 10
#define WOW64_TLS_MAX_NUMBER 19
...
...
@@ -3855,6 +3856,19 @@ typedef struct _WOW64_CPU_AREA_INFO
USHORT
Machine
;
}
WOW64_CPU_AREA_INFO
,
*
PWOW64_CPU_AREA_INFO
;
typedef
struct
_WOW64INFO
{
ULONG
NativeSystemPageSize
;
ULONG
CpuFlags
;
ULONG
Wow64ExecuteFlags
;
ULONG
unknown
[
5
];
USHORT
NativeMachineType
;
USHORT
EmulatedMachineType
;
}
WOW64INFO
;
#define WOW64_CPUFLAGS_MSFT64 0x01
#define WOW64_CPUFLAGS_SOFTWARE 0x02
/* wow64.dll functions */
void
*
WINAPI
Wow64AllocateTemp
(
SIZE_T
);
void
WINAPI
Wow64ApcRoutine
(
ULONG_PTR
,
ULONG_PTR
,
ULONG_PTR
,
CONTEXT
*
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment