Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
fa5b5102
Commit
fa5b5102
authored
19 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
ntdll: Moved LDR_DONT_RESOLVE_REFS handling into fixup_imports.
This ensures that we never fixup imports twice on the same dll.
parent
39a1a942
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/ntdll/loader.c
+6
-9
6 additions, 9 deletions
dlls/ntdll/loader.c
with
6 additions
and
9 deletions
dlls/ntdll/loader.c
+
6
−
9
View file @
fa5b5102
...
@@ -584,6 +584,9 @@ static NTSTATUS fixup_imports( WINE_MODREF *wm, LPCWSTR load_path )
...
@@ -584,6 +584,9 @@ static NTSTATUS fixup_imports( WINE_MODREF *wm, LPCWSTR load_path )
DWORD
size
;
DWORD
size
;
NTSTATUS
status
;
NTSTATUS
status
;
if
(
!
(
wm
->
ldr
.
Flags
&
LDR_DONT_RESOLVE_REFS
))
return
STATUS_SUCCESS
;
/* already done */
wm
->
ldr
.
Flags
&=
~
LDR_DONT_RESOLVE_REFS
;
if
(
!
(
imports
=
RtlImageDirectoryEntryToData
(
wm
->
ldr
.
BaseAddress
,
TRUE
,
if
(
!
(
imports
=
RtlImageDirectoryEntryToData
(
wm
->
ldr
.
BaseAddress
,
TRUE
,
IMAGE_DIRECTORY_ENTRY_IMPORT
,
&
size
)))
IMAGE_DIRECTORY_ENTRY_IMPORT
,
&
size
)))
return
STATUS_SUCCESS
;
return
STATUS_SUCCESS
;
...
@@ -634,7 +637,7 @@ static WINE_MODREF *alloc_module( HMODULE hModule, LPCWSTR filename )
...
@@ -634,7 +637,7 @@ static WINE_MODREF *alloc_module( HMODULE hModule, LPCWSTR filename )
wm
->
ldr
.
BaseAddress
=
hModule
;
wm
->
ldr
.
BaseAddress
=
hModule
;
wm
->
ldr
.
EntryPoint
=
NULL
;
wm
->
ldr
.
EntryPoint
=
NULL
;
wm
->
ldr
.
SizeOfImage
=
nt
->
OptionalHeader
.
SizeOfImage
;
wm
->
ldr
.
SizeOfImage
=
nt
->
OptionalHeader
.
SizeOfImage
;
wm
->
ldr
.
Flags
=
0
;
wm
->
ldr
.
Flags
=
LDR_DONT_RESOLVE_REFS
;
wm
->
ldr
.
LoadCount
=
0
;
wm
->
ldr
.
LoadCount
=
0
;
wm
->
ldr
.
TlsIndex
=
-
1
;
wm
->
ldr
.
TlsIndex
=
-
1
;
wm
->
ldr
.
SectionHandle
=
NULL
;
wm
->
ldr
.
SectionHandle
=
NULL
;
...
@@ -1393,7 +1396,6 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file,
...
@@ -1393,7 +1396,6 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file,
return
status
;
return
status
;
}
}
}
}
else
wm
->
ldr
.
Flags
|=
LDR_DONT_RESOLVE_REFS
;
/* send DLL load event */
/* send DLL load event */
...
@@ -1682,12 +1684,8 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_
...
@@ -1682,12 +1684,8 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_
{
{
if
((
*
pwm
)
->
ldr
.
LoadCount
!=
-
1
)
(
*
pwm
)
->
ldr
.
LoadCount
++
;
if
((
*
pwm
)
->
ldr
.
LoadCount
!=
-
1
)
(
*
pwm
)
->
ldr
.
LoadCount
++
;
if
(((
*
pwm
)
->
ldr
.
Flags
&
LDR_DONT_RESOLVE_REFS
)
&&
if
(
!
(
flags
&
DONT_RESOLVE_DLL_REFERENCES
))
fixup_imports
(
*
pwm
,
load_path
);
!
(
flags
&
DONT_RESOLVE_DLL_REFERENCES
))
{
(
*
pwm
)
->
ldr
.
Flags
&=
~
LDR_DONT_RESOLVE_REFS
;
fixup_imports
(
*
pwm
,
load_path
);
}
TRACE
(
"Found loaded module %s for %s at %p, count=%d
\n
"
,
TRACE
(
"Found loaded module %s for %s at %p, count=%d
\n
"
,
debugstr_w
((
*
pwm
)
->
ldr
.
FullDllName
.
Buffer
),
debugstr_w
(
libname
),
debugstr_w
((
*
pwm
)
->
ldr
.
FullDllName
.
Buffer
),
debugstr_w
(
libname
),
(
*
pwm
)
->
ldr
.
BaseAddress
,
(
*
pwm
)
->
ldr
.
LoadCount
);
(
*
pwm
)
->
ldr
.
BaseAddress
,
(
*
pwm
)
->
ldr
.
LoadCount
);
...
@@ -2044,7 +2042,6 @@ void WINAPI LdrInitializeThunk( ULONG unknown1, ULONG unknown2, ULONG unknown3,
...
@@ -2044,7 +2042,6 @@ void WINAPI LdrInitializeThunk( ULONG unknown1, ULONG unknown2, ULONG unknown3,
goto
error
;
goto
error
;
}
}
wm
->
ldr
.
LoadCount
=
-
1
;
/* can't unload main exe */
wm
->
ldr
.
LoadCount
=
-
1
;
/* can't unload main exe */
wm
->
ldr
.
Flags
&=
~
LDR_DONT_RESOLVE_REFS
;
peb
->
ProcessParameters
->
ImagePathName
=
wm
->
ldr
.
FullDllName
;
peb
->
ProcessParameters
->
ImagePathName
=
wm
->
ldr
.
FullDllName
;
version_init
(
wm
->
ldr
.
FullDllName
.
Buffer
);
version_init
(
wm
->
ldr
.
FullDllName
.
Buffer
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment