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
f17483b9
Commit
f17483b9
authored
Mar 26, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Check the loadorder for .so dlls on the Unix side.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e8ec7a8c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
19 deletions
+6
-19
loader.c
dlls/ntdll/loader.c
+5
-19
loader.c
dlls/ntdll/unix/loader.c
+1
-0
No files found.
dlls/ntdll/loader.c
View file @
f17483b9
...
...
@@ -2349,10 +2349,11 @@ static NTSTATUS load_so_dll( LPCWSTR load_path, const UNICODE_STRING *nt_name,
UNICODE_STRING
win_name
=
*
nt_name
;
TRACE
(
"trying %s as so lib
\n
"
,
debugstr_us
(
&
win_name
)
);
if
(
unix_funcs
->
load_so_dll
(
&
win_name
,
&
module
))
if
(
(
status
=
unix_funcs
->
load_so_dll
(
&
win_name
,
&
module
)
))
{
WARN
(
"failed to load .so lib %s
\n
"
,
debugstr_us
(
nt_name
)
);
return
STATUS_INVALID_IMAGE_FORMAT
;
if
(
status
==
STATUS_INVALID_IMAGE_FORMAT
)
status
=
STATUS_INVALID_IMAGE_NOT_MZ
;
return
status
;
}
if
((
wm
=
get_modref
(
module
)))
/* already loaded */
...
...
@@ -2690,7 +2691,6 @@ done:
static
NTSTATUS
load_dll
(
const
WCHAR
*
load_path
,
const
WCHAR
*
libname
,
const
WCHAR
*
default_ext
,
DWORD
flags
,
WINE_MODREF
**
pwm
)
{
enum
loadorder
loadorder
;
UNICODE_STRING
nt_name
;
struct
file_id
id
;
HANDLE
mapping
=
0
;
...
...
@@ -2715,27 +2715,13 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, const WC
if
(
nts
&&
nts
!=
STATUS_DLL_NOT_FOUND
&&
nts
!=
STATUS_INVALID_IMAGE_NOT_MZ
)
goto
done
;
loadorder
=
unix_funcs
->
get_load_order
(
&
nt_name
);
prev
=
NtCurrentTeb
()
->
Tib
.
ArbitraryUserPointer
;
NtCurrentTeb
()
->
Tib
.
ArbitraryUserPointer
=
nt_name
.
Buffer
+
4
;
switch
(
nts
)
{
case
STATUS_INVALID_IMAGE_NOT_MZ
:
/* not in PE format, maybe it's a .so file */
switch
(
loadorder
)
{
case
LO_NATIVE
:
case
LO_NATIVE_BUILTIN
:
case
LO_BUILTIN
:
case
LO_BUILTIN_NATIVE
:
case
LO_DEFAULT
:
if
(
!
load_so_dll
(
load_path
,
&
nt_name
,
flags
,
pwm
))
nts
=
STATUS_SUCCESS
;
break
;
default:
nts
=
STATUS_DLL_NOT_FOUND
;
break
;
}
nts
=
load_so_dll
(
load_path
,
&
nt_name
,
flags
,
pwm
);
break
;
case
STATUS_SUCCESS
:
/* valid PE file */
...
...
@@ -2743,7 +2729,7 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, const WC
break
;
case
STATUS_DLL_NOT_FOUND
:
/* no file found, try builtin */
switch
(
loadorder
)
switch
(
unix_funcs
->
get_load_order
(
&
nt_name
)
)
{
case
LO_NATIVE_BUILTIN
:
case
LO_BUILTIN
:
...
...
dlls/ntdll/unix/loader.c
View file @
f17483b9
...
...
@@ -1153,6 +1153,7 @@ static NTSTATUS CDECL load_so_dll( UNICODE_STRING *nt_name, void **module )
NTSTATUS
status
;
DWORD
len
;
if
(
get_load_order
(
nt_name
)
==
LO_DISABLED
)
return
STATUS_DLL_NOT_FOUND
;
if
(
nt_to_unix_file_name
(
nt_name
,
&
unix_name
,
NULL
,
FILE_OPEN
))
return
STATUS_DLL_NOT_FOUND
;
/* remove .so extension from Windows name */
...
...
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