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
42de71c3
Commit
42de71c3
authored
Mar 31, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fail to load non-existent dlls, except during prefix bootstrap.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8bcb44a9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
module.c
dlls/kernel32/tests/module.c
+3
-3
loader.c
dlls/ntdll/loader.c
+6
-1
No files found.
dlls/kernel32/tests/module.c
View file @
42de71c3
...
...
@@ -1093,7 +1093,7 @@ static void test_SetDefaultDllDirectories(void)
ret
=
pSetDefaultDllDirectories
(
LOAD_LIBRARY_SEARCH_USER_DIRS
);
ok
(
ret
,
"SetDefaultDllDirectories failed err %u
\n
"
,
GetLastError
()
);
mod
=
LoadLibraryA
(
"authz.dll"
);
todo_wine
ok
(
!
mod
,
"loading authz succeeded
\n
"
);
ok
(
!
mod
,
"loading authz succeeded
\n
"
);
FreeLibrary
(
mod
);
ret
=
pSetDefaultDllDirectories
(
LOAD_LIBRARY_SEARCH_SYSTEM32
);
ok
(
ret
,
"SetDefaultDllDirectories failed err %u
\n
"
,
GetLastError
()
);
...
...
@@ -1101,12 +1101,12 @@ static void test_SetDefaultDllDirectories(void)
ok
(
mod
!=
NULL
,
"loading authz failed
\n
"
);
FreeLibrary
(
mod
);
mod
=
LoadLibraryExA
(
"authz.dll"
,
0
,
LOAD_LIBRARY_SEARCH_APPLICATION_DIR
);
todo_wine
ok
(
!
mod
,
"loading authz succeeded
\n
"
);
ok
(
!
mod
,
"loading authz succeeded
\n
"
);
FreeLibrary
(
mod
);
ret
=
pSetDefaultDllDirectories
(
LOAD_LIBRARY_SEARCH_APPLICATION_DIR
);
ok
(
ret
,
"SetDefaultDllDirectories failed err %u
\n
"
,
GetLastError
()
);
mod
=
LoadLibraryA
(
"authz.dll"
);
todo_wine
ok
(
!
mod
,
"loading authz succeeded
\n
"
);
ok
(
!
mod
,
"loading authz succeeded
\n
"
);
FreeLibrary
(
mod
);
ret
=
pSetDefaultDllDirectories
(
LOAD_LIBRARY_SEARCH_DEFAULT_DIRS
);
ok
(
ret
,
"SetDefaultDllDirectories failed err %u
\n
"
,
GetLastError
()
);
...
...
dlls/ntdll/loader.c
View file @
42de71c3
...
...
@@ -73,6 +73,7 @@ BOOL is_wow64 = FALSE;
/* system search path */
static
const
WCHAR
system_path
[]
=
L"C:
\\
windows
\\
system32;C:
\\
windows
\\
system;C:
\\
windows"
;
static
BOOL
is_prefix_bootstrap
;
/* are we bootstrapping the prefix? */
static
BOOL
imports_fixup_done
=
FALSE
;
/* set once the imports have been fixed up, before attaching them */
static
BOOL
process_detaching
=
FALSE
;
/* set on process detach to avoid deadlocks with thread detach */
static
int
free_lib_count
;
/* recursion depth of LdrUnloadDll calls */
...
...
@@ -1918,10 +1919,14 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name,
static
void
build_ntdll_module
(
void
)
{
MEMORY_BASIC_INFORMATION
meminfo
;
FILE_BASIC_INFORMATION
basic_info
;
UNICODE_STRING
nt_name
;
OBJECT_ATTRIBUTES
attr
;
WINE_MODREF
*
wm
;
RtlInitUnicodeString
(
&
nt_name
,
L"
\\
??
\\
C:
\\
windows
\\
system32
\\
ntdll.dll"
);
InitializeObjectAttributes
(
&
attr
,
&
nt_name
,
OBJ_CASE_INSENSITIVE
,
0
,
NULL
);
is_prefix_bootstrap
=
NtQueryAttributesFile
(
&
attr
,
&
basic_info
)
!=
STATUS_SUCCESS
;
NtQueryVirtualMemory
(
GetCurrentProcess
(),
build_ntdll_module
,
MemoryBasicInformation
,
&
meminfo
,
sizeof
(
meminfo
),
NULL
);
wm
=
alloc_module
(
meminfo
.
AllocationBase
,
&
nt_name
,
TRUE
);
...
...
@@ -2647,7 +2652,7 @@ static NTSTATUS search_dll_file( LPCWSTR paths, LPCWSTR search, UNICODE_STRING *
if
(
found_image
)
status
=
STATUS_IMAGE_MACHINE_TYPE_MISMATCH
;
else
if
(
!
wcspbrk
(
search
,
L":/
\\
"
))
else
if
(
is_prefix_bootstrap
&&
!
wcspbrk
(
search
,
L":/
\\
"
))
status
=
find_builtin_without_file
(
search
,
nt_name
,
pwm
,
mapping
,
image_info
,
id
);
done:
...
...
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