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
390d71b0
Commit
390d71b0
authored
Jul 07, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Also load the Wow64 ntdll for the main exe target machine.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3190a5bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
loader.c
dlls/ntdll/unix/loader.c
+34
-0
No files found.
dlls/ntdll/unix/loader.c
View file @
390d71b0
...
...
@@ -1759,6 +1759,39 @@ static void load_ntdll(void)
/***********************************************************************
* load_wow64_ntdll
*/
static
void
load_wow64_ntdll
(
USHORT
machine
)
{
static
const
WCHAR
ntdllW
[]
=
{
'n'
,
't'
,
'd'
,
'l'
,
'l'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
SECTION_IMAGE_INFORMATION
info
;
UNICODE_STRING
nt_name
;
void
*
module
;
NTSTATUS
status
;
SIZE_T
size
;
WCHAR
*
path
=
malloc
(
sizeof
(
"
\\
??
\\
C:
\\
windows
\\
system32
\\
ntdll.dll"
)
*
sizeof
(
WCHAR
)
);
wcscpy
(
path
,
get_machine_wow64_dir
(
machine
));
wcscat
(
path
,
ntdllW
);
init_unicode_string
(
&
nt_name
,
path
);
status
=
find_builtin_dll
(
&
nt_name
,
&
module
,
&
size
,
&
info
,
machine
,
FALSE
);
switch
(
status
)
{
case
STATUS_IMAGE_NOT_AT_BASE
:
relocate_ntdll
(
module
);
/* fall through */
case
STATUS_SUCCESS
:
TRACE
(
"loaded %s at %p
\n
"
,
debugstr_w
(
path
),
module
);
break
;
default:
ERR
(
"failed to load %s error %x
\n
"
,
debugstr_w
(
path
),
status
);
break
;
}
free
(
path
);
}
/***********************************************************************
* get_image_address
*/
static
ULONG_PTR
get_image_address
(
void
)
...
...
@@ -1868,6 +1901,7 @@ static void start_main_thread(void)
init_thread_stack
(
teb
,
is_win64
?
0x7fffffff
:
0
,
0
,
0
);
NtCreateKeyedEvent
(
&
keyed_event
,
GENERIC_READ
|
GENERIC_WRITE
,
NULL
,
0
);
load_ntdll
();
if
(
main_image_info
.
Machine
!=
current_machine
)
load_wow64_ntdll
(
main_image_info
.
Machine
);
status
=
p__wine_set_unix_funcs
(
NTDLL_UNIXLIB_VERSION
,
&
unix_funcs
);
if
(
status
==
STATUS_REVISION_MISMATCH
)
{
...
...
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