Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ac602513
Commit
ac602513
authored
Mar 18, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: In MODULE_FlushModrefs, also free dlls that haven't been initialized yet.
parent
9d9bb6a8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
26 deletions
+43
-26
loader.c
dlls/ntdll/loader.c
+43
-26
No files found.
dlls/ntdll/loader.c
View file @
ac602513
...
...
@@ -1877,6 +1877,39 @@ void WINAPI LdrShutdownThread(void)
RtlLeaveCriticalSection
(
&
loader_section
);
}
/***********************************************************************
* free_modref
*
*/
static
void
free_modref
(
WINE_MODREF
*
wm
)
{
RemoveEntryList
(
&
wm
->
ldr
.
InLoadOrderModuleList
);
RemoveEntryList
(
&
wm
->
ldr
.
InMemoryOrderModuleList
);
if
(
wm
->
ldr
.
InInitializationOrderModuleList
.
Flink
)
RemoveEntryList
(
&
wm
->
ldr
.
InInitializationOrderModuleList
);
TRACE
(
" unloading %s
\n
"
,
debugstr_w
(
wm
->
ldr
.
FullDllName
.
Buffer
));
if
(
!
TRACE_ON
(
module
))
TRACE_
(
loaddll
)(
"Unloaded module %s : %s
\n
"
,
debugstr_w
(
wm
->
ldr
.
FullDllName
.
Buffer
),
(
wm
->
ldr
.
Flags
&
LDR_WINE_INTERNAL
)
?
"builtin"
:
"native"
);
SERVER_START_REQ
(
unload_dll
)
{
req
->
base
=
wm
->
ldr
.
BaseAddress
;
wine_server_call
(
req
);
}
SERVER_END_REQ
;
NtUnmapViewOfSection
(
NtCurrentProcess
(),
wm
->
ldr
.
BaseAddress
);
if
(
wm
->
ldr
.
Flags
&
LDR_WINE_INTERNAL
)
wine_dll_unload
(
wm
->
ldr
.
SectionHandle
);
if
(
cached_modref
==
wm
)
cached_modref
=
NULL
;
RtlFreeUnicodeString
(
&
wm
->
ldr
.
FullDllName
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
wm
->
deps
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
wm
);
}
/***********************************************************************
* MODULE_FlushModrefs
*
...
...
@@ -1894,36 +1927,20 @@ static void MODULE_FlushModrefs(void)
mark
=
&
NtCurrentTeb
()
->
Peb
->
LdrData
->
InInitializationOrderModuleList
;
for
(
entry
=
mark
->
Blink
;
entry
!=
mark
;
entry
=
prev
)
{
mod
=
CONTAINING_RECORD
(
entry
,
LDR_MODULE
,
InInitializationOrderModuleList
);
mod
=
CONTAINING_RECORD
(
entry
,
LDR_MODULE
,
InInitializationOrderModuleList
);
wm
=
CONTAINING_RECORD
(
mod
,
WINE_MODREF
,
ldr
);
prev
=
entry
->
Blink
;
if
(
mod
->
LoadCount
)
continue
;
RemoveEntryList
(
&
mod
->
InLoadOrderModuleList
);
RemoveEntryList
(
&
mod
->
InMemoryOrderModuleList
);
RemoveEntryList
(
&
mod
->
InInitializationOrderModuleList
);
TRACE
(
" unloading %s
\n
"
,
debugstr_w
(
mod
->
FullDllName
.
Buffer
));
if
(
!
TRACE_ON
(
module
))
TRACE_
(
loaddll
)(
"Unloaded module %s : %s
\n
"
,
debugstr_w
(
mod
->
FullDllName
.
Buffer
),
(
wm
->
ldr
.
Flags
&
LDR_WINE_INTERNAL
)
?
"builtin"
:
"native"
);
SERVER_START_REQ
(
unload_dll
)
{
req
->
base
=
mod
->
BaseAddress
;
wine_server_call
(
req
);
if
(
!
mod
->
LoadCount
)
free_modref
(
wm
);
}
SERVER_END_REQ
;
NtUnmapViewOfSection
(
NtCurrentProcess
(),
mod
->
BaseAddress
);
if
(
wm
->
ldr
.
Flags
&
LDR_WINE_INTERNAL
)
wine_dll_unload
(
wm
->
ldr
.
SectionHandle
);
if
(
cached_modref
==
wm
)
cached_modref
=
NULL
;
RtlFreeUnicodeString
(
&
mod
->
FullDllName
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
wm
->
deps
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
wm
);
/* check load order list too for modules that haven't been initialized yet */
mark
=
&
NtCurrentTeb
()
->
Peb
->
LdrData
->
InLoadOrderModuleList
;
for
(
entry
=
mark
->
Blink
;
entry
!=
mark
;
entry
=
prev
)
{
mod
=
CONTAINING_RECORD
(
entry
,
LDR_MODULE
,
InLoadOrderModuleList
);
wm
=
CONTAINING_RECORD
(
mod
,
WINE_MODREF
,
ldr
);
prev
=
entry
->
Blink
;
if
(
!
mod
->
LoadCount
)
free_modref
(
wm
);
}
}
...
...
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