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
8c11d71f
Commit
8c11d71f
authored
Aug 12, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Add a 64-bit flag to the MODULE_GetBinaryType return value.
parent
4a59ac76
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
9 deletions
+17
-9
kernel_private.h
dlls/kernel32/kernel_private.h
+1
-0
module.c
dlls/kernel32/module.c
+16
-9
No files found.
dlls/kernel32/kernel_private.h
View file @
8c11d71f
...
...
@@ -92,6 +92,7 @@ extern LONG CALLBACK INSTR_vectored_handler( EXCEPTION_POINTERS *ptrs );
#define BINARY_UNIX_LIB 0x06
#define BINARY_TYPE_MASK 0x0f
#define BINARY_FLAG_DLL 0x10
#define BINARY_FLAG_64BIT 0x20
/* module.c */
extern
WCHAR
*
MODULE_get_dll_load_path
(
LPCWSTR
module
);
...
...
dlls/kernel32/module.c
View file @
8c11d71f
...
...
@@ -233,15 +233,19 @@ DWORD MODULE_GetBinaryType( HANDLE hfile, void **res_start, void **res_end )
struct
{
unsigned
char
magic
[
4
];
unsigned
char
ignored
[
12
];
unsigned
char
class
;
unsigned
char
data
;
unsigned
char
version
;
unsigned
char
ignored
[
9
];
unsigned
short
type
;
unsigned
short
machine
;
}
elf
;
struct
{
unsigned
long
magic
;
unsigned
long
cputype
;
unsigned
long
cpusubtype
;
unsigned
long
filetype
;
unsigned
int
magic
;
unsigned
int
cputype
;
unsigned
int
cpusubtype
;
unsigned
int
filetype
;
}
macho
;
IMAGE_DOS_HEADER
mz
;
}
header
;
...
...
@@ -256,11 +260,12 @@ DWORD MODULE_GetBinaryType( HANDLE hfile, void **res_start, void **res_end )
if
(
!
memcmp
(
header
.
elf
.
magic
,
"
\177
ELF"
,
4
))
{
DWORD
flags
=
(
header
.
elf
.
class
==
2
)
?
BINARY_FLAG_64BIT
:
0
;
/* FIXME: we don't bother to check byte order, architecture, etc. */
switch
(
header
.
elf
.
type
)
{
case
2
:
return
BINARY_UNIX_EXE
;
case
3
:
return
BINARY_UNIX_LIB
;
case
2
:
return
flags
|
BINARY_UNIX_EXE
;
case
3
:
return
flags
|
BINARY_UNIX_LIB
;
}
return
BINARY_UNKNOWN
;
}
...
...
@@ -268,9 +273,11 @@ DWORD MODULE_GetBinaryType( HANDLE hfile, void **res_start, void **res_end )
/* Mach-o File with Endian set to Big Endian or Little Endian */
if
(
header
.
macho
.
magic
==
0xfeedface
||
header
.
macho
.
magic
==
0xcefaedfe
)
{
DWORD
flags
=
(
header
.
macho
.
cputype
>>
24
)
==
1
?
BINARY_FLAG_64BIT
:
0
;
switch
(
header
.
macho
.
filetype
)
{
case
0x8
:
/* MH_BUNDLE */
return
BINARY_UNIX_LIB
;
case
2
:
return
flags
|
BINARY_UNIX_EXE
;
case
8
:
return
flags
|
BINARY_UNIX_LIB
;
}
return
BINARY_UNKNOWN
;
}
...
...
@@ -321,7 +328,7 @@ DWORD MODULE_GetBinaryType( HANDLE hfile, void **res_start, void **res_end )
case
IMAGE_NT_OPTIONAL_HDR64_MAGIC
:
if
(
res_start
)
*
res_start
=
NULL
;
if
(
res_end
)
*
res_end
=
NULL
;
return
ret
;
return
ret
|
BINARY_FLAG_64BIT
;
}
}
return
BINARY_DOS
;
...
...
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