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
ca311b3f
Commit
ca311b3f
authored
Feb 21, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Support loading a builtin under a different name.
Find the proper modref in that case based on the dlopen handle.
parent
fa5b5102
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
17 deletions
+21
-17
loader.c
dlls/ntdll/loader.c
+21
-17
No files found.
dlls/ntdll/loader.c
View file @
ca311b3f
...
...
@@ -1519,28 +1519,31 @@ static NTSTATUS load_builtin_dll( LPCWSTR load_path, LPCWSTR path, HANDLE file,
if
(
!
info
.
wm
)
{
/* The constructor wasn't called, this means the .so is already
* loaded under a different name. We can't support multiple names
* for the same module, so return an error. */
return
STATUS_INVALID_IMAGE_FORMAT
;
}
PLIST_ENTRY
mark
,
entry
;
TRACE_
(
loaddll
)(
"Loaded module %s : builtin
\n
"
,
debugstr_w
(
info
.
wm
->
ldr
.
FullDllName
.
Buffer
)
);
/* The constructor wasn't called, this means the .so is already
* loaded under a different name. Try to find the wm for it. */
info
.
wm
->
ldr
.
SectionHandle
=
handle
;
if
(
strcmpiW
(
info
.
wm
->
ldr
.
BaseDllName
.
Buffer
,
name
))
{
/* check without .so extension */
static
const
WCHAR
soW
[]
=
{
'.'
,
's'
,
'o'
,
0
};
DWORD
len
=
info
.
wm
->
ldr
.
BaseDllName
.
Length
/
sizeof
(
WCHAR
);
if
(
strncmpiW
(
info
.
wm
->
ldr
.
BaseDllName
.
Buffer
,
name
,
len
)
||
strcmpiW
(
name
+
len
,
soW
))
mark
=
&
NtCurrentTeb
()
->
Peb
->
LdrData
->
InLoadOrderModuleList
;
for
(
entry
=
mark
->
Flink
;
entry
!=
mark
;
entry
=
entry
->
Flink
)
{
ERR
(
"loaded .so for %s but got %s instead - probably 16-bit dll
\n
"
,
debugstr_w
(
name
),
debugstr_w
(
info
.
wm
->
ldr
.
BaseDllName
.
Buffer
)
);
/* wine_dll_unload( handle );*/
return
STATUS_INVALID_IMAGE_FORMAT
;
LDR_MODULE
*
mod
=
CONTAINING_RECORD
(
entry
,
LDR_MODULE
,
InLoadOrderModuleList
);
if
(
mod
->
Flags
&
LDR_WINE_INTERNAL
&&
mod
->
SectionHandle
==
handle
)
{
info
.
wm
=
CONTAINING_RECORD
(
mod
,
WINE_MODREF
,
ldr
);
TRACE
(
"Found already loaded module %s for builtin %s
\n
"
,
debugstr_w
(
info
.
wm
->
ldr
.
FullDllName
.
Buffer
),
debugstr_w
(
path
)
);
break
;
}
}
if
(
!
info
.
wm
)
return
STATUS_INVALID_IMAGE_FORMAT
;
}
else
{
TRACE_
(
loaddll
)(
"Loaded module %s : builtin
\n
"
,
debugstr_w
(
info
.
wm
->
ldr
.
FullDllName
.
Buffer
)
);
info
.
wm
->
ldr
.
SectionHandle
=
handle
;
}
*
pwm
=
info
.
wm
;
return
STATUS_SUCCESS
;
}
...
...
@@ -1712,6 +1715,7 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_
break
;
case
LOADORDER_BI
:
nts
=
load_builtin_dll
(
load_path
,
filename
,
handle
,
flags
,
pwm
);
if
(
nts
==
STATUS_SUCCESS
)
break
;
if
(
!
handle
)
break
;
/* nothing else we can try */
/* file is not a builtin library, try without using the specified file */
nts
=
load_builtin_dll
(
load_path
,
filename
,
0
,
flags
,
pwm
);
...
...
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