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
250c1131
Commit
250c1131
authored
Nov 02, 2021
by
Paul Gofman
Committed by
Alexandre Julliard
Nov 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Factor out is_import_dll_system() function.
Signed-off-by:
Paul Gofman
<
pgofman@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0dd37b02
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
loader.c
dlls/ntdll/loader.c
+12
-9
No files found.
dlls/ntdll/loader.c
View file @
250c1131
...
...
@@ -585,6 +585,16 @@ static WINE_MODREF *find_fileid_module( const struct file_id *id )
return
NULL
;
}
/***********************************************************************
* is_import_dll_system
*/
static
BOOL
is_import_dll_system
(
LDR_DATA_TABLE_ENTRY
*
mod
,
const
IMAGE_IMPORT_DESCRIPTOR
*
import
)
{
const
char
*
name
=
get_rva
(
mod
->
DllBase
,
import
->
Name
);
return
!
strcmp
(
name
,
"ntdll.dll"
)
||
!
strcmp
(
name
,
"kernel32.dll"
);
}
/**********************************************************************
* insert_single_list_tail
*/
...
...
@@ -1066,7 +1076,6 @@ static BOOL is_dll_native_subsystem( LDR_DATA_TABLE_ENTRY *mod, const IMAGE_NT_H
{
const
IMAGE_IMPORT_DESCRIPTOR
*
imports
;
DWORD
i
,
size
;
WCHAR
buffer
[
16
];
if
(
nt
->
OptionalHeader
.
Subsystem
!=
IMAGE_SUBSYSTEM_NATIVE
)
return
FALSE
;
if
(
nt
->
OptionalHeader
.
SectionAlignment
<
page_size
)
return
TRUE
;
...
...
@@ -1076,17 +1085,11 @@ static BOOL is_dll_native_subsystem( LDR_DATA_TABLE_ENTRY *mod, const IMAGE_NT_H
IMAGE_DIRECTORY_ENTRY_IMPORT
,
&
size
)))
{
for
(
i
=
0
;
imports
[
i
].
Name
;
i
++
)
{
const
char
*
name
=
get_rva
(
mod
->
DllBase
,
imports
[
i
].
Name
);
DWORD
len
=
strlen
(
name
);
if
(
len
*
sizeof
(
WCHAR
)
>=
sizeof
(
buffer
))
continue
;
ascii_to_unicode
(
buffer
,
name
,
len
+
1
);
if
(
!
wcsicmp
(
buffer
,
L"ntdll.dll"
)
||
!
wcsicmp
(
buffer
,
L"kernel32.dll"
))
if
(
is_import_dll_system
(
mod
,
&
imports
[
i
]
))
{
TRACE
(
"%s imports
%s, assuming not native
\n
"
,
debugstr_w
(
filename
),
debugstr_w
(
buffer
)
);
TRACE
(
"%s imports
system dll, assuming not native
\n
"
,
debugstr_w
(
filename
)
);
return
FALSE
;
}
}
}
return
TRUE
;
}
...
...
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