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
f404e309
Commit
f404e309
authored
Mar 30, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Don't fall back to dll loading for LOAD_LIBRARY_AS_DATAFILE.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c5b0dd5f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
26 deletions
+13
-26
module.c
dlls/kernel32/tests/module.c
+1
-6
loader.c
dlls/kernelbase/loader.c
+12
-20
No files found.
dlls/kernel32/tests/module.c
View file @
f404e309
...
...
@@ -377,11 +377,7 @@ static void testLoadLibraryEx(void)
SetLastError
(
0xdeadbeef
);
hmodule
=
LoadLibraryExA
(
"testfile.dll"
,
NULL
,
LOAD_LIBRARY_AS_DATAFILE
);
ok
(
hmodule
==
0
,
"Expected 0, got %p
\n
"
,
hmodule
);
todo_wine
{
ok
(
GetLastError
()
==
ERROR_FILE_INVALID
,
"Expected ERROR_FILE_INVALID, got %d
\n
"
,
GetLastError
());
}
ok
(
GetLastError
()
==
ERROR_FILE_INVALID
,
"Expected ERROR_FILE_INVALID, got %d
\n
"
,
GetLastError
());
DeleteFileA
(
"testfile.dll"
);
...
...
@@ -423,7 +419,6 @@ static void testLoadLibraryEx(void)
SetLastError
(
0xdeadbeef
);
hmodule
=
LoadLibraryExA
(
path
,
NULL
,
LOAD_LIBRARY_AS_DATAFILE
);
ok
(
hmodule
==
0
,
"Expected 0, got %p
\n
"
,
hmodule
);
todo_wine
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %d
\n
"
,
GetLastError
());
...
...
dlls/kernelbase/loader.c
View file @
f404e309
...
...
@@ -95,6 +95,7 @@ static BOOL load_library_as_datafile( LPCWSTR load_path, DWORD flags, LPCWSTR na
file
=
CreateFileW
(
filenameW
,
GENERIC_READ
,
FILE_SHARE_READ
|
FILE_SHARE_DELETE
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
}
if
(
file
==
INVALID_HANDLE_VALUE
)
ERR
(
"can't load %s
\n
"
,
debugstr_w
(
name
));
if
(
file
==
INVALID_HANDLE_VALUE
)
return
FALSE
;
mapping
=
CreateFileMappingW
(
file
,
NULL
,
protect
,
0
,
0
,
NULL
);
...
...
@@ -154,31 +155,22 @@ static HMODULE load_library( const UNICODE_STRING *libname, DWORD flags )
LdrLockLoaderLock
(
0
,
NULL
,
&
magic
);
if
(
!
LdrGetDllHandle
(
load_path
,
flags
,
libname
,
&
module
))
{
LdrAddRefDll
(
0
,
module
);
LdrUnlockLoaderLock
(
0
,
magic
);
goto
done
;
}
if
(
load_library_as_datafile
(
load_path
,
flags
,
libname
->
Buffer
,
&
module
))
{
LdrUnlockLoaderLock
(
0
,
magic
);
goto
done
;
}
else
load_library_as_datafile
(
load_path
,
flags
,
libname
->
Buffer
,
&
module
);
LdrUnlockLoaderLock
(
0
,
magic
);
flags
|=
DONT_RESOLVE_DLL_REFERENCES
;
/* Just in case */
/* Fallback to normal behaviour */
}
status
=
LdrLoadDll
(
load_path
,
flags
,
libname
,
&
module
);
if
(
status
!=
STATUS_SUCCESS
)
else
{
module
=
0
;
if
(
status
==
STATUS_DLL_NOT_FOUND
&&
(
GetVersion
()
&
0x80000000
))
SetLastError
(
ERROR_DLL_NOT_FOUND
);
else
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
status
=
LdrLoadDll
(
load_path
,
flags
,
libname
,
&
module
);
if
(
!
set_ntstatus
(
status
))
{
module
=
0
;
if
(
status
==
STATUS_DLL_NOT_FOUND
&&
(
GetVersion
()
&
0x80000000
))
SetLastError
(
ERROR_DLL_NOT_FOUND
);
}
}
done:
RtlReleasePath
(
load_path
);
return
module
;
}
...
...
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