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
1d49a57e
Commit
1d49a57e
authored
Oct 23, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Also set the preloader range for 64-bit binaries.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
24a10e30
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
16 deletions
+20
-16
kernel_private.h
dlls/kernel32/kernel_private.h
+2
-2
module.c
dlls/kernel32/module.c
+7
-5
process.c
dlls/kernel32/process.c
+11
-9
No files found.
dlls/kernel32/kernel_private.h
View file @
1d49a57e
...
...
@@ -84,8 +84,8 @@ struct binary_info
enum
binary_type
type
;
DWORD
arch
;
DWORD
flags
;
void
*
res_start
;
void
*
res_end
;
ULONGLONG
res_start
;
ULONGLONG
res_end
;
};
/* module.c */
...
...
dlls/kernel32/module.c
View file @
1d49a57e
...
...
@@ -394,6 +394,7 @@ void MODULE_get_binary_info( HANDLE hfile, struct binary_info *info )
{
IMAGE_OS2_HEADER
os2
;
IMAGE_NT_HEADERS32
nt
;
IMAGE_NT_HEADERS64
nt64
;
}
ext_header
;
/* We do have a DOS image so we will now try to seek into
...
...
@@ -422,16 +423,17 @@ void MODULE_get_binary_info( HANDLE hfile, struct binary_info *info )
info
->
arch
=
ext_header
.
nt
.
FileHeader
.
Machine
;
if
(
ext_header
.
nt
.
FileHeader
.
Characteristics
&
IMAGE_FILE_DLL
)
info
->
flags
|=
BINARY_FLAG_DLL
;
if
(
len
<
sizeof
(
ext_header
.
nt
))
/* clear remaining part of header if missing */
memset
(
(
char
*
)
&
ext_header
.
nt
+
len
,
0
,
sizeof
(
ext_header
.
nt
)
-
len
);
if
(
len
<
sizeof
(
ext_header
))
/* clear remaining part of header if missing */
memset
(
(
char
*
)
&
ext_header
+
len
,
0
,
sizeof
(
ext_header
)
-
len
);
switch
(
ext_header
.
nt
.
OptionalHeader
.
Magic
)
{
case
IMAGE_NT_OPTIONAL_HDR32_MAGIC
:
info
->
res_start
=
(
void
*
)(
ULONG_PTR
)
ext_header
.
nt
.
OptionalHeader
.
ImageBase
;
info
->
res_end
=
(
void
*
)((
ULONG_PTR
)
ext_header
.
nt
.
OptionalHeader
.
ImageBase
+
ext_header
.
nt
.
OptionalHeader
.
SizeOfImage
);
info
->
res_start
=
ext_header
.
nt
.
OptionalHeader
.
ImageBase
;
info
->
res_end
=
info
->
res_start
+
ext_header
.
nt
.
OptionalHeader
.
SizeOfImage
;
break
;
case
IMAGE_NT_OPTIONAL_HDR64_MAGIC
:
info
->
res_start
=
ext_header
.
nt64
.
OptionalHeader
.
ImageBase
;
info
->
res_end
=
info
->
res_start
+
ext_header
.
nt64
.
OptionalHeader
.
SizeOfImage
;
info
->
flags
|=
BINARY_FLAG_64BIT
;
break
;
}
...
...
dlls/kernel32/process.c
View file @
1d49a57e
...
...
@@ -207,8 +207,8 @@ static BOOL get_builtin_path( const WCHAR *libname, const WCHAR *ext, WCHAR *fil
}
binary_info
->
type
=
BINARY_UNIX_LIB
;
binary_info
->
flags
=
flags
;
binary_info
->
res_start
=
NULL
;
binary_info
->
res_end
=
NULL
;
binary_info
->
res_start
=
0
;
binary_info
->
res_end
=
0
;
/* assume current arch */
#if defined(__i386__) || defined(__x86_64__)
binary_info
->
arch
=
(
flags
&
BINARY_FLAG_64BIT
)
?
IMAGE_FILE_MACHINE_AMD64
:
IMAGE_FILE_MACHINE_I386
;
...
...
@@ -1930,8 +1930,9 @@ static pid_t exec_loader( LPCWSTR cmd_line, unsigned int flags, int socketfd,
signal
(
SIGPIPE
,
SIG_DFL
);
sprintf
(
socket_env
,
"WINESERVERSOCKET=%u"
,
socketfd
);
sprintf
(
preloader_reserve
,
"WINEPRELOADRESERVE=%lx-%lx"
,
(
unsigned
long
)
binary_info
->
res_start
,
(
unsigned
long
)
binary_info
->
res_end
);
sprintf
(
preloader_reserve
,
"WINEPRELOADRESERVE=%x%08x-%x%08x"
,
(
ULONG
)(
binary_info
->
res_start
>>
32
),
(
ULONG
)
binary_info
->
res_start
,
(
ULONG
)(
binary_info
->
res_end
>>
32
),
(
ULONG
)
binary_info
->
res_end
);
putenv
(
preloader_reserve
);
putenv
(
socket_env
);
...
...
@@ -2403,10 +2404,10 @@ static BOOL create_process_impl( LPCWSTR app_name, LPWSTR cmd_line, LPSECURITY_A
else
switch
(
binary_info
.
type
)
{
case
BINARY_PE
:
TRACE
(
"starting %s as Win%d binary (%
p-%p
, arch %04x%s)
\n
"
,
TRACE
(
"starting %s as Win%d binary (%
s-%s
, arch %04x%s)
\n
"
,
debugstr_w
(
name
),
(
binary_info
.
flags
&
BINARY_FLAG_64BIT
)
?
64
:
32
,
binary_info
.
res_start
,
binary_info
.
res_end
,
binary_info
.
arch
,
(
binary_info
.
flags
&
BINARY_FLAG_FAKEDLL
)
?
", fakedll"
:
""
);
wine_dbgstr_longlong
(
binary_info
.
res_start
),
wine_dbgstr_longlong
(
binary_info
.
res_end
)
,
binary_info
.
arch
,
(
binary_info
.
flags
&
BINARY_FLAG_FAKEDLL
)
?
", fakedll"
:
""
);
retv
=
create_process
(
hFile
,
name
,
tidy_cmdline
,
envW
,
cur_dir
,
process_attr
,
thread_attr
,
inherit
,
flags
,
startup_info
,
info
,
unixdir
,
&
binary_info
,
FALSE
);
break
;
...
...
@@ -2556,9 +2557,10 @@ static void exec_process( LPCWSTR name )
switch
(
binary_info
.
type
)
{
case
BINARY_PE
:
TRACE
(
"starting %s as Win%d binary (%
p-%p
, arch %04x)
\n
"
,
TRACE
(
"starting %s as Win%d binary (%
s-%s
, arch %04x)
\n
"
,
debugstr_w
(
name
),
(
binary_info
.
flags
&
BINARY_FLAG_64BIT
)
?
64
:
32
,
binary_info
.
res_start
,
binary_info
.
res_end
,
binary_info
.
arch
);
wine_dbgstr_longlong
(
binary_info
.
res_start
),
wine_dbgstr_longlong
(
binary_info
.
res_end
),
binary_info
.
arch
);
create_process
(
hFile
,
name
,
GetCommandLineW
(),
NULL
,
NULL
,
NULL
,
NULL
,
FALSE
,
0
,
&
startup_info
,
&
info
,
NULL
,
&
binary_info
,
TRUE
);
break
;
...
...
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