server: Don't return the process exe file to the client.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2018-09-24 19:16:40 +02:00
parent d6683d637a
commit 2cab0ec389
8 changed files with 9 additions and 21 deletions

View File

@ -117,7 +117,6 @@ struct builtin_load_info
static struct builtin_load_info default_load_info;
static struct builtin_load_info *builtin_load_info = &default_load_info;
static HANDLE main_exe_file;
static UINT tls_module_count; /* number of modules with TLS directory */
static IMAGE_TLS_DIRECTORY *tls_dirs; /* array of TLS directories */
LIST_ENTRY tls_links = { &tls_links, &tls_links };
@ -3331,7 +3330,6 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
PEB *peb = NtCurrentTeb()->Peb;
kernel32_start_process = kernel_start;
if (main_exe_file) NtClose( main_exe_file ); /* at this point the main module is created */
/* allocate the modref for the main exe (if not already done) */
wm = get_modref( peb->ImageBaseAddress );
@ -3506,7 +3504,7 @@ void __wine_process_init(void)
ANSI_STRING func_name;
void (* DECLSPEC_NORETURN CDECL init_func)(void);
main_exe_file = thread_init();
thread_init();
/* retrieve current umask */
FILE_umask = umask(0777);

View File

@ -73,7 +73,7 @@ extern void DECLSPEC_NORETURN signal_exit_thread( int status ) DECLSPEC_HIDDEN;
extern void DECLSPEC_NORETURN signal_exit_process( int status ) DECLSPEC_HIDDEN;
extern void version_init( const WCHAR *appname ) DECLSPEC_HIDDEN;
extern void debug_init(void) DECLSPEC_HIDDEN;
extern HANDLE thread_init(void) DECLSPEC_HIDDEN;
extern void thread_init(void) DECLSPEC_HIDDEN;
extern void actctx_init(void) DECLSPEC_HIDDEN;
extern void virtual_init(void) DECLSPEC_HIDDEN;
extern void virtual_init_threading(void) DECLSPEC_HIDDEN;

View File

@ -105,7 +105,7 @@ static inline void get_unicode_string( UNICODE_STRING *str, WCHAR **src, WCHAR *
*
* Fill the RTL_USER_PROCESS_PARAMETERS structure from the server.
*/
static NTSTATUS init_user_process_params( SIZE_T data_size, HANDLE *exe_file )
static NTSTATUS init_user_process_params( SIZE_T data_size )
{
void *ptr;
WCHAR *src, *dst;
@ -125,7 +125,6 @@ static NTSTATUS init_user_process_params( SIZE_T data_size, HANDLE *exe_file )
data_size = wine_server_reply_size( reply );
info_size = reply->info_size;
env_size = data_size - info_size;
*exe_file = wine_server_ptr_handle( reply->exe_file );
}
}
SERVER_END_REQ;
@ -273,13 +272,12 @@ static ULONG_PTR get_image_addr(void)
*
* NOTES: The first allocated TEB on NT is at 0x7ffde000.
*/
HANDLE thread_init(void)
void thread_init(void)
{
TEB *teb;
void *addr;
BOOL suspend;
SIZE_T size, info_size;
HANDLE exe_file = 0;
LARGE_INTEGER now;
NTSTATUS status;
struct ntdll_thread_data *thread_data;
@ -378,7 +376,7 @@ HANDLE thread_init(void)
/* allocate user parameters */
if (info_size)
{
init_user_process_params( info_size, &exe_file );
init_user_process_params( info_size );
}
else
{
@ -404,8 +402,6 @@ HANDLE thread_init(void)
fill_cpu_info();
NtCreateKeyedEvent( &keyed_event, GENERIC_READ | GENERIC_WRITE, NULL, 0 );
return exe_file;
}

View File

@ -785,10 +785,10 @@ struct get_startup_info_request
struct get_startup_info_reply
{
struct reply_header __header;
obj_handle_t exe_file;
data_size_t info_size;
/* VARARG(info,startup_info,info_size); */
/* VARARG(env,unicode_str); */
char __pad_12[4];
};
@ -6531,6 +6531,6 @@ union generic_reply
struct terminate_job_reply terminate_job_reply;
};
#define SERVER_PROTOCOL_VERSION 564
#define SERVER_PROTOCOL_VERSION 565
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */

View File

@ -1261,9 +1261,6 @@ DECL_HANDLER(get_startup_info)
if (!info) return;
if (process->exe_file &&
!(reply->exe_file = alloc_handle( process, process->exe_file, GENERIC_READ, 0 ))) return;
/* we return the data directly without making a copy so this can only be called once */
reply->info_size = info->info_size;
size = info->data_size;

View File

@ -778,7 +778,6 @@ struct rawinput_device
/* Retrieve the new process startup info */
@REQ(get_startup_info)
@REPLY
obj_handle_t exe_file; /* file handle for main exe */
data_size_t info_size; /* size of startup info */
VARARG(info,startup_info,info_size); /* startup information */
VARARG(env,unicode_str); /* environment */

View File

@ -756,8 +756,7 @@ C_ASSERT( FIELD_OFFSET(struct new_thread_reply, tid) == 8 );
C_ASSERT( FIELD_OFFSET(struct new_thread_reply, handle) == 12 );
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, exe_file) == 8 );
C_ASSERT( FIELD_OFFSET(struct get_startup_info_reply, info_size) == 12 );
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 );

View File

@ -1276,8 +1276,7 @@ static void dump_get_startup_info_request( const struct get_startup_info_request
static void dump_get_startup_info_reply( const struct get_startup_info_reply *req )
{
fprintf( stderr, " exe_file=%04x", req->exe_file );
fprintf( stderr, ", info_size=%u", req->info_size );
fprintf( stderr, " info_size=%u", req->info_size );
dump_varargs_startup_info( ", info=", min(cur_size,req->info_size) );
dump_varargs_unicode_str( ", env=", cur_size );
}