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
96fc6e31
Commit
96fc6e31
authored
Mar 05, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fixed handling of fake dlls when loading a builtin. Reported by Jacek Caban.
parent
8d8b4408
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
loader.c
dlls/ntdll/loader.c
+16
-9
No files found.
dlls/ntdll/loader.c
View file @
96fc6e31
...
...
@@ -1244,11 +1244,18 @@ NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE module, const ANSI_STRING *name,
*
* Check if a loaded native dll is a Wine fake dll.
*/
static
BOOL
is_fake_dll
(
const
void
*
bas
e
)
static
BOOL
is_fake_dll
(
HANDLE
handl
e
)
{
static
const
char
fakedll_signature
[]
=
"Wine placeholder DLL"
;
const
IMAGE_DOS_HEADER
*
dos
=
base
;
char
buffer
[
sizeof
(
IMAGE_DOS_HEADER
)
+
sizeof
(
fakedll_signature
)];
const
IMAGE_DOS_HEADER
*
dos
=
(
const
IMAGE_DOS_HEADER
*
)
buffer
;
IO_STATUS_BLOCK
io
;
LARGE_INTEGER
offset
;
offset
.
QuadPart
=
0
;
if
(
NtReadFile
(
handle
,
0
,
NULL
,
0
,
&
io
,
buffer
,
sizeof
(
buffer
),
&
offset
,
NULL
))
return
FALSE
;
if
(
io
.
Information
<
sizeof
(
buffer
))
return
FALSE
;
if
(
dos
->
e_magic
!=
IMAGE_DOS_SIGNATURE
)
return
FALSE
;
if
(
dos
->
e_lfanew
>=
sizeof
(
*
dos
)
+
sizeof
(
fakedll_signature
)
&&
!
memcmp
(
dos
+
1
,
fakedll_signature
,
sizeof
(
fakedll_signature
)
))
return
TRUE
;
return
FALSE
;
...
...
@@ -1427,13 +1434,6 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file,
NtClose
(
mapping
);
if
(
status
!=
STATUS_SUCCESS
)
return
status
;
if
(
is_fake_dll
(
module
))
{
TRACE
(
"%s is a fake dll, not loading it
\n
"
,
debugstr_w
(
name
)
);
NtUnmapViewOfSection
(
NtCurrentProcess
(),
module
);
return
STATUS_DLL_NOT_FOUND
;
}
/* create the MODREF */
if
(
!
(
wm
=
alloc_module
(
module
,
name
)))
return
STATUS_NO_MEMORY
;
...
...
@@ -1870,6 +1870,13 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_
main_exe
=
get_modref
(
NtCurrentTeb
()
->
Peb
->
ImageBaseAddress
);
loadorder
=
get_load_order
(
main_exe
?
main_exe
->
ldr
.
BaseDllName
.
Buffer
:
NULL
,
filename
);
if
(
handle
&&
is_fake_dll
(
handle
))
{
TRACE
(
"%s is a fake Wine dll
\n
"
,
debugstr_w
(
filename
)
);
NtClose
(
handle
);
handle
=
0
;
}
switch
(
loadorder
)
{
case
LO_INVALID
:
...
...
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