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
4a10f3a1
Commit
4a10f3a1
authored
Mar 30, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Allow using the .fake files from the build tree as PE mapping placeholders.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a3d9c487
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
30 deletions
+21
-30
loader.c
dlls/ntdll/unix/loader.c
+20
-29
unix_private.h
dlls/ntdll/unix/unix_private.h
+1
-1
No files found.
dlls/ntdll/unix/loader.c
View file @
4a10f3a1
...
...
@@ -1395,7 +1395,7 @@ static NTSTATUS CDECL load_builtin_dll( UNICODE_STRING *nt_name, void **module,
* Load the builtin dll if specified by load order configuration.
* 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
,
const
WCHAR
*
filename
,
NTSTATUS
load_builtin
(
const
pe_image_info_t
*
image_info
,
WCHAR
*
filename
,
void
**
module
,
SIZE_T
*
size
)
{
WORD
machine
=
image_info
->
machine
;
/* request same machine as the native one */
...
...
@@ -1404,38 +1404,32 @@ NTSTATUS load_builtin( const pe_image_info_t *image_info, const WCHAR *filename,
SECTION_IMAGE_INFORMATION
info
;
enum
loadorder
loadorder
;
/* remove .fake extension if present */
if
(
image_info
->
image_flags
&
IMAGE_FLAGS_WineFakeDll
)
{
static
const
WCHAR
fakeW
[]
=
{
'.'
,
'f'
,
'a'
,
'k'
,
'e'
,
0
};
WCHAR
*
ext
=
wcsrchr
(
filename
,
'.'
);
TRACE
(
"%s is a fake Wine dll
\n
"
,
debugstr_w
(
filename
)
);
if
(
ext
&&
!
wcsicmp
(
ext
,
fakeW
))
*
ext
=
0
;
}
init_unicode_string
(
&
nt_name
,
filename
);
loadorder
=
get_load_order
(
&
nt_name
);
if
(
loadorder
==
LO_DISABLED
)
return
STATUS_DLL_NOT_FOUND
;
if
(
image_info
->
image_flags
&
IMAGE_FLAGS_WineBuiltin
)
{
switch
(
loadorder
)
{
case
LO_NATIVE_BUILTIN
:
case
LO_BUILTIN
:
case
LO_BUILTIN_NATIVE
:
case
LO_DEFAULT
:
status
=
find_builtin_dll
(
&
nt_name
,
module
,
size
,
&
info
,
machine
,
FALSE
);
if
(
status
==
STATUS_DLL_NOT_FOUND
)
return
STATUS_IMAGE_ALREADY_LOADED
;
return
status
;
default:
return
STATUS_DLL_NOT_FOUND
;
}
if
(
loadorder
==
LO_NATIVE
)
return
STATUS_DLL_NOT_FOUND
;
loadorder
=
LO_BUILTIN_NATIVE
;
/* load builtin, then fallback to the file we found */
}
if
(
image_info
->
image_flags
&
IMAGE_FLAGS_WineFakeDll
)
else
if
(
image_info
->
image_flags
&
IMAGE_FLAGS_WineFakeDll
)
{
TRACE
(
"%s is a fake Wine dll
\n
"
,
debugstr_us
(
&
nt_name
)
);
switch
(
loadorder
)
{
case
LO_NATIVE_BUILTIN
:
case
LO_BUILTIN
:
case
LO_BUILTIN_NATIVE
:
case
LO_DEFAULT
:
return
find_builtin_dll
(
&
nt_name
,
module
,
size
,
&
info
,
machine
,
FALSE
);
default:
return
STATUS_DLL_NOT_FOUND
;
}
if
(
loadorder
==
LO_NATIVE
)
return
STATUS_DLL_NOT_FOUND
;
loadorder
=
LO_BUILTIN
;
/* builtin with no fallback since mapping a fake dll is not useful */
}
switch
(
loadorder
)
{
case
LO_NATIVE
:
...
...
@@ -1443,13 +1437,10 @@ NTSTATUS load_builtin( const pe_image_info_t *image_info, const WCHAR *filename,
return
STATUS_IMAGE_ALREADY_LOADED
;
case
LO_BUILTIN
:
return
find_builtin_dll
(
&
nt_name
,
module
,
size
,
&
info
,
machine
,
FALSE
);
case
LO_BUILTIN_NATIVE
:
case
LO_DEFAULT
:
default:
status
=
find_builtin_dll
(
&
nt_name
,
module
,
size
,
&
info
,
machine
,
(
loadorder
==
LO_DEFAULT
)
);
if
(
status
==
STATUS_DLL_NOT_FOUND
)
return
STATUS_IMAGE_ALREADY_LOADED
;
return
status
;
default:
return
STATUS_DLL_NOT_FOUND
;
}
}
...
...
dlls/ntdll/unix/unix_private.h
View file @
4a10f3a1
...
...
@@ -143,7 +143,7 @@ extern DWORD ntdll_umbstowcs( const char *src, DWORD srclen, WCHAR *dst, DWORD d
extern
int
ntdll_wcstoumbs
(
const
WCHAR
*
src
,
DWORD
srclen
,
char
*
dst
,
DWORD
dstlen
,
BOOL
strict
)
DECLSPEC_HIDDEN
;
extern
char
**
build_envp
(
const
WCHAR
*
envW
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
exec_wineloader
(
char
**
argv
,
int
socketfd
,
const
pe_image_info_t
*
pe_info
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
load_builtin
(
const
pe_image_info_t
*
image_info
,
const
WCHAR
*
filename
,
extern
NTSTATUS
load_builtin
(
const
pe_image_info_t
*
image_info
,
WCHAR
*
filename
,
void
**
addr_ptr
,
SIZE_T
*
size_ptr
)
DECLSPEC_HIDDEN
;
extern
BOOL
is_builtin_path
(
const
UNICODE_STRING
*
path
,
WORD
*
machine
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
load_main_exe
(
const
WCHAR
*
name
,
const
char
*
unix_name
,
const
WCHAR
*
curdir
,
WCHAR
**
image
,
...
...
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