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
06f925c5
Commit
06f925c5
authored
Nov 02, 2021
by
Paul Gofman
Committed by
Alexandre Julliard
Nov 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Pass DDAG node to process_attach().
Signed-off-by:
Paul Gofman
<
pgofman@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
41c7652b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
loader.c
dlls/ntdll/loader.c
+11
-6
No files found.
dlls/ntdll/loader.c
View file @
06f925c5
...
...
@@ -187,7 +187,7 @@ static WINE_MODREF *last_failed_modref;
static
NTSTATUS
load_dll
(
const
WCHAR
*
load_path
,
const
WCHAR
*
libname
,
const
WCHAR
*
default_ext
,
DWORD
flags
,
WINE_MODREF
**
pwm
);
static
NTSTATUS
process_attach
(
WINE_MODREF
*
wm
,
LPVOID
lpReserved
);
static
NTSTATUS
process_attach
(
LDR_DDAG_NODE
*
node
,
LPVOID
lpReserved
);
static
FARPROC
find_ordinal_export
(
HMODULE
module
,
const
IMAGE_EXPORT_DIRECTORY
*
exports
,
DWORD
exp_size
,
DWORD
ordinal
,
LPCWSTR
load_path
);
static
FARPROC
find_named_export
(
HMODULE
module
,
const
IMAGE_EXPORT_DIRECTORY
*
exports
,
...
...
@@ -648,7 +648,7 @@ static FARPROC find_forwarded_export( HMODULE module, const char *forward, LPCWS
WINE_MODREF
**
deps
=
grow_module_deps
(
current_modref
,
1
);
if
(
deps
)
deps
[
current_modref
->
nDeps
++
]
=
wm
;
}
else
if
(
process_attach
(
wm
,
NULL
)
!=
STATUS_SUCCESS
)
else
if
(
process_attach
(
wm
->
ldr
.
DdagNode
,
NULL
)
!=
STATUS_SUCCESS
)
{
LdrUnloadDll
(
wm
->
ldr
.
DllBase
);
wm
=
NULL
;
...
...
@@ -1438,14 +1438,19 @@ static NTSTATUS MODULE_InitDLL( WINE_MODREF *wm, UINT reason, LPVOID lpReserved
*
* The loader_section must be locked while calling this function.
*/
static
NTSTATUS
process_attach
(
WINE_MODREF
*
wm
,
LPVOID
lpReserved
)
static
NTSTATUS
process_attach
(
LDR_DDAG_NODE
*
node
,
LPVOID
lpReserved
)
{
NTSTATUS
status
=
STATUS_SUCCESS
;
LDR_DATA_TABLE_ENTRY
*
mod
;
ULONG_PTR
cookie
;
WINE_MODREF
*
wm
;
int
i
;
if
(
process_detaching
)
return
status
;
mod
=
CONTAINING_RECORD
(
node
->
Modules
.
Flink
,
LDR_DATA_TABLE_ENTRY
,
NodeModuleLink
);
wm
=
CONTAINING_RECORD
(
mod
,
WINE_MODREF
,
ldr
);
/* prevent infinite recursion in case of cyclical dependencies */
if
(
(
wm
->
ldr
.
Flags
&
LDR_LOAD_IN_PROGRESS
)
||
(
wm
->
ldr
.
Flags
&
LDR_PROCESS_ATTACHED
)
)
...
...
@@ -1462,7 +1467,7 @@ static NTSTATUS process_attach( WINE_MODREF *wm, LPVOID lpReserved )
for
(
i
=
0
;
i
<
wm
->
nDeps
;
i
++
)
{
if
(
!
wm
->
deps
[
i
])
continue
;
if
((
status
=
process_attach
(
wm
->
deps
[
i
],
lpReserved
))
!=
STATUS_SUCCESS
)
break
;
if
((
status
=
process_attach
(
wm
->
deps
[
i
]
->
ldr
.
DdagNode
,
lpReserved
))
!=
STATUS_SUCCESS
)
break
;
}
if
(
!
wm
->
ldr
.
InInitializationOrderLinks
.
Flink
)
...
...
@@ -2994,7 +2999,7 @@ NTSTATUS WINAPI DECLSPEC_HOTPATCH LdrLoadDll(LPCWSTR path_name, DWORD flags,
if
(
nts
==
STATUS_SUCCESS
&&
!
(
wm
->
ldr
.
Flags
&
LDR_DONT_RESOLVE_REFS
))
{
nts
=
process_attach
(
wm
,
NULL
);
nts
=
process_attach
(
wm
->
ldr
.
DdagNode
,
NULL
);
if
(
nts
!=
STATUS_SUCCESS
)
{
LdrUnloadDll
(
wm
->
ldr
.
DllBase
);
...
...
@@ -3957,7 +3962,7 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
for
(
i
=
0
;
i
<
wm
->
nDeps
;
i
++
)
{
if
(
!
wm
->
deps
[
i
])
continue
;
if
((
status
=
process_attach
(
wm
->
deps
[
i
],
context
))
!=
STATUS_SUCCESS
)
if
((
status
=
process_attach
(
wm
->
deps
[
i
]
->
ldr
.
DdagNode
,
context
))
!=
STATUS_SUCCESS
)
{
if
(
last_failed_modref
)
ERR
(
"%s failed to initialize, aborting
\n
"
,
...
...
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