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
0d37cc1d
Commit
0d37cc1d
authored
Feb 07, 2024
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Update the image information when loading a builtin dll.
parent
4022fb9b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
9 deletions
+14
-9
loader.c
dlls/ntdll/unix/loader.c
+4
-4
unix_private.h
dlls/ntdll/unix/unix_private.h
+2
-1
virtual.c
dlls/ntdll/unix/virtual.c
+8
-4
No files found.
dlls/ntdll/unix/loader.c
View file @
0d37cc1d
...
...
@@ -1277,11 +1277,11 @@ done:
* Return STATUS_IMAGE_ALREADY_LOADED if we should keep the native one that we have found.
*/
NTSTATUS
load_builtin
(
const
pe_image_info_t
*
image_info
,
WCHAR
*
filename
,
USHORT
machine
,
void
**
module
,
SIZE_T
*
size
,
ULONG_PTR
limit_low
,
ULONG_PTR
limit_high
)
SECTION_IMAGE_INFORMATION
*
info
,
void
**
module
,
SIZE_T
*
size
,
ULONG_PTR
limit_low
,
ULONG_PTR
limit_high
)
{
NTSTATUS
status
;
UNICODE_STRING
nt_name
;
SECTION_IMAGE_INFORMATION
info
;
enum
loadorder
loadorder
;
init_unicode_string
(
&
nt_name
,
filename
);
...
...
@@ -1307,10 +1307,10 @@ NTSTATUS load_builtin( const pe_image_info_t *image_info, WCHAR *filename, USHOR
case
LO_NATIVE_BUILTIN
:
return
STATUS_IMAGE_ALREADY_LOADED
;
case
LO_BUILTIN
:
return
find_builtin_dll
(
&
nt_name
,
module
,
size
,
&
info
,
limit_low
,
limit_high
,
return
find_builtin_dll
(
&
nt_name
,
module
,
size
,
info
,
limit_low
,
limit_high
,
image_info
->
machine
,
machine
,
FALSE
);
default:
status
=
find_builtin_dll
(
&
nt_name
,
module
,
size
,
&
info
,
limit_low
,
limit_high
,
status
=
find_builtin_dll
(
&
nt_name
,
module
,
size
,
info
,
limit_low
,
limit_high
,
image_info
->
machine
,
machine
,
(
loadorder
==
LO_DEFAULT
)
);
if
(
status
==
STATUS_DLL_NOT_FOUND
||
status
==
STATUS_NOT_SUPPORTED
)
return
STATUS_IMAGE_ALREADY_LOADED
;
...
...
dlls/ntdll/unix/unix_private.h
View file @
0d37cc1d
...
...
@@ -185,7 +185,8 @@ extern char **build_envp( const WCHAR *envW );
extern
char
*
get_alternate_wineloader
(
WORD
machine
);
extern
NTSTATUS
exec_wineloader
(
char
**
argv
,
int
socketfd
,
const
pe_image_info_t
*
pe_info
);
extern
NTSTATUS
load_builtin
(
const
pe_image_info_t
*
image_info
,
WCHAR
*
filename
,
USHORT
machine
,
void
**
addr_ptr
,
SIZE_T
*
size_ptr
,
ULONG_PTR
limit_low
,
ULONG_PTR
limit_high
);
SECTION_IMAGE_INFORMATION
*
info
,
void
**
module
,
SIZE_T
*
size
,
ULONG_PTR
limit_low
,
ULONG_PTR
limit_high
);
extern
BOOL
is_builtin_path
(
const
UNICODE_STRING
*
path
,
WORD
*
machine
);
extern
NTSTATUS
load_main_exe
(
const
WCHAR
*
name
,
const
char
*
unix_name
,
const
WCHAR
*
curdir
,
USHORT
load_machine
,
WCHAR
**
image
,
void
**
module
);
...
...
dlls/ntdll/unix/virtual.c
View file @
0d37cc1d
...
...
@@ -3161,9 +3161,12 @@ static unsigned int virtual_map_section( HANDLE handle, PVOID *addr_ptr, ULONG_P
if
(
image_info
)
{
SECTION_IMAGE_INFORMATION
info
;
filename
=
(
WCHAR
*
)(
image_info
+
1
);
/* check if we can replace that mapping with the builtin */
res
=
load_builtin
(
image_info
,
filename
,
machine
,
addr_ptr
,
size_ptr
,
limit_low
,
limit_high
);
res
=
load_builtin
(
image_info
,
filename
,
machine
,
&
info
,
addr_ptr
,
size_ptr
,
limit_low
,
limit_high
);
if
(
res
==
STATUS_IMAGE_ALREADY_LOADED
)
res
=
virtual_map_image
(
handle
,
addr_ptr
,
size_ptr
,
shared_file
,
limit_low
,
limit_high
,
alloc_type
,
machine
,
image_info
,
filename
,
FALSE
);
...
...
@@ -3462,12 +3465,13 @@ NTSTATUS virtual_map_module( HANDLE mapping, void **module, SIZE_T *size, SECTIO
filename
=
(
WCHAR
*
)(
image_info
+
1
);
/* check if we can replace that mapping with the builtin */
status
=
load_builtin
(
image_info
,
filename
,
machine
,
module
,
size
,
limit_low
,
limit_high
);
status
=
load_builtin
(
image_info
,
filename
,
machine
,
info
,
module
,
size
,
limit_low
,
limit_high
);
if
(
status
==
STATUS_IMAGE_ALREADY_LOADED
)
{
status
=
virtual_map_image
(
mapping
,
module
,
size
,
shared_file
,
limit_low
,
limit_high
,
0
,
machine
,
image_info
,
filename
,
FALSE
);
virtual_fill_image_information
(
image_info
,
info
);
virtual_fill_image_information
(
image_info
,
info
);
}
if
(
shared_file
)
NtClose
(
shared_file
);
free
(
image_info
);
return
status
;
...
...
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