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
68ea200f
Commit
68ea200f
authored
19 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
ntdll: Support loading builtin dlls with an explicit path name also
when loadorder is set to builtin only.
parent
19e29d60
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
+34
-33
34 additions, 33 deletions
dlls/ntdll/loader.c
with
34 additions
and
33 deletions
dlls/ntdll/loader.c
+
34
−
33
View file @
68ea200f
...
...
@@ -1349,7 +1349,7 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file,
WINE_MODREF
*
wm
;
NTSTATUS
status
;
TRACE
(
"loading
%s
\n
"
,
debugstr_w
(
name
)
);
TRACE
(
"Trying native dll
%s
\n
"
,
debugstr_w
(
name
));
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
...
...
@@ -1456,6 +1456,8 @@ static NTSTATUS load_builtin_dll( LPCWSTR load_path, LPCWSTR path, HANDLE file,
UNICODE_STRING
nt_name
;
ANSI_STRING
unix_name
;
TRACE
(
"Trying built-in %s
\n
"
,
debugstr_w
(
path
));
if
(
!
RtlDosPathNameToNtPathName_U
(
path
,
&
nt_name
,
NULL
,
NULL
))
return
STATUS_DLL_NOT_FOUND
;
...
...
@@ -1481,6 +1483,8 @@ static NTSTATUS load_builtin_dll( LPCWSTR load_path, LPCWSTR path, HANDLE file,
{
int
file_exists
;
TRACE
(
"Trying built-in %s
\n
"
,
debugstr_w
(
name
));
/* we don't want to depend on the current codepage here */
len
=
strlenW
(
name
)
+
1
;
if
(
len
>=
sizeof
(
dllname
))
return
STATUS_NAME_TOO_LONG
;
...
...
@@ -1652,7 +1656,6 @@ overflow:
*/
static
NTSTATUS
load_dll
(
LPCWSTR
load_path
,
LPCWSTR
libname
,
DWORD
flags
,
WINE_MODREF
**
pwm
)
{
int
i
;
enum
loadorder_type
loadorder
[
LOADORDER_NTYPES
];
WCHAR
buffer
[
32
];
WCHAR
*
filename
;
...
...
@@ -1696,45 +1699,43 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_
MODULE_GetLoadOrderW
(
loadorder
,
main_exe
?
main_exe
->
ldr
.
BaseDllName
.
Buffer
:
NULL
,
filename
);
nts
=
STATUS_DLL_NOT_FOUND
;
for
(
i
=
0
;
i
<
LOADORDER_NTYPES
;
i
++
)
switch
(
loadorder
[
0
]
)
{
if
(
loadorder
[
i
]
==
LOADORDER_INVALID
)
break
;
switch
(
loadorder
[
i
])
case
LOADORDER_DLL
:
if
(
handle
)
{
case
LOADORDER_DLL
:
TRACE
(
"Trying native dll %s
\n
"
,
debugstr_w
(
filename
));
if
(
!
handle
)
continue
;
/* it cannot possibly be loaded */
nts
=
load_native_dll
(
load_path
,
filename
,
handle
,
flags
,
pwm
);
if
(
nts
==
STATUS_INVALID_FILE_FOR_SECTION
)
{
/* not in PE format, maybe it's a builtin */
nts
=
load_builtin_dll
(
load_path
,
filename
,
handle
,
flags
,
pwm
);
}
break
;
case
LOADORDER_BI
:
TRACE
(
"Trying built-in %s
\n
"
,
debugstr_w
(
filename
));
nts
=
load_builtin_dll
(
load_path
,
filename
,
0
,
flags
,
pwm
);
break
;
default:
nts
=
STATUS_INTERNAL_ERROR
;
break
;
}
if
(
nts
==
STATUS_DLL_NOT_FOUND
&&
loadorder
[
1
]
==
LOADORDER_BI
)
nts
=
load_builtin_dll
(
load_path
,
filename
,
0
,
flags
,
pwm
);
break
;
case
LOADORDER_BI
:
nts
=
load_builtin_dll
(
load_path
,
filename
,
handle
,
flags
,
pwm
);
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
);
if
(
nts
==
STATUS_DLL_NOT_FOUND
&&
loadorder
[
1
]
==
LOADORDER_DLL
)
nts
=
load_native_dll
(
load_path
,
filename
,
handle
,
flags
,
pwm
);
break
;
default:
break
;
}
if
(
nts
==
STATUS_SUCCESS
)
{
/* Initialize DLL just loaded */
TRACE
(
"Loaded module %s (%s) at %p
\n
"
,
debugstr_w
(
filename
),
((
*
pwm
)
->
ldr
.
Flags
&
LDR_WINE_INTERNAL
)
?
"builtin"
:
"native"
,
(
*
pwm
)
->
ldr
.
BaseAddress
);
/* Set the ldr.LoadCount here so that an attach failure will */
/* decrement the dependencies through the MODULE_FreeLibrary call. */
(
*
pwm
)
->
ldr
.
LoadCount
=
1
;
if
(
handle
)
NtClose
(
handle
);
if
(
filename
!=
buffer
)
RtlFreeHeap
(
GetProcessHeap
(),
0
,
filename
);
return
nts
;
}
if
(
nts
!=
STATUS_DLL_NOT_FOUND
)
break
;
if
(
nts
==
STATUS_SUCCESS
)
{
/* Initialize DLL just loaded */
TRACE
(
"Loaded module %s (%s) at %p
\n
"
,
debugstr_w
(
filename
),
((
*
pwm
)
->
ldr
.
Flags
&
LDR_WINE_INTERNAL
)
?
"builtin"
:
"native"
,
(
*
pwm
)
->
ldr
.
BaseAddress
);
/* Set the ldr.LoadCount here so that an attach failure will */
/* decrement the dependencies through the MODULE_FreeLibrary call. */
(
*
pwm
)
->
ldr
.
LoadCount
=
1
;
if
(
handle
)
NtClose
(
handle
);
if
(
filename
!=
buffer
)
RtlFreeHeap
(
GetProcessHeap
(),
0
,
filename
);
return
nts
;
}
WARN
(
"Failed to load module %s; status=%lx
\n
"
,
debugstr_w
(
libname
),
nts
);
...
...
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