Removed the get_file_info request.
diff --git a/server/fd.c b/server/fd.c
index 6848a2e..1b668d7 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -1076,7 +1076,7 @@
}
/* 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 @@
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 d8b0b80..7c90f95 100644
--- a/server/file.c
+++ b/server/file.c
@@ -69,7 +69,7 @@
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 @@
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 a8e5f3e..159b630 100644
--- a/server/file.h
+++ b/server/file.h
@@ -37,7 +37,7 @@
/* 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 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 0ea4e5c..3cd69b1 100644
--- a/server/named_pipe.c
+++ b/server/named_pipe.c
@@ -125,8 +125,7 @@
/* 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 @@
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 65ea3e4..847eb9e 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -629,26 +629,6 @@
@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 7c58c96..80b4d18 100644
--- a/server/request.h
+++ b/server/request.h
@@ -144,7 +144,6 @@
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 @@
(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 ae82199..5dd55d7 100644
--- a/server/serial.c
+++ b/server/serial.c
@@ -61,7 +61,7 @@
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 @@
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 2ddd410..480a48c 100644
--- a/server/smb.c
+++ b/server/smb.c
@@ -57,7 +57,7 @@
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 @@
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 3b3e4ba..e180850 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -93,7 +93,7 @@
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 @@
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 558d213..b46cc1d 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -886,28 +886,6 @@
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 @@
(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 @@
(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 @@
"get_handle_fd",
"truncate_file",
"flush_file",
- "get_file_info",
"lock_file",
"unlock_file",
"create_socket",