server: Remove the load/unload_dll requests and the dll list.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2021-02-11 16:19:40 +01:00
parent 7c85b365d1
commit e7fa4fd147
7 changed files with 2 additions and 192 deletions

View file

@ -35,7 +35,6 @@
#include "wine/exception.h"
#include "wine/debug.h"
#include "wine/list.h"
#include "wine/server.h"
#include "ntdll_misc.h"
#include "ddk/wdm.h"
@ -1917,17 +1916,6 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name,
TRACE( "loaded %s %p %p\n", debugstr_us(nt_name), wm, *module );
/* send DLL load event */
SERVER_START_REQ( load_dll )
{
req->base = wine_server_client_ptr( *module );
req->name = wine_server_client_ptr( &wm->ldr.FullDllName.Buffer );
wine_server_add_data( req, wm->ldr.FullDllName.Buffer, wm->ldr.FullDllName.Length );
wine_server_call( req );
}
SERVER_END_REQ;
if (image_info->u.ImageFlags & IMAGE_FLAGS_WineBuiltin)
{
if (TRACE_ON(relay)) RELAY_SetupDLL( *module );
@ -3300,13 +3288,6 @@ static void free_modref( WINE_MODREF *wm )
debugstr_w(wm->ldr.FullDllName.Buffer),
(wm->ldr.Flags & LDR_WINE_INTERNAL) ? "builtin" : "native" );
SERVER_START_REQ( unload_dll )
{
req->base = wine_server_client_ptr( wm->ldr.DllBase );
wine_server_call( req );
}
SERVER_END_REQ;
free_tls_slot( &wm->ldr );
RtlReleaseActivationContext( wm->ldr.ActivationContext );
unix_funcs->unload_builtin_dll( wm->ldr.DllBase );

View file

@ -1175,34 +1175,6 @@ struct resume_thread_reply
struct load_dll_request
{
struct request_header __header;
char __pad_12[4];
mod_handle_t base;
client_ptr_t name;
/* VARARG(filename,unicode_str); */
};
struct load_dll_reply
{
struct reply_header __header;
};
struct unload_dll_request
{
struct request_header __header;
char __pad_12[4];
mod_handle_t base;
};
struct unload_dll_reply
{
struct reply_header __header;
};
struct queue_apc_request
{
struct request_header __header;
@ -5466,8 +5438,6 @@ enum request
REQ_set_thread_info,
REQ_suspend_thread,
REQ_resume_thread,
REQ_load_dll,
REQ_unload_dll,
REQ_queue_apc,
REQ_get_apc_result,
REQ_close_handle,
@ -5752,8 +5722,6 @@ union generic_request
struct set_thread_info_request set_thread_info_request;
struct suspend_thread_request suspend_thread_request;
struct resume_thread_request resume_thread_request;
struct load_dll_request load_dll_request;
struct unload_dll_request unload_dll_request;
struct queue_apc_request queue_apc_request;
struct get_apc_result_request get_apc_result_request;
struct close_handle_request close_handle_request;
@ -6036,8 +6004,6 @@ union generic_reply
struct set_thread_info_reply set_thread_info_reply;
struct suspend_thread_reply suspend_thread_reply;
struct resume_thread_reply resume_thread_reply;
struct load_dll_reply load_dll_reply;
struct unload_dll_reply unload_dll_reply;
struct queue_apc_reply queue_apc_reply;
struct get_apc_result_reply get_apc_result_reply;
struct close_handle_reply close_handle_reply;
@ -6299,7 +6265,7 @@ union generic_reply
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 673
#define SERVER_PROTOCOL_VERSION 674
/* ### protocol_version end ### */

View file

@ -556,7 +556,6 @@ struct process *create_process( int fd, struct process *parent, int inherit_all,
list_init( &process->asyncs );
list_init( &process->classes );
list_init( &process->views );
list_init( &process->dlls );
list_init( &process->rawinput_devices );
process->end_time = 0;
@ -782,60 +781,6 @@ struct process *get_process_from_handle( obj_handle_t handle, unsigned int acces
access, &process_ops );
}
/* find a dll from its base address */
static inline struct process_dll *find_process_dll( struct process *process, mod_handle_t base )
{
struct process_dll *dll;
LIST_FOR_EACH_ENTRY( dll, &process->dlls, struct process_dll, entry )
{
if (dll->base == base) return dll;
}
return NULL;
}
/* add a dll to a process list */
static struct process_dll *process_load_dll( struct process *process, mod_handle_t base,
const WCHAR *filename, data_size_t name_len )
{
struct process_dll *dll;
/* make sure we don't already have one with the same base address */
if (find_process_dll( process, base ))
{
set_error( STATUS_INVALID_PARAMETER );
return NULL;
}
if ((dll = mem_alloc( sizeof(*dll) )))
{
dll->base = base;
dll->filename = NULL;
dll->namelen = name_len;
if (name_len && !(dll->filename = memdup( filename, name_len )))
{
free( dll );
return NULL;
}
list_add_tail( &process->dlls, &dll->entry );
}
return dll;
}
/* remove a dll from a process list */
static void process_unload_dll( struct process *process, mod_handle_t base )
{
struct process_dll *dll = find_process_dll( process, base );
if (dll && (&dll->entry != list_head( &process->dlls ))) /* main exe can't be unloaded */
{
free( dll->filename );
list_remove( &dll->entry );
free( dll );
}
else set_error( STATUS_INVALID_PARAMETER );
}
/* terminate a process with the given exit code */
static void terminate_process( struct process *process, struct thread *skip, int exit_code )
{
@ -913,13 +858,6 @@ static void process_killed( struct process *process )
list_remove( &entry->entry );
free( entry );
}
while ((ptr = list_head( &process->dlls )))
{
struct process_dll *dll = LIST_ENTRY( ptr, struct process_dll, entry );
free( dll->filename );
list_remove( &dll->entry );
free( dll );
}
destroy_process_classes( process );
free_mapped_views( process );
free_process_user_handles( process );
@ -1346,7 +1284,6 @@ DECL_HANDLER(get_startup_info)
/* signal the end of the process initialization */
DECL_HANDLER(init_process_done)
{
struct process_dll *dll;
struct process *process = current->process;
struct memory_view *view;
client_ptr_t base;
@ -1364,13 +1301,6 @@ DECL_HANDLER(init_process_done)
}
if (!(image_info = get_view_image_info( view, &base ))) return;
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 = image_info->entry_point;
@ -1593,23 +1523,6 @@ DECL_HANDLER(write_process_memory)
}
}
/* notify the server that a dll has been loaded */
DECL_HANDLER(load_dll)
{
struct process_dll *dll;
if ((dll = process_load_dll( current->process, req->base, get_req_data(), get_req_data_size() )))
{
dll->name = req->name;
}
}
/* notify the server that a dll is being unloaded */
DECL_HANDLER(unload_dll)
{
process_unload_dll( current->process, req->base );
}
/* retrieve the process idle event */
DECL_HANDLER(get_process_idle_event)
{

View file

@ -33,15 +33,6 @@ enum startup_state { STARTUP_IN_PROGRESS, STARTUP_DONE, STARTUP_ABORTED };
/* process structures */
struct process_dll
{
struct list entry; /* entry in per-process dll list */
mod_handle_t base; /* dll base address (in process addr space) */
client_ptr_t name; /* ptr to ptr to name (in process addr space) */
data_size_t namelen; /* length of dll file name */
WCHAR *filename; /* dll file name */
};
struct rawinput_device_entry
{
struct list entry;
@ -86,7 +77,6 @@ struct process
obj_handle_t desktop; /* handle to desktop to use for new threads */
struct token *token; /* security token associated with this process */
struct list views; /* list of memory views */
struct list dlls; /* list of loaded dlls */
client_ptr_t peb; /* PEB address in client address space */
client_ptr_t ldt_copy; /* pointer to LDT copy in client addr space */
struct dir_cache *dir_cache; /* map of client-side directory cache */

View file

@ -1066,20 +1066,6 @@ typedef struct
@END
/* Notify the server that a dll has been loaded */
@REQ(load_dll)
mod_handle_t base; /* base address */
client_ptr_t name; /* ptr to ptr to name (in process addr space) */
VARARG(filename,unicode_str); /* file name of dll */
@END
/* Notify the server that a dll is being unloaded */
@REQ(unload_dll)
mod_handle_t base; /* base address */
@END
/* Queue an APC for a thread or process */
@REQ(queue_apc)
obj_handle_t handle; /* thread or process handle */

View file

@ -139,8 +139,6 @@ DECL_HANDLER(get_thread_times);
DECL_HANDLER(set_thread_info);
DECL_HANDLER(suspend_thread);
DECL_HANDLER(resume_thread);
DECL_HANDLER(load_dll);
DECL_HANDLER(unload_dll);
DECL_HANDLER(queue_apc);
DECL_HANDLER(get_apc_result);
DECL_HANDLER(close_handle);
@ -424,8 +422,6 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] =
(req_handler)req_set_thread_info,
(req_handler)req_suspend_thread,
(req_handler)req_resume_thread,
(req_handler)req_load_dll,
(req_handler)req_unload_dll,
(req_handler)req_queue_apc,
(req_handler)req_get_apc_result,
(req_handler)req_close_handle,
@ -863,11 +859,6 @@ C_ASSERT( FIELD_OFFSET(struct resume_thread_request, handle) == 12 );
C_ASSERT( sizeof(struct resume_thread_request) == 16 );
C_ASSERT( FIELD_OFFSET(struct resume_thread_reply, count) == 8 );
C_ASSERT( sizeof(struct resume_thread_reply) == 16 );
C_ASSERT( FIELD_OFFSET(struct load_dll_request, base) == 16 );
C_ASSERT( FIELD_OFFSET(struct load_dll_request, name) == 24 );
C_ASSERT( sizeof(struct load_dll_request) == 32 );
C_ASSERT( FIELD_OFFSET(struct unload_dll_request, base) == 16 );
C_ASSERT( sizeof(struct unload_dll_request) == 24 );
C_ASSERT( FIELD_OFFSET(struct queue_apc_request, handle) == 12 );
C_ASSERT( FIELD_OFFSET(struct queue_apc_request, call) == 16 );
C_ASSERT( sizeof(struct queue_apc_request) == 64 );

View file

@ -1620,18 +1620,6 @@ static void dump_resume_thread_reply( const struct resume_thread_reply *req )
fprintf( stderr, " count=%d", req->count );
}
static void dump_load_dll_request( const struct load_dll_request *req )
{
dump_uint64( " base=", &req->base );
dump_uint64( ", name=", &req->name );
dump_varargs_unicode_str( ", filename=", cur_size );
}
static void dump_unload_dll_request( const struct unload_dll_request *req )
{
dump_uint64( " base=", &req->base );
}
static void dump_queue_apc_request( const struct queue_apc_request *req )
{
fprintf( stderr, " handle=%04x", req->handle );
@ -4501,8 +4489,6 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
(dump_func)dump_set_thread_info_request,
(dump_func)dump_suspend_thread_request,
(dump_func)dump_resume_thread_request,
(dump_func)dump_load_dll_request,
(dump_func)dump_unload_dll_request,
(dump_func)dump_queue_apc_request,
(dump_func)dump_get_apc_result_request,
(dump_func)dump_close_handle_request,
@ -4783,8 +4769,6 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
NULL,
(dump_func)dump_suspend_thread_reply,
(dump_func)dump_resume_thread_reply,
NULL,
NULL,
(dump_func)dump_queue_apc_reply,
(dump_func)dump_get_apc_result_reply,
NULL,
@ -5065,8 +5049,6 @@ static const char * const req_names[REQ_NB_REQUESTS] = {
"set_thread_info",
"suspend_thread",
"resume_thread",
"load_dll",
"unload_dll",
"queue_apc",
"get_apc_result",
"close_handle",
@ -5367,6 +5349,7 @@ static const struct
{ "ERROR_NO_MORE_USER_HANDLES", 0xc0010000 | ERROR_NO_MORE_USER_HANDLES },
{ "ERROR_WINDOW_OF_OTHER_THREAD", 0xc0010000 | ERROR_WINDOW_OF_OTHER_THREAD },
{ "FILE_DELETED", STATUS_FILE_DELETED },
{ "FILE_INVALID", STATUS_FILE_INVALID },
{ "FILE_IS_A_DIRECTORY", STATUS_FILE_IS_A_DIRECTORY },
{ "FILE_LOCK_CONFLICT", STATUS_FILE_LOCK_CONFLICT },
{ "GENERIC_NOT_MAPPED", STATUS_GENERIC_NOT_MAPPED },