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
a6e4c814
Commit
a6e4c814
authored
Feb 08, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use an NT filename to search for loaded modules.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
954ed395
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
loader.c
dlls/ntdll/loader.c
+11
-7
No files found.
dlls/ntdll/loader.c
View file @
a6e4c814
...
@@ -432,18 +432,23 @@ static WINE_MODREF *find_basename_module( LPCWSTR name )
...
@@ -432,18 +432,23 @@ static WINE_MODREF *find_basename_module( LPCWSTR name )
* Find a module from its full path name.
* Find a module from its full path name.
* The loader_section must be locked while calling this function
* The loader_section must be locked while calling this function
*/
*/
static
WINE_MODREF
*
find_fullname_module
(
LPCWSTR
name
)
static
WINE_MODREF
*
find_fullname_module
(
const
UNICODE_STRING
*
nt_
name
)
{
{
PLIST_ENTRY
mark
,
entry
;
PLIST_ENTRY
mark
,
entry
;
UNICODE_STRING
name
=
*
nt_name
;
if
(
cached_modref
&&
!
strcmpiW
(
name
,
cached_modref
->
ldr
.
FullDllName
.
Buffer
))
if
(
name
.
Length
<=
4
*
sizeof
(
WCHAR
))
return
NULL
;
name
.
Length
-=
4
*
sizeof
(
WCHAR
);
/* for \??\ prefix */
name
.
Buffer
+=
4
;
if
(
cached_modref
&&
RtlEqualUnicodeString
(
&
name
,
&
cached_modref
->
ldr
.
FullDllName
,
TRUE
))
return
cached_modref
;
return
cached_modref
;
mark
=
&
NtCurrentTeb
()
->
Peb
->
LdrData
->
InLoadOrderModuleList
;
mark
=
&
NtCurrentTeb
()
->
Peb
->
LdrData
->
InLoadOrderModuleList
;
for
(
entry
=
mark
->
Flink
;
entry
!=
mark
;
entry
=
entry
->
Flink
)
for
(
entry
=
mark
->
Flink
;
entry
!=
mark
;
entry
=
entry
->
Flink
)
{
{
LDR_MODULE
*
mod
=
CONTAINING_RECORD
(
entry
,
LDR_MODULE
,
InLoadOrderModuleList
);
LDR_MODULE
*
mod
=
CONTAINING_RECORD
(
entry
,
LDR_MODULE
,
InLoadOrderModuleList
);
if
(
!
strcmpiW
(
name
,
mod
->
FullDllName
.
Buffer
))
if
(
RtlEqualUnicodeString
(
&
name
,
&
mod
->
FullDllName
,
TRUE
))
{
{
cached_modref
=
CONTAINING_RECORD
(
mod
,
WINE_MODREF
,
ldr
);
cached_modref
=
CONTAINING_RECORD
(
mod
,
WINE_MODREF
,
ldr
);
return
cached_modref
;
return
cached_modref
;
...
@@ -2351,6 +2356,8 @@ static HANDLE open_dll_file( UNICODE_STRING *nt_name, WINE_MODREF **pwm, struct
...
@@ -2351,6 +2356,8 @@ static HANDLE open_dll_file( UNICODE_STRING *nt_name, WINE_MODREF **pwm, struct
HANDLE
handle
;
HANDLE
handle
;
int
fd
,
needs_close
;
int
fd
,
needs_close
;
if
((
*
pwm
=
find_fullname_module
(
nt_name
)))
return
0
;
attr
.
Length
=
sizeof
(
attr
);
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
attr
.
RootDirectory
=
0
;
attr
.
Attributes
=
OBJ_CASE_INSENSITIVE
;
attr
.
Attributes
=
OBJ_CASE_INSENSITIVE
;
...
@@ -2434,8 +2441,6 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname,
...
@@ -2434,8 +2441,6 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname,
if
(
len
)
if
(
len
)
{
{
if
(
len
>=
*
size
)
goto
overflow
;
if
(
len
>=
*
size
)
goto
overflow
;
if
((
*
pwm
=
find_fullname_module
(
filename
)))
goto
found
;
if
(
!
RtlDosPathNameToNtPathName_U
(
filename
,
&
nt_name
,
NULL
,
NULL
))
if
(
!
RtlDosPathNameToNtPathName_U
(
filename
,
&
nt_name
,
NULL
,
NULL
))
{
{
RtlFreeHeap
(
GetProcessHeap
(),
0
,
dllname
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
dllname
);
...
@@ -2462,8 +2467,7 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname,
...
@@ -2462,8 +2467,7 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname,
len
=
nt_name
.
Length
-
4
*
sizeof
(
WCHAR
);
/* for \??\ prefix */
len
=
nt_name
.
Length
-
4
*
sizeof
(
WCHAR
);
/* for \??\ prefix */
if
(
len
>=
*
size
)
goto
overflow
;
if
(
len
>=
*
size
)
goto
overflow
;
memcpy
(
filename
,
nt_name
.
Buffer
+
4
,
len
+
sizeof
(
WCHAR
)
);
memcpy
(
filename
,
nt_name
.
Buffer
+
4
,
len
+
sizeof
(
WCHAR
)
);
if
(
!
(
*
pwm
=
find_fullname_module
(
filename
)))
*
handle
=
open_dll_file
(
&
nt_name
,
pwm
,
st
);
*
handle
=
open_dll_file
(
&
nt_name
,
pwm
,
st
);
found:
found:
RtlFreeUnicodeString
(
&
nt_name
);
RtlFreeUnicodeString
(
&
nt_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