From 18c08d307a7e065e6ef3d7d826f01bb11a4b98eb Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 8 Apr 2004 19:09:04 +0000 Subject: [PATCH] Removed the get_file_info request. --- include/wine/server_protocol.h | 30 +----------------------- server/fd.c | 17 ++------------ server/file.c | 43 ++-------------------------------- server/file.h | 4 ++-- server/named_pipe.c | 19 ++------------- server/protocol.def | 20 ---------------- server/request.h | 2 -- server/serial.c | 18 ++------------ server/smb.c | 19 ++------------- server/sock.c | 17 ++------------ server/trace.c | 25 -------------------- 11 files changed, 15 insertions(+), 199 deletions(-) diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index e7b113bb653..1fa002f71c1 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -830,31 +830,6 @@ struct flush_file_reply -struct get_file_info_request -{ - struct request_header __header; - obj_handle_t handle; -}; -struct get_file_info_reply -{ - struct reply_header __header; - int type; - int attr; - time_t access_time; - time_t write_time; - time_t change_time; - int size_high; - int size_low; - int alloc_high; - int alloc_low; - int links; - int index_high; - int index_low; - unsigned int serial; -}; - - - struct lock_file_request { struct request_header __header; @@ -3165,7 +3140,6 @@ enum request REQ_get_handle_fd, REQ_truncate_file, REQ_flush_file, - REQ_get_file_info, REQ_lock_file, REQ_unlock_file, REQ_create_socket, @@ -3350,7 +3324,6 @@ union generic_request struct get_handle_fd_request get_handle_fd_request; struct truncate_file_request truncate_file_request; struct flush_file_request flush_file_request; - struct get_file_info_request get_file_info_request; struct lock_file_request lock_file_request; struct unlock_file_request unlock_file_request; struct create_socket_request create_socket_request; @@ -3533,7 +3506,6 @@ union generic_reply struct get_handle_fd_reply get_handle_fd_reply; struct truncate_file_reply truncate_file_reply; struct flush_file_reply flush_file_reply; - struct get_file_info_reply get_file_info_reply; struct lock_file_reply lock_file_reply; struct unlock_file_reply unlock_file_reply; struct create_socket_reply create_socket_reply; @@ -3672,6 +3644,6 @@ union generic_reply struct set_global_windows_reply set_global_windows_reply; }; -#define SERVER_PROTOCOL_VERSION 138 +#define SERVER_PROTOCOL_VERSION 139 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/fd.c b/server/fd.c index 6848a2ed763..1b668d738a9 100644 --- a/server/fd.c +++ b/server/fd.c @@ -1076,7 +1076,7 @@ int no_flush( struct fd *fd, struct event **event ) } /* default get_file_info() routine */ -int no_get_file_info( struct fd *fd, struct get_file_info_reply *info, int *flags ) +int no_get_file_info( struct fd *fd, int *flags ) { set_error( STATUS_OBJECT_TYPE_MISMATCH ); *flags = 0; @@ -1138,20 +1138,7 @@ DECL_HANDLER(get_handle_fd) assert( fd->unix_fd != -1 ); send_client_fd( current->process, fd->unix_fd, req->handle ); } - reply->type = fd->fd_ops->get_file_info( fd, NULL, &reply->flags ); - release_object( fd ); - } -} - -/* get a file information */ -DECL_HANDLER(get_file_info) -{ - struct fd *fd = get_handle_fd_obj( current->process, req->handle, 0 ); - - if (fd) - { - int flags; - fd->fd_ops->get_file_info( fd, reply, &flags ); + reply->type = fd->fd_ops->get_file_info( fd, &reply->flags ); release_object( fd ); } } diff --git a/server/file.c b/server/file.c index d8b0b80a83c..7c90f951496 100644 --- a/server/file.c +++ b/server/file.c @@ -69,7 +69,7 @@ static void file_destroy( struct object *obj ); static int file_get_poll_events( struct fd *fd ); static void file_poll_event( struct fd *fd, int event ); static int file_flush( struct fd *fd, struct event **event ); -static int file_get_info( struct fd *fd, struct get_file_info_reply *reply, int *flags ); +static int file_get_info( struct fd *fd, int *flags ); static void file_queue_async( struct fd *fd, void *ptr, unsigned int status, int type, int count ); static const struct object_ops file_ops = @@ -266,49 +266,10 @@ static int file_flush( struct fd *fd, struct event **event ) return ret; } -static int file_get_info( struct fd *fd, struct get_file_info_reply *reply, int *flags ) +static int file_get_info( struct fd *fd, int *flags ) { - struct stat st; struct file *file = get_fd_user( fd ); - int unix_fd = get_unix_fd( fd ); - if (reply) - { - if (fstat( unix_fd, &st ) == -1) - { - file_set_error(); - return FD_TYPE_INVALID; - } - if (S_ISCHR(st.st_mode) || S_ISFIFO(st.st_mode) || - S_ISSOCK(st.st_mode) || isatty(unix_fd)) reply->type = FILE_TYPE_CHAR; - else reply->type = FILE_TYPE_DISK; - if (S_ISDIR(st.st_mode)) reply->attr = FILE_ATTRIBUTE_DIRECTORY; - else reply->attr = FILE_ATTRIBUTE_ARCHIVE; - if (!(st.st_mode & S_IWUSR)) reply->attr |= FILE_ATTRIBUTE_READONLY; - reply->access_time = st.st_atime; - reply->write_time = st.st_mtime; - reply->change_time = st.st_ctime; - if (S_ISDIR(st.st_mode)) - { - reply->size_high = 0; - reply->size_low = 0; - reply->alloc_high = 0; - reply->alloc_low = 0; - } - else - { - file_pos_t alloc; - reply->size_high = st.st_size >> 32; - reply->size_low = st.st_size & 0xffffffff; - alloc = (file_pos_t)st.st_blksize * st.st_blocks; - reply->alloc_high = alloc >> 32; - reply->alloc_low = alloc & 0xffffffff; - } - reply->links = st.st_nlink; - reply->index_high = st.st_dev; - reply->index_low = st.st_ino; - reply->serial = 0; /* FIXME */ - } *flags = 0; if (is_overlapped( file )) *flags |= FD_FLAG_OVERLAPPED; return FD_TYPE_DEFAULT; diff --git a/server/file.h b/server/file.h index a8e5f3efd8a..159b630aa2d 100644 --- a/server/file.h +++ b/server/file.h @@ -37,7 +37,7 @@ struct fd_ops /* flush the object buffers */ int (*flush)(struct fd *, struct event **); /* get file information */ - int (*get_file_info)(struct fd *,struct get_file_info_reply *, int *flags); + int (*get_file_info)(struct fd *, int *flags); /* queue an async operation - see register_async handler in async.c*/ void (*queue_async)(struct fd *, void* ptr, unsigned int status, int type, int count); }; @@ -64,7 +64,7 @@ extern void default_fd_remove_queue( struct object *obj, struct wait_queue_entry extern int default_fd_signaled( struct object *obj, struct thread *thread ); extern void default_poll_event( struct fd *fd, int event ); extern int no_flush( struct fd *fd, struct event **event ); -extern int no_get_file_info( struct fd *fd, struct get_file_info_reply *info, int *flags ); +extern int no_get_file_info( struct fd *fd, int *flags ); extern void no_queue_async( struct fd *fd, void* ptr, unsigned int status, int type, int count ); extern void main_loop(void); diff --git a/server/named_pipe.c b/server/named_pipe.c index 0ea4e5c0699..3cd69b156e9 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c @@ -125,8 +125,7 @@ static const struct object_ops named_pipe_ops = /* common to clients and servers */ static int pipe_end_get_poll_events( struct fd *fd ); -static int pipe_end_get_info( struct fd *fd, - struct get_file_info_reply *reply, int *flags ); +static int pipe_end_get_info( struct fd *fd, int *flags ); /* server end functions */ static void pipe_server_dump( struct object *obj, int verbose ); @@ -471,22 +470,8 @@ static int pipe_client_flush( struct fd *fd, struct event **event ) return 0; } -static int pipe_end_get_info( struct fd *fd, - struct get_file_info_reply *reply, int *flags ) +static int pipe_end_get_info( struct fd *fd, int *flags ) { - if (reply) - { - reply->type = FILE_TYPE_PIPE; - reply->attr = 0; - reply->access_time = 0; - reply->write_time = 0; - reply->size_high = 0; - reply->size_low = 0; - reply->links = 0; - reply->index_high = 0; - reply->index_low = 0; - reply->serial = 0; - } *flags = 0; return FD_TYPE_DEFAULT; } diff --git a/server/protocol.def b/server/protocol.def index 65ea3e4fb1b..847eb9e71e6 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -629,26 +629,6 @@ enum fd_type @END -/* Get information about a file */ -@REQ(get_file_info) - obj_handle_t handle; /* handle to the file */ -@REPLY - int type; /* file type */ - int attr; /* file attributes */ - time_t access_time; /* last access time */ - time_t write_time; /* last write time */ - time_t change_time; /* last change time */ - int size_high; /* file size */ - int size_low; /* file size */ - int alloc_high; /* size used on disk */ - int alloc_low; /* size used on disk */ - int links; /* number of links */ - int index_high; /* unique index */ - int index_low; /* unique index */ - unsigned int serial; /* volume serial number */ -@END - - /* Lock a region of a file */ @REQ(lock_file) obj_handle_t handle; /* handle to the file */ diff --git a/server/request.h b/server/request.h index 7c58c967422..80b4d18823b 100644 --- a/server/request.h +++ b/server/request.h @@ -144,7 +144,6 @@ DECL_HANDLER(alloc_file_handle); DECL_HANDLER(get_handle_fd); DECL_HANDLER(truncate_file); DECL_HANDLER(flush_file); -DECL_HANDLER(get_file_info); DECL_HANDLER(lock_file); DECL_HANDLER(unlock_file); DECL_HANDLER(create_socket); @@ -328,7 +327,6 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] = (req_handler)req_get_handle_fd, (req_handler)req_truncate_file, (req_handler)req_flush_file, - (req_handler)req_get_file_info, (req_handler)req_lock_file, (req_handler)req_unlock_file, (req_handler)req_create_socket, diff --git a/server/serial.c b/server/serial.c index ae82199796e..5dd55d76fc5 100644 --- a/server/serial.c +++ b/server/serial.c @@ -61,7 +61,7 @@ static void serial_destroy(struct object *obj); static int serial_get_poll_events( struct fd *fd ); static void serial_poll_event( struct fd *fd, int event ); -static int serial_get_info( struct fd *fd, struct get_file_info_reply *reply, int *flags ); +static int serial_get_info( struct fd *fd, int *flags ); static int serial_flush( struct fd *fd, struct event **event ); static void serial_queue_async(struct fd *fd, void *ptr, unsigned int status, int type, int count); @@ -201,25 +201,11 @@ static int serial_get_poll_events( struct fd *fd ) return events; } -static int serial_get_info( struct fd *fd, struct get_file_info_reply *reply, int *flags ) +static int serial_get_info( struct fd *fd, int *flags ) { struct serial *serial = get_fd_user( fd ); assert( serial->obj.ops == &serial_ops ); - if (reply) - { - reply->type = FILE_TYPE_CHAR; - reply->attr = 0; - reply->access_time = 0; - reply->write_time = 0; - reply->size_high = 0; - reply->size_low = 0; - reply->links = 0; - reply->index_high = 0; - reply->index_low = 0; - reply->serial = 0; - } - *flags = 0; if (!(serial->options & (FILE_SYNCHRONOUS_IO_ALERT | FILE_SYNCHRONOUS_IO_NONALERT))) *flags |= FD_FLAG_OVERLAPPED; diff --git a/server/smb.c b/server/smb.c index 2ddd41010d1..480a48cbf50 100644 --- a/server/smb.c +++ b/server/smb.c @@ -57,7 +57,7 @@ static void smb_dump( struct object *obj, int verbose ); static struct fd *smb_get_fd( struct object *obj ); static void smb_destroy(struct object *obj); -static int smb_get_info( struct fd *fd, struct get_file_info_reply *reply, int *flags ); +static int smb_get_info( struct fd *fd, int *flags ); static int smb_get_poll_events( struct fd *fd ); struct smb @@ -130,27 +130,12 @@ static int smb_get_poll_events( struct fd *fd ) return events; } -static int smb_get_info( struct fd *fd, struct get_file_info_reply *reply, int *flags ) +static int smb_get_info( struct fd *fd, int *flags ) { /* struct smb *smb = get_fd_user( fd ); */ /* assert( smb->obj.ops == &smb_ops ); */ - if (reply) - { - reply->type = FILE_TYPE_CHAR; - reply->attr = 0; - reply->access_time = 0; - reply->write_time = 0; - reply->size_high = 0; - reply->size_low = 0; - reply->links = 0; - reply->index_high = 0; - reply->index_low = 0; - reply->serial = 0; - } - *flags = 0; - return FD_TYPE_SMB; } diff --git a/server/sock.c b/server/sock.c index 3b3e4baf37c..e18085006ff 100644 --- a/server/sock.c +++ b/server/sock.c @@ -93,7 +93,7 @@ static void sock_destroy( struct object *obj ); static int sock_get_poll_events( struct fd *fd ); static void sock_poll_event( struct fd *fd, int event ); -static int sock_get_info( struct fd *fd, struct get_file_info_reply *reply, int *flags ); +static int sock_get_info( struct fd *fd, int *flags ); static void sock_queue_async( struct fd *fd, void *ptr, unsigned int status, int type, int count ); static int sock_get_error( int err ); @@ -475,24 +475,11 @@ static int sock_get_poll_events( struct fd *fd ) return ev; } -static int sock_get_info( struct fd *fd, struct get_file_info_reply *reply, int *flags ) +static int sock_get_info( struct fd *fd, int *flags ) { struct sock *sock = get_fd_user( fd ); assert ( sock->obj.ops == &sock_ops ); - if (reply) - { - reply->type = FILE_TYPE_PIPE; - reply->attr = 0; - reply->access_time = 0; - reply->write_time = 0; - reply->size_high = 0; - reply->size_low = 0; - reply->links = 0; - reply->index_high = 0; - reply->index_low = 0; - reply->serial = 0; - } *flags = 0; if (sock->flags & WSA_FLAG_OVERLAPPED) *flags |= FD_FLAG_OVERLAPPED; if ( sock->type != SOCK_STREAM || sock->state & FD_WINE_CONNECTED ) diff --git a/server/trace.c b/server/trace.c index 558d2139765..b46cc1d8a47 100644 --- a/server/trace.c +++ b/server/trace.c @@ -886,28 +886,6 @@ static void dump_flush_file_reply( const struct flush_file_reply *req ) fprintf( stderr, " event=%p", req->event ); } -static void dump_get_file_info_request( const struct get_file_info_request *req ) -{ - fprintf( stderr, " handle=%p", req->handle ); -} - -static void dump_get_file_info_reply( const struct get_file_info_reply *req ) -{ - fprintf( stderr, " type=%d,", req->type ); - fprintf( stderr, " attr=%d,", req->attr ); - fprintf( stderr, " access_time=%ld,", (long)req->access_time ); - fprintf( stderr, " write_time=%ld,", (long)req->write_time ); - fprintf( stderr, " change_time=%ld,", (long)req->change_time ); - fprintf( stderr, " size_high=%d,", req->size_high ); - fprintf( stderr, " size_low=%d,", req->size_low ); - fprintf( stderr, " alloc_high=%d,", req->alloc_high ); - fprintf( stderr, " alloc_low=%d,", req->alloc_low ); - fprintf( stderr, " links=%d,", req->links ); - fprintf( stderr, " index_high=%d,", req->index_high ); - fprintf( stderr, " index_low=%d,", req->index_low ); - fprintf( stderr, " serial=%08x", req->serial ); -} - static void dump_lock_file_request( const struct lock_file_request *req ) { fprintf( stderr, " handle=%p,", req->handle ); @@ -2585,7 +2563,6 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = { (dump_func)dump_get_handle_fd_request, (dump_func)dump_truncate_file_request, (dump_func)dump_flush_file_request, - (dump_func)dump_get_file_info_request, (dump_func)dump_lock_file_request, (dump_func)dump_unlock_file_request, (dump_func)dump_create_socket_request, @@ -2766,7 +2743,6 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = { (dump_func)dump_get_handle_fd_reply, (dump_func)0, (dump_func)dump_flush_file_reply, - (dump_func)dump_get_file_info_reply, (dump_func)dump_lock_file_reply, (dump_func)0, (dump_func)dump_create_socket_reply, @@ -2947,7 +2923,6 @@ static const char * const req_names[REQ_NB_REQUESTS] = { "get_handle_fd", "truncate_file", "flush_file", - "get_file_info", "lock_file", "unlock_file", "create_socket",