Added get/set_handle_info request.

This commit is contained in:
Alexandre Julliard 1999-02-20 16:13:28 +00:00
parent fb02ee91b5
commit 6d4ee73906
4 changed files with 67 additions and 4 deletions

View File

@ -175,6 +175,26 @@ struct close_handle_request
};
/* Get information about a handle */
struct get_handle_info_request
{
int handle; /* handle we are interested in */
};
struct get_handle_info_reply
{
int flags; /* handle flags */
};
/* Set a handle information */
struct set_handle_info_request
{
int handle; /* handle we are interested in */
int flags; /* new handle flags */
int mask; /* mask for flags to set */
};
/* Duplicate a handle */
struct dup_handle_request
{
@ -639,10 +659,6 @@ struct _THDB;
extern int CLIENT_NewThread( struct _THDB *thdb, int *thandle, int *phandle );
extern int CLIENT_SetDebug( int level );
extern int CLIENT_InitThread(void);
extern int CLIENT_CloseHandle( int handle );
extern int CLIENT_DuplicateHandle( int src_process, int src_handle, int dst_process,
int dst_handle, DWORD access, BOOL32 inherit, DWORD options );
extern int CLIENT_OpenProcess( void *pid, DWORD access, BOOL32 inherit );
#endif /* __WINE_SERVER__ */
#endif /* __WINE_SERVER_H */

View File

@ -18,6 +18,8 @@ enum request
REQ_RESUME_THREAD,
REQ_QUEUE_APC,
REQ_CLOSE_HANDLE,
REQ_GET_HANDLE_INFO,
REQ_SET_HANDLE_INFO,
REQ_DUP_HANDLE,
REQ_OPEN_PROCESS,
REQ_SELECT,
@ -76,6 +78,8 @@ DECL_HANDLER(suspend_thread);
DECL_HANDLER(resume_thread);
DECL_HANDLER(queue_apc);
DECL_HANDLER(close_handle);
DECL_HANDLER(get_handle_info);
DECL_HANDLER(set_handle_info);
DECL_HANDLER(dup_handle);
DECL_HANDLER(open_process);
DECL_HANDLER(select);
@ -131,6 +135,8 @@ static const struct handler {
{ (void(*)())req_resume_thread, sizeof(struct resume_thread_request) },
{ (void(*)())req_queue_apc, sizeof(struct queue_apc_request) },
{ (void(*)())req_close_handle, sizeof(struct close_handle_request) },
{ (void(*)())req_get_handle_info, sizeof(struct get_handle_info_request) },
{ (void(*)())req_set_handle_info, sizeof(struct set_handle_info_request) },
{ (void(*)())req_dup_handle, sizeof(struct dup_handle_request) },
{ (void(*)())req_open_process, sizeof(struct open_process_request) },
{ (void(*)())req_select, sizeof(struct select_request) },

View File

@ -198,6 +198,21 @@ DECL_HANDLER(close_handle)
send_reply( current, -1, 0 );
}
/* get information about a handle */
DECL_HANDLER(get_handle_info)
{
struct get_handle_info_reply reply;
reply.flags = set_handle_info( current->process, req->handle, 0, 0 );
send_reply( current, -1, 1, &reply, sizeof(reply) );
}
/* set a handle information */
DECL_HANDLER(set_handle_info)
{
set_handle_info( current->process, req->handle, req->mask, req->flags );
send_reply( current, -1, 0 );
}
/* duplicate a handle */
DECL_HANDLER(dup_handle)
{

View File

@ -134,6 +134,26 @@ static int dump_close_handle_request( struct close_handle_request *req, int len
return (int)sizeof(*req);
}
static int dump_get_handle_info_request( struct get_handle_info_request *req, int len )
{
fprintf( stderr, " handle=%d", req->handle );
return (int)sizeof(*req);
}
static int dump_get_handle_info_reply( struct get_handle_info_reply *req, int len )
{
fprintf( stderr, " flags=%d", req->flags );
return (int)sizeof(*req);
}
static int dump_set_handle_info_request( struct set_handle_info_request *req, int len )
{
fprintf( stderr, " handle=%d,", req->handle );
fprintf( stderr, " flags=%d,", req->flags );
fprintf( stderr, " mask=%d", req->mask );
return (int)sizeof(*req);
}
static int dump_dup_handle_request( struct dup_handle_request *req, int len )
{
fprintf( stderr, " src_process=%d,", req->src_process );
@ -603,6 +623,10 @@ static const struct dumper dumpers[REQ_NB_REQUESTS] =
(void(*)())0 },
{ (int(*)(void *,int))dump_close_handle_request,
(void(*)())0 },
{ (int(*)(void *,int))dump_get_handle_info_request,
(void(*)())dump_get_handle_info_reply },
{ (int(*)(void *,int))dump_set_handle_info_request,
(void(*)())0 },
{ (int(*)(void *,int))dump_dup_handle_request,
(void(*)())dump_dup_handle_reply },
{ (int(*)(void *,int))dump_open_process_request,
@ -694,6 +718,8 @@ static const char * const req_names[REQ_NB_REQUESTS] =
"resume_thread",
"queue_apc",
"close_handle",
"get_handle_info",
"set_handle_info",
"dup_handle",
"open_process",
"select",