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
a3c92a02
Commit
a3c92a02
authored
Feb 08, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Get the process entry point from the exe image info.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
52d733b5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
28 deletions
+28
-28
server.c
dlls/ntdll/unix/server.c
+2
-4
server_protocol.h
include/wine/server_protocol.h
+4
-5
process.c
server/process.c
+15
-6
protocol.def
server/protocol.def
+1
-3
request.h
server/request.h
+4
-6
trace.c
server/trace.c
+2
-4
No files found.
dlls/ntdll/unix/server.c
View file @
a3c92a02
...
...
@@ -1587,7 +1587,7 @@ void server_init_process_done(void)
{
PEB
*
peb
=
NtCurrentTeb
()
->
Peb
;
IMAGE_NT_HEADERS
*
nt
=
get_exe_nt_header
();
void
*
entry
=
(
char
*
)
peb
->
ImageBaseAddress
+
nt
->
OptionalHeader
.
AddressOfEntryPoint
;
void
*
entry
;
NTSTATUS
status
;
int
suspend
,
needs_close
,
unixdir
;
...
...
@@ -1613,11 +1613,9 @@ void server_init_process_done(void)
/* Signal the parent process to continue */
SERVER_START_REQ
(
init_process_done
)
{
req
->
module
=
wine_server_client_ptr
(
peb
->
ImageBaseAddress
);
req
->
entry
=
wine_server_client_ptr
(
entry
);
req
->
gui
=
(
nt
->
OptionalHeader
.
Subsystem
!=
IMAGE_SUBSYSTEM_WINDOWS_CUI
);
status
=
wine_server_call
(
req
);
suspend
=
reply
->
suspend
;
entry
=
wine_server_get_ptr
(
reply
->
entry
);
}
SERVER_END_REQ
;
...
...
include/wine/server_protocol.h
View file @
a3c92a02
...
...
@@ -900,15 +900,14 @@ struct get_startup_info_reply
struct
init_process_done_request
{
struct
request_header
__header
;
int
gui
;
mod_handle_t
module
;
client_ptr_t
entry
;
char
__pad_12
[
4
];
};
struct
init_process_done_reply
{
struct
reply_header
__header
;
client_ptr_t
entry
;
int
suspend
;
char
__pad_
12
[
4
];
char
__pad_
20
[
4
];
};
...
...
@@ -6280,7 +6279,7 @@ union generic_reply
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 6
69
#define SERVER_PROTOCOL_VERSION 6
70
/* ### protocol_version end ### */
...
...
server/process.c
View file @
a3c92a02
...
...
@@ -1349,31 +1349,40 @@ DECL_HANDLER(init_process_done)
{
struct
process_dll
*
dll
;
struct
process
*
process
=
current
->
process
;
struct
memory_view
*
view
;
client_ptr_t
base
;
const
pe_image_info_t
*
image_info
;
if
(
is_process_init_done
(
process
))
{
set_error
(
STATUS_INVALID_PARAMETER
);
return
;
}
if
(
!
(
dll
=
find_process_dll
(
process
,
req
->
module
)))
if
(
!
(
view
=
get_exe_view
(
process
)))
{
set_error
(
STATUS_DLL_NOT_FOUND
);
return
;
}
if
(
!
(
image_info
=
get_view_image_info
(
view
,
&
base
)))
return
;
/* main exe is the first in the dll list */
list_remove
(
&
dll
->
entry
);
list_add_head
(
&
process
->
dlls
,
&
dll
->
entry
);
if
((
dll
=
find_process_dll
(
process
,
base
)))
{
/* main exe is the first in the dll list */
list_remove
(
&
dll
->
entry
);
list_add_head
(
&
process
->
dlls
,
&
dll
->
entry
);
}
process
->
start_time
=
current_time
;
current
->
entry_point
=
req
->
entry
;
current
->
entry_point
=
image_info
->
entry_point
;
init_process_tracing
(
process
);
generate_startup_debug_events
(
process
);
set_process_startup_state
(
process
,
STARTUP_DONE
);
if
(
req
->
gui
)
process
->
idle_event
=
create_event
(
NULL
,
NULL
,
0
,
1
,
0
,
NULL
);
if
(
image_info
->
subsystem
!=
IMAGE_SUBSYSTEM_WINDOWS_CUI
)
process
->
idle_event
=
create_event
(
NULL
,
NULL
,
0
,
1
,
0
,
NULL
);
if
(
process
->
debug_obj
)
set_process_debug_flag
(
process
,
1
);
reply
->
entry
=
image_info
->
entry_point
;
reply
->
suspend
=
(
current
->
suspend
||
process
->
suspend
);
}
...
...
server/protocol.def
View file @
a3c92a02
...
...
@@ -882,10 +882,8 @@ typedef struct
/* Signal the end of the process initialization */
@REQ(init_process_done)
int gui; /* is it a GUI process? */
mod_handle_t module; /* main module base address */
client_ptr_t entry; /* process entry point */
@REPLY
client_ptr_t entry; /* process entry point */
int suspend; /* is process suspended? */
@END
...
...
server/request.h
View file @
a3c92a02
...
...
@@ -748,12 +748,10 @@ C_ASSERT( sizeof(struct new_thread_reply) == 16 );
C_ASSERT
(
sizeof
(
struct
get_startup_info_request
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
get_startup_info_reply
,
info_size
)
==
8
);
C_ASSERT
(
sizeof
(
struct
get_startup_info_reply
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_process_done_request
,
gui
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_process_done_request
,
module
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_process_done_request
,
entry
)
==
24
);
C_ASSERT
(
sizeof
(
struct
init_process_done_request
)
==
32
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_process_done_reply
,
suspend
)
==
8
);
C_ASSERT
(
sizeof
(
struct
init_process_done_reply
)
==
16
);
C_ASSERT
(
sizeof
(
struct
init_process_done_request
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_process_done_reply
,
entry
)
==
8
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_process_done_reply
,
suspend
)
==
16
);
C_ASSERT
(
sizeof
(
struct
init_process_done_reply
)
==
24
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_first_thread_request
,
unix_pid
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_first_thread_request
,
unix_tid
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
init_first_thread_request
,
debug_level
)
==
20
);
...
...
server/trace.c
View file @
a3c92a02
...
...
@@ -1420,14 +1420,12 @@ static void dump_get_startup_info_reply( const struct get_startup_info_reply *re
static
void
dump_init_process_done_request
(
const
struct
init_process_done_request
*
req
)
{
fprintf
(
stderr
,
" gui=%d"
,
req
->
gui
);
dump_uint64
(
", module="
,
&
req
->
module
);
dump_uint64
(
", entry="
,
&
req
->
entry
);
}
static
void
dump_init_process_done_reply
(
const
struct
init_process_done_reply
*
req
)
{
fprintf
(
stderr
,
" suspend=%d"
,
req
->
suspend
);
dump_uint64
(
" entry="
,
&
req
->
entry
);
fprintf
(
stderr
,
", suspend=%d"
,
req
->
suspend
);
}
static
void
dump_init_first_thread_request
(
const
struct
init_first_thread_request
*
req
)
...
...
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