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
97b09074
Commit
97b09074
authored
Feb 28, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Allow loading 32-bit IL-only binaries on 64-bit.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6d6669fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
loader.c
dlls/ntdll/loader.c
+15
-6
No files found.
dlls/ntdll/loader.c
View file @
97b09074
...
...
@@ -1809,18 +1809,27 @@ static NTSTATUS perform_relocations( void *module, SIZE_T len )
/* On WoW64 setups, an image mapping can also be created for the other 32/64 CPU */
/* but it cannot necessarily be loaded as a dll, so we need some additional checks */
static
BOOL
is_valid_binary
(
const
pe_image_info_t
*
info
)
static
BOOL
is_valid_binary
(
HMODULE
module
,
const
pe_image_info_t
*
info
)
{
#ifdef __i386__
return
info
->
machine
==
IMAGE_FILE_MACHINE_I386
;
#elif defined(__x86_64__)
return
info
->
machine
==
IMAGE_FILE_MACHINE_AMD64
||
!
info
->
contains_code
;
#elif defined(__arm__)
return
info
->
machine
==
IMAGE_FILE_MACHINE_ARM
||
info
->
machine
==
IMAGE_FILE_MACHINE_THUMB
||
info
->
machine
==
IMAGE_FILE_MACHINE_ARMNT
;
#elif defined(__aarch64__)
return
info
->
machine
==
IMAGE_FILE_MACHINE_ARM64
||
!
info
->
contains_code
;
#elif defined(__x86_64__) || defined(__aarch64__)
/* support 32-bit IL-only images on 64-bit */
const
IMAGE_COR20_HEADER
*
cor_header
;
DWORD
size
;
#ifdef __x86_64__
if
(
info
->
machine
==
IMAGE_FILE_MACHINE_AMD64
)
return
TRUE
;
#else
if
(
info
->
machine
==
IMAGE_FILE_MACHINE_ARM64
)
return
TRUE
;
#endif
if
(
!
info
->
contains_code
)
return
TRUE
;
cor_header
=
RtlImageDirectoryEntryToData
(
module
,
TRUE
,
IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR
,
&
size
);
if
(
cor_header
&&
(
cor_header
->
Flags
&
COMIMAGE_FLAGS_ILONLY
))
return
TRUE
;
return
FALSE
;
#else
return
FALSE
;
/* no wow64 support on other platforms */
#endif
...
...
@@ -1855,7 +1864,7 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file,
NtClose
(
mapping
);
if
((
status
==
STATUS_SUCCESS
||
status
==
STATUS_IMAGE_NOT_AT_BASE
)
&&
!
is_valid_binary
(
&
image_info
))
!
is_valid_binary
(
module
,
&
image_info
))
{
NtUnmapViewOfSection
(
NtCurrentProcess
(),
module
);
return
STATUS_INVALID_IMAGE_FORMAT
;
...
...
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