Added get_file_info support to named pipes and sockets to avoid

breaking the get_handle_fd request.
This commit is contained in:
Alexandre Julliard 2001-10-05 19:45:45 +00:00
parent 32aee1ae11
commit 646d621fec
2 changed files with 40 additions and 2 deletions

View File

@ -84,6 +84,7 @@ static const struct object_ops named_pipe_ops =
static void pipe_user_dump( struct object *obj, int verbose );
static void pipe_user_destroy( struct object *obj);
static int pipe_user_get_fd( struct object *obj );
static int pipe_user_get_info( struct object *obj, struct get_file_info_request *req );
static const struct object_ops pipe_user_ops =
{
@ -97,7 +98,7 @@ static const struct object_ops pipe_user_ops =
default_poll_event, /* poll_event */
pipe_user_get_fd, /* get_fd */
no_flush, /* flush */
no_get_file_info, /* get_file_info */
pipe_user_get_info, /* get_file_info */
pipe_user_destroy /* destroy */
};
@ -167,6 +168,24 @@ static int pipe_user_get_fd( struct object *obj )
return user->obj.fd;
}
static int pipe_user_get_info( struct object *obj, struct get_file_info_request *req )
{
if (req)
{
req->type = FILE_TYPE_PIPE;
req->attr = 0;
req->access_time = 0;
req->write_time = 0;
req->size_high = 0;
req->size_low = 0;
req->links = 0;
req->index_high = 0;
req->index_low = 0;
req->serial = 0;
}
return FD_TYPE_DEFAULT;
}
static struct named_pipe *create_named_pipe( const WCHAR *name, size_t len )
{
struct named_pipe *pipe;

View File

@ -54,6 +54,7 @@ static int sock_signaled( struct object *obj, struct thread *thread );
static int sock_get_poll_events( struct object *obj );
static void sock_poll_event( struct object *obj, int event );
static int sock_get_fd( struct object *obj );
static int sock_get_info( struct object *obj, struct get_file_info_request *req );
static void sock_destroy( struct object *obj );
static int sock_get_error( int err );
static void sock_set_error(void);
@ -70,7 +71,7 @@ static const struct object_ops sock_ops =
sock_poll_event, /* poll_event */
sock_get_fd, /* get_fd */
no_flush, /* flush */
no_get_file_info, /* get_file_info */
sock_get_info, /* get_file_info */
sock_destroy /* destroy */
};
@ -266,6 +267,24 @@ static int sock_get_fd( struct object *obj )
return sock->obj.fd;
}
static int sock_get_info( struct object *obj, struct get_file_info_request *req )
{
if (req)
{
req->type = FILE_TYPE_PIPE;
req->attr = 0;
req->access_time = 0;
req->write_time = 0;
req->size_high = 0;
req->size_low = 0;
req->links = 0;
req->index_high = 0;
req->index_low = 0;
req->serial = 0;
}
return FD_TYPE_DEFAULT;
}
static void sock_destroy( struct object *obj )
{
struct sock *sock = (struct sock *)obj;