Implemented GetNamedPipeInfo.

This commit is contained in:
Mike McCormack 2001-08-27 19:03:42 +00:00 committed by Alexandre Julliard
parent 329318109f
commit f2e7ce7f6a
6 changed files with 88 additions and 3 deletions

View File

@ -746,9 +746,27 @@ BOOL WINAPI GetNamedPipeInfo(
HANDLE hNamedPipe, LPDWORD lpFlags, LPDWORD lpOutputBufferSize,
LPDWORD lpInputBufferSize, LPDWORD lpMaxInstances)
{
FIXME("%d %p %p %p %p\n", hNamedPipe, lpFlags,
BOOL ret;
TRACE("%d %p %p %p %p\n", hNamedPipe, lpFlags,
lpOutputBufferSize, lpInputBufferSize, lpMaxInstances);
return FALSE;
SERVER_START_REQ( get_named_pipe_info )
{
req->handle = hNamedPipe;
ret = !SERVER_CALL_ERR();
if(lpFlags)
*lpFlags = req->flags;
if(lpOutputBufferSize)
*lpOutputBufferSize = req->outsize;
if(lpInputBufferSize)
*lpInputBufferSize = req->outsize;
if(lpMaxInstances)
*lpMaxInstances = req->maxinstances;
}
SERVER_END_REQ;
return ret;
}
/***********************************************************************

View File

@ -1549,6 +1549,17 @@ struct disconnect_named_pipe_request
handle_t handle;
};
struct get_named_pipe_info_request
{
struct request_header __header;
handle_t handle;
unsigned int flags;
unsigned int maxinstances;
unsigned int outsize;
unsigned int insize;
};
enum request
{
@ -1674,6 +1685,7 @@ enum request
REQ_connect_named_pipe,
REQ_wait_named_pipe,
REQ_disconnect_named_pipe,
REQ_get_named_pipe_info,
REQ_NB_REQUESTS
};
@ -1803,8 +1815,9 @@ union generic_request
struct connect_named_pipe_request connect_named_pipe;
struct wait_named_pipe_request wait_named_pipe;
struct disconnect_named_pipe_request disconnect_named_pipe;
struct get_named_pipe_info_request get_named_pipe_info;
};
#define SERVER_PROTOCOL_VERSION 50
#define SERVER_PROTOCOL_VERSION 51
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */

View File

@ -237,6 +237,15 @@ DECL_HANDLER(create_named_pipe)
if(!pipe)
return;
if (get_error() != STATUS_OBJECT_NAME_COLLISION)
{
pipe->insize = req->insize;
pipe->outsize = req->outsize;
pipe->maxinstances = req->maxinstances;
pipe->timeout = req->timeout;
pipe->pipemode = req->pipemode;
}
user = create_pipe_user (pipe, -1);
if(user)
@ -403,3 +412,20 @@ DECL_HANDLER(disconnect_named_pipe)
}
release_object(user);
}
DECL_HANDLER(get_named_pipe_info)
{
struct pipe_user *user;
user = get_pipe_user_obj(current->process, req->handle, 0);
if(!user)
return;
req->flags = user->pipe->pipemode;
req->maxinstances = user->pipe->maxinstances;
req->insize = user->pipe->insize;
req->outsize = user->pipe->outsize;
release_object(user);
}

View File

@ -1382,3 +1382,13 @@ enum message_type
@REQ(disconnect_named_pipe)
handle_t handle;
@END
@REQ(get_named_pipe_info)
handle_t handle;
@REPLY
unsigned int flags;
unsigned int maxinstances;
unsigned int outsize;
unsigned int insize;
@END

View File

@ -187,6 +187,7 @@ DECL_HANDLER(open_named_pipe);
DECL_HANDLER(connect_named_pipe);
DECL_HANDLER(wait_named_pipe);
DECL_HANDLER(disconnect_named_pipe);
DECL_HANDLER(get_named_pipe_info);
#ifdef WANT_REQUEST_HANDLERS
@ -315,6 +316,7 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] =
(req_handler)req_connect_named_pipe,
(req_handler)req_wait_named_pipe,
(req_handler)req_disconnect_named_pipe,
(req_handler)req_get_named_pipe_info,
};
#endif /* WANT_REQUEST_HANDLERS */

View File

@ -1639,6 +1639,19 @@ static void dump_disconnect_named_pipe_request( const struct disconnect_named_pi
fprintf( stderr, " handle=%d", req->handle );
}
static void dump_get_named_pipe_info_request( const struct get_named_pipe_info_request *req )
{
fprintf( stderr, " handle=%d", req->handle );
}
static void dump_get_named_pipe_info_reply( const struct get_named_pipe_info_request *req )
{
fprintf( stderr, " flags=%08x,", req->flags );
fprintf( stderr, " maxinstances=%08x,", req->maxinstances );
fprintf( stderr, " outsize=%08x,", req->outsize );
fprintf( stderr, " insize=%08x", req->insize );
}
static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
(dump_func)dump_new_process_request,
(dump_func)dump_get_new_process_info_request,
@ -1762,6 +1775,7 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
(dump_func)dump_connect_named_pipe_request,
(dump_func)dump_wait_named_pipe_request,
(dump_func)dump_disconnect_named_pipe_request,
(dump_func)dump_get_named_pipe_info_request,
};
static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
@ -1887,6 +1901,7 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
(dump_func)0,
(dump_func)0,
(dump_func)0,
(dump_func)dump_get_named_pipe_info_reply,
};
static const char * const req_names[REQ_NB_REQUESTS] = {
@ -2012,6 +2027,7 @@ static const char * const req_names[REQ_NB_REQUESTS] = {
"connect_named_pipe",
"wait_named_pipe",
"disconnect_named_pipe",
"get_named_pipe_info",
};
/* ### make_requests end ### */