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
b08b4b82
Commit
b08b4b82
authored
Jul 30, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Store the entry point as image-relative in pe_image_info_t.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=51539
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
10fb3302
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
16 additions
and
18 deletions
+16
-18
loader.c
dlls/ntdll/unix/loader.c
+1
-1
virtual.c
dlls/ntdll/unix/virtual.c
+1
-1
server_protocol.h
include/wine/server_protocol.h
+3
-3
debugger.c
server/debugger.c
+1
-1
mapping.c
server/mapping.c
+2
-2
process.c
server/process.c
+2
-2
protocol.def
server/protocol.def
+2
-2
trace.c
server/trace.c
+4
-6
No files found.
dlls/ntdll/unix/loader.c
View file @
b08b4b82
...
@@ -1017,7 +1017,7 @@ static void fill_builtin_image_info( void *module, pe_image_info_t *info )
...
@@ -1017,7 +1017,7 @@ static void fill_builtin_image_info( void *module, pe_image_info_t *info )
const
IMAGE_NT_HEADERS
*
nt
=
(
IMAGE_NT_HEADERS
*
)((
const
BYTE
*
)
dos
+
dos
->
e_lfanew
);
const
IMAGE_NT_HEADERS
*
nt
=
(
IMAGE_NT_HEADERS
*
)((
const
BYTE
*
)
dos
+
dos
->
e_lfanew
);
info
->
base
=
nt
->
OptionalHeader
.
ImageBase
;
info
->
base
=
nt
->
OptionalHeader
.
ImageBase
;
info
->
entry_point
=
info
->
base
+
nt
->
OptionalHeader
.
AddressOfEntryPoint
;
info
->
entry_point
=
nt
->
OptionalHeader
.
AddressOfEntryPoint
;
info
->
map_size
=
nt
->
OptionalHeader
.
SizeOfImage
;
info
->
map_size
=
nt
->
OptionalHeader
.
SizeOfImage
;
info
->
stack_size
=
nt
->
OptionalHeader
.
SizeOfStackReserve
;
info
->
stack_size
=
nt
->
OptionalHeader
.
SizeOfStackReserve
;
info
->
stack_commit
=
nt
->
OptionalHeader
.
SizeOfStackCommit
;
info
->
stack_commit
=
nt
->
OptionalHeader
.
SizeOfStackCommit
;
...
...
dlls/ntdll/unix/virtual.c
View file @
b08b4b82
...
@@ -4512,7 +4512,7 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr )
...
@@ -4512,7 +4512,7 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr )
*/
*/
void
virtual_fill_image_information
(
const
pe_image_info_t
*
pe_info
,
SECTION_IMAGE_INFORMATION
*
info
)
void
virtual_fill_image_information
(
const
pe_image_info_t
*
pe_info
,
SECTION_IMAGE_INFORMATION
*
info
)
{
{
info
->
TransferAddress
=
wine_server_get_ptr
(
pe_info
->
entry_point
);
info
->
TransferAddress
=
wine_server_get_ptr
(
pe_info
->
base
+
pe_info
->
entry_point
);
info
->
ZeroBits
=
pe_info
->
zerobits
;
info
->
ZeroBits
=
pe_info
->
zerobits
;
info
->
MaximumStackSize
=
pe_info
->
stack_size
;
info
->
MaximumStackSize
=
pe_info
->
stack_size
;
info
->
CommittedStackSize
=
pe_info
->
stack_commit
;
info
->
CommittedStackSize
=
pe_info
->
stack_commit
;
...
...
include/wine/server_protocol.h
View file @
b08b4b82
...
@@ -767,10 +767,10 @@ typedef union
...
@@ -767,10 +767,10 @@ typedef union
typedef
struct
typedef
struct
{
{
client_ptr_t
base
;
client_ptr_t
base
;
client_ptr_t
entry_point
;
mem_size_t
map_size
;
mem_size_t
stack_size
;
mem_size_t
stack_size
;
mem_size_t
stack_commit
;
mem_size_t
stack_commit
;
unsigned
int
entry_point
;
unsigned
int
map_size
;
unsigned
int
zerobits
;
unsigned
int
zerobits
;
unsigned
int
subsystem
;
unsigned
int
subsystem
;
unsigned
short
subsystem_minor
;
unsigned
short
subsystem_minor
;
...
@@ -6252,7 +6252,7 @@ union generic_reply
...
@@ -6252,7 +6252,7 @@ union generic_reply
/* ### protocol_version begin ### */
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 72
5
#define SERVER_PROTOCOL_VERSION 72
6
/* ### protocol_version end ### */
/* ### protocol_version end ### */
...
...
server/debugger.c
View file @
b08b4b82
...
@@ -160,7 +160,7 @@ static void fill_create_process_event( struct debug_event *event, const void *ar
...
@@ -160,7 +160,7 @@ static void fill_create_process_event( struct debug_event *event, const void *ar
const
struct
memory_view
*
view
=
arg
;
const
struct
memory_view
*
view
=
arg
;
const
pe_image_info_t
*
image_info
=
get_view_image_info
(
view
,
&
event
->
data
.
create_process
.
base
);
const
pe_image_info_t
*
image_info
=
get_view_image_info
(
view
,
&
event
->
data
.
create_process
.
base
);
event
->
data
.
create_process
.
start
=
image_info
->
entry_point
;
event
->
data
.
create_process
.
start
=
event
->
data
.
create_process
.
base
+
image_info
->
entry_point
;
event
->
data
.
create_process
.
dbg_offset
=
image_info
->
dbg_offset
;
event
->
data
.
create_process
.
dbg_offset
=
image_info
->
dbg_offset
;
event
->
data
.
create_process
.
dbg_size
=
image_info
->
dbg_size
;
event
->
data
.
create_process
.
dbg_size
=
image_info
->
dbg_size
;
/* the doc says write access too, but this doesn't seem a good idea */
/* the doc says write access too, but this doesn't seem a good idea */
...
...
server/mapping.c
View file @
b08b4b82
...
@@ -705,7 +705,7 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s
...
@@ -705,7 +705,7 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s
clr_size
=
nt
.
opt
.
hdr32
.
DataDirectory
[
IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR
].
Size
;
clr_size
=
nt
.
opt
.
hdr32
.
DataDirectory
[
IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR
].
Size
;
mapping
->
image
.
base
=
nt
.
opt
.
hdr32
.
ImageBase
;
mapping
->
image
.
base
=
nt
.
opt
.
hdr32
.
ImageBase
;
mapping
->
image
.
entry_point
=
nt
.
opt
.
hdr32
.
ImageBase
+
nt
.
opt
.
hdr32
.
AddressOfEntryPoint
;
mapping
->
image
.
entry_point
=
nt
.
opt
.
hdr32
.
AddressOfEntryPoint
;
mapping
->
image
.
map_size
=
ROUND_SIZE
(
nt
.
opt
.
hdr32
.
SizeOfImage
);
mapping
->
image
.
map_size
=
ROUND_SIZE
(
nt
.
opt
.
hdr32
.
SizeOfImage
);
mapping
->
image
.
stack_size
=
nt
.
opt
.
hdr32
.
SizeOfStackReserve
;
mapping
->
image
.
stack_size
=
nt
.
opt
.
hdr32
.
SizeOfStackReserve
;
mapping
->
image
.
stack_commit
=
nt
.
opt
.
hdr32
.
SizeOfStackCommit
;
mapping
->
image
.
stack_commit
=
nt
.
opt
.
hdr32
.
SizeOfStackCommit
;
...
@@ -737,7 +737,7 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s
...
@@ -737,7 +737,7 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s
clr_size
=
nt
.
opt
.
hdr64
.
DataDirectory
[
IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR
].
Size
;
clr_size
=
nt
.
opt
.
hdr64
.
DataDirectory
[
IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR
].
Size
;
mapping
->
image
.
base
=
nt
.
opt
.
hdr64
.
ImageBase
;
mapping
->
image
.
base
=
nt
.
opt
.
hdr64
.
ImageBase
;
mapping
->
image
.
entry_point
=
nt
.
opt
.
hdr64
.
ImageBase
+
nt
.
opt
.
hdr64
.
AddressOfEntryPoint
;
mapping
->
image
.
entry_point
=
nt
.
opt
.
hdr64
.
AddressOfEntryPoint
;
mapping
->
image
.
map_size
=
ROUND_SIZE
(
nt
.
opt
.
hdr64
.
SizeOfImage
);
mapping
->
image
.
map_size
=
ROUND_SIZE
(
nt
.
opt
.
hdr64
.
SizeOfImage
);
mapping
->
image
.
stack_size
=
nt
.
opt
.
hdr64
.
SizeOfStackReserve
;
mapping
->
image
.
stack_size
=
nt
.
opt
.
hdr64
.
SizeOfStackReserve
;
mapping
->
image
.
stack_commit
=
nt
.
opt
.
hdr64
.
SizeOfStackCommit
;
mapping
->
image
.
stack_commit
=
nt
.
opt
.
hdr64
.
SizeOfStackCommit
;
...
...
server/process.c
View file @
b08b4b82
...
@@ -1399,7 +1399,7 @@ DECL_HANDLER(init_process_done)
...
@@ -1399,7 +1399,7 @@ DECL_HANDLER(init_process_done)
process
->
ldt_copy
=
req
->
ldt_copy
;
process
->
ldt_copy
=
req
->
ldt_copy
;
process
->
start_time
=
current_time
;
process
->
start_time
=
current_time
;
current
->
entry_point
=
image_info
->
entry_point
;
current
->
entry_point
=
base
+
image_info
->
entry_point
;
init_process_tracing
(
process
);
init_process_tracing
(
process
);
generate_startup_debug_events
(
process
);
generate_startup_debug_events
(
process
);
...
@@ -1408,7 +1408,7 @@ DECL_HANDLER(init_process_done)
...
@@ -1408,7 +1408,7 @@ DECL_HANDLER(init_process_done)
if
(
image_info
->
subsystem
!=
IMAGE_SUBSYSTEM_WINDOWS_CUI
)
if
(
image_info
->
subsystem
!=
IMAGE_SUBSYSTEM_WINDOWS_CUI
)
process
->
idle_event
=
create_event
(
NULL
,
NULL
,
0
,
1
,
0
,
NULL
);
process
->
idle_event
=
create_event
(
NULL
,
NULL
,
0
,
1
,
0
,
NULL
);
if
(
process
->
debug_obj
)
set_process_debug_flag
(
process
,
1
);
if
(
process
->
debug_obj
)
set_process_debug_flag
(
process
,
1
);
reply
->
entry
=
image_info
->
entry_point
;
reply
->
entry
=
current
->
entry_point
;
reply
->
suspend
=
(
current
->
suspend
||
process
->
suspend
);
reply
->
suspend
=
(
current
->
suspend
||
process
->
suspend
);
}
}
...
...
server/protocol.def
View file @
b08b4b82
...
@@ -783,10 +783,10 @@ typedef union
...
@@ -783,10 +783,10 @@ typedef union
typedef struct
typedef struct
{
{
client_ptr_t base;
client_ptr_t base;
client_ptr_t entry_point;
mem_size_t map_size;
mem_size_t stack_size;
mem_size_t stack_size;
mem_size_t stack_commit;
mem_size_t stack_commit;
unsigned int entry_point;
unsigned int map_size;
unsigned int zerobits;
unsigned int zerobits;
unsigned int subsystem;
unsigned int subsystem;
unsigned short subsystem_minor;
unsigned short subsystem_minor;
...
...
server/trace.c
View file @
b08b4b82
...
@@ -1354,17 +1354,15 @@ static void dump_varargs_pe_image_info( const char *prefix, data_size_t size )
...
@@ -1354,17 +1354,15 @@ static void dump_varargs_pe_image_info( const char *prefix, data_size_t size )
fprintf
(
stderr
,
"%s{"
,
prefix
);
fprintf
(
stderr
,
"%s{"
,
prefix
);
dump_uint64
(
"base="
,
&
info
.
base
);
dump_uint64
(
"base="
,
&
info
.
base
);
dump_uint64
(
",entry_point="
,
&
info
.
entry_point
);
dump_uint64
(
",map_size="
,
&
info
.
map_size
);
dump_uint64
(
",stack_size="
,
&
info
.
stack_size
);
dump_uint64
(
",stack_size="
,
&
info
.
stack_size
);
dump_uint64
(
",stack_commit="
,
&
info
.
stack_commit
);
dump_uint64
(
",stack_commit="
,
&
info
.
stack_commit
);
fprintf
(
stderr
,
",zerobits=%08x,subsystem=%08x,subsystem_minor=%04x,subsystem_major=%04x"
fprintf
(
stderr
,
",
entry_point=%08x,map_size=%08x,
zerobits=%08x,subsystem=%08x,subsystem_minor=%04x,subsystem_major=%04x"
",osversion_major=%04x,osversion_minor=%04x,image_charact=%04x,dll_charact=%04x,machine=%04x"
",osversion_major=%04x,osversion_minor=%04x,image_charact=%04x,dll_charact=%04x,machine=%04x"
",contains_code=%u,image_flags=%02x"
",contains_code=%u,image_flags=%02x"
",loader_flags=%08x,header_size=%08x,file_size=%08x,checksum=%08x}"
,
",loader_flags=%08x,header_size=%08x,file_size=%08x,checksum=%08x}"
,
info
.
zerobits
,
info
.
subsystem
,
info
.
subsystem_minor
,
info
.
subsystem_maj
or
,
info
.
entry_point
,
info
.
map_size
,
info
.
zerobits
,
info
.
subsystem
,
info
.
subsystem_min
or
,
info
.
osversion_major
,
info
.
osversion_minor
,
info
.
image_charact
,
info
.
dll
_charact
,
info
.
subsystem_major
,
info
.
osversion_major
,
info
.
osversion_minor
,
info
.
image
_charact
,
info
.
machine
,
info
.
contains_code
,
info
.
image_flags
,
info
.
loader_flags
,
info
.
dll_charact
,
info
.
machine
,
info
.
contains_code
,
info
.
image_flags
,
info
.
loader_flags
,
info
.
header_size
,
info
.
file_size
,
info
.
checksum
);
info
.
header_size
,
info
.
file_size
,
info
.
checksum
);
remove_data
(
min
(
size
,
sizeof
(
info
)
));
remove_data
(
min
(
size
,
sizeof
(
info
)
));
}
}
...
...
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