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
40673153
Commit
40673153
authored
Aug 31, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wow64: Patch the Wow64Transition pointer in all loaded modules.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0afbbabc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
7 deletions
+23
-7
syscall.c
dlls/wow64/syscall.c
+16
-7
virtual.c
dlls/wow64/virtual.c
+6
-0
wow64_private.h
dlls/wow64/wow64_private.h
+1
-0
No files found.
dlls/wow64/syscall.c
View file @
40673153
...
...
@@ -335,6 +335,17 @@ static DWORD get_syscall_num( const BYTE *syscall )
/**********************************************************************
* init_image_mapping
*/
void
init_image_mapping
(
HMODULE
module
)
{
void
**
ptr
=
RtlFindExportedRoutineByName
(
module
,
"Wow64Transition"
);
if
(
ptr
)
*
ptr
=
pBTCpuGetBopCode
();
}
/**********************************************************************
* init_syscall_table
*/
static
void
init_syscall_table
(
HMODULE
module
,
ULONG
idx
,
const
SYSTEM_SERVICE_TABLE
*
orig_table
)
...
...
@@ -440,7 +451,6 @@ static HMODULE load_cpu_dll(void)
*/
static
DWORD
WINAPI
process_init
(
RTL_RUN_ONCE
*
once
,
void
*
param
,
void
**
context
)
{
void
**
pWow64Transition
,
**
p__wine_syscall_dispatcher
;
HMODULE
module
;
UNICODE_STRING
str
;
...
...
@@ -454,18 +464,17 @@ static DWORD WINAPI process_init( RTL_RUN_ONCE *once, void *param, void **contex
LdrGetDllHandle
(
NULL
,
0
,
&
str
,
&
module
);
GET_PTR
(
LdrSystemDllInitBlock
);
module
=
(
HMODULE
)(
ULONG_PTR
)
pLdrSystemDllInitBlock
->
ntdll_handle
;
GET_PTR
(
Wow64Transition
);
GET_PTR
(
__wine_syscall_dispatcher
);
init_syscall_table
(
module
,
0
,
&
ntdll_syscall_table
);
module
=
load_cpu_dll
();
GET_PTR
(
BTCpuGetBopCode
);
GET_PTR
(
BTCpuProcessInit
);
GET_PTR
(
BTCpuSimulate
);
pBTCpuProcessInit
();
*
pWow64Transition
=
*
p__wine_syscall_dispatcher
=
pBTCpuGetBopCode
();
module
=
(
HMODULE
)(
ULONG_PTR
)
pLdrSystemDllInitBlock
->
ntdll_handle
;
init_image_mapping
(
module
);
init_syscall_table
(
module
,
0
,
&
ntdll_syscall_table
);
*
(
void
**
)
RtlFindExportedRoutineByName
(
module
,
"__wine_syscall_dispatcher"
)
=
pBTCpuGetBopCode
();
init_file_redirects
();
return
TRUE
;
...
...
dlls/wow64/virtual.c
View file @
40673153
...
...
@@ -257,6 +257,12 @@ NTSTATUS WINAPI wow64_NtMapViewOfSection( UINT *args )
commit
,
offset
,
size_32to64
(
&
size
,
size32
),
inherit
,
alloc
,
protect
);
if
(
NT_SUCCESS
(
status
))
{
SECTION_IMAGE_INFORMATION
info
;
if
(
!
NtQuerySection
(
handle
,
SectionImageInformation
,
&
info
,
sizeof
(
info
),
NULL
))
{
if
(
info
.
Machine
==
current_machine
)
init_image_mapping
(
addr
);
}
put_addr
(
addr32
,
addr
);
put_size
(
size32
,
size
);
}
...
...
dlls/wow64/wow64_private.h
View file @
40673153
...
...
@@ -32,6 +32,7 @@ void * WINAPI Wow64AllocateTemp( SIZE_T size );
void
WINAPI
Wow64ApcRoutine
(
ULONG_PTR
arg1
,
ULONG_PTR
arg2
,
ULONG_PTR
arg3
,
CONTEXT
*
context
);
void
WINAPI
Wow64PassExceptionToGuest
(
EXCEPTION_POINTERS
*
ptrs
);
extern
void
init_image_mapping
(
HMODULE
module
)
DECLSPEC_HIDDEN
;
extern
void
init_file_redirects
(
void
)
DECLSPEC_HIDDEN
;
extern
BOOL
get_file_redirect
(
OBJECT_ATTRIBUTES
*
attr
)
DECLSPEC_HIDDEN
;
...
...
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