Alexandre Julliard : server: Use attributes instead of inherit flag
in file requests.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Dec 9 05:54:18 CST 2005
Module: wine
Branch: refs/heads/master
Commit: 27b1aec925e445488b99b686573835a2263787cd
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=27b1aec925e445488b99b686573835a2263787cd
Author: Alexandre Julliard <julliard at winehq.org>
Date: Fri Dec 9 12:00:48 2005 +0100
server: Use attributes instead of inherit flag in file requests.
---
dlls/ntdll/file.c | 2 +-
dlls/ntdll/server.c | 6 +++---
include/wine/server_protocol.h | 6 +++---
server/file.c | 6 ++++--
server/protocol.def | 4 ++--
server/trace.c | 4 ++--
6 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 660ba1b..2e70296 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -214,7 +214,7 @@ NTSTATUS WINAPI NtCreateFile( PHANDLE ha
SERVER_START_REQ( create_file )
{
req->access = access;
- req->inherit = (attr->Attributes & OBJ_INHERIT) != 0;
+ req->attributes = attr->Attributes;
req->sharing = sharing;
req->create = disposition;
req->options = options;
diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c
index 7bd015c..43629a0 100644
--- a/dlls/ntdll/server.c
+++ b/dlls/ntdll/server.c
@@ -455,9 +455,9 @@ int wine_server_fd_to_handle( int fd, un
SERVER_START_REQ( alloc_file_handle )
{
- req->access = access;
- req->inherit = inherit;
- req->fd = fd;
+ req->access = access;
+ req->attributes = inherit ? OBJ_INHERIT : 0;
+ req->fd = fd;
if (!(ret = wine_server_call( req ))) *handle = reply->handle;
}
SERVER_END_REQ;
diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h
index 359affa..4677cfb 100644
--- a/include/wine/server_protocol.h
+++ b/include/wine/server_protocol.h
@@ -754,7 +754,7 @@ struct create_file_request
{
struct request_header __header;
unsigned int access;
- int inherit;
+ unsigned int attributes;
unsigned int sharing;
int create;
unsigned int options;
@@ -773,7 +773,7 @@ struct alloc_file_handle_request
{
struct request_header __header;
unsigned int access;
- int inherit;
+ unsigned int attributes;
int fd;
};
struct alloc_file_handle_reply
@@ -4316,6 +4316,6 @@ union generic_reply
struct query_symlink_reply query_symlink_reply;
};
-#define SERVER_PROTOCOL_VERSION 208
+#define SERVER_PROTOCOL_VERSION 209
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */
diff --git a/server/file.c b/server/file.c
index 4d13ca7..1b34c7a 100644
--- a/server/file.c
+++ b/server/file.c
@@ -356,7 +356,8 @@ DECL_HANDLER(create_file)
if ((file = create_file( get_req_data(), get_req_data_size(), req->access,
req->sharing, req->create, req->options, req->attrs )))
{
- reply->handle = alloc_handle( current->process, file, req->access, req->inherit );
+ reply->handle = alloc_handle( current->process, file, req->access,
+ req->attributes & OBJ_INHERIT );
release_object( file );
}
}
@@ -375,7 +376,8 @@ DECL_HANDLER(alloc_file_handle)
}
if ((file = create_file_for_fd( fd, req->access, FILE_SHARE_READ | FILE_SHARE_WRITE )))
{
- reply->handle = alloc_handle( current->process, file, req->access, req->inherit );
+ reply->handle = alloc_handle( current->process, file, req->access,
+ req->attributes & OBJ_INHERIT );
release_object( file );
}
}
diff --git a/server/protocol.def b/server/protocol.def
index bbb842e..98bcb90 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -590,7 +590,7 @@ enum event_op { PULSE_EVENT, SET_EVENT,
/* Create a file */
@REQ(create_file)
unsigned int access; /* wanted access rights */
- int inherit; /* inherit flag */
+ unsigned int attributes; /* object attributes */
unsigned int sharing; /* sharing flags */
int create; /* file create action */
unsigned int options; /* file options */
@@ -604,7 +604,7 @@ enum event_op { PULSE_EVENT, SET_EVENT,
/* Allocate a file handle for a Unix fd */
@REQ(alloc_file_handle)
unsigned int access; /* wanted access rights */
- int inherit; /* inherit flag */
+ unsigned int attributes; /* object attributes */
int fd; /* file descriptor on the client side */
@REPLY
obj_handle_t handle; /* handle to the file */
diff --git a/server/trace.c b/server/trace.c
index eeb4e76..6ede1c2 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -1008,7 +1008,7 @@ static void dump_open_semaphore_reply( c
static void dump_create_file_request( const struct create_file_request *req )
{
fprintf( stderr, " access=%08x,", req->access );
- fprintf( stderr, " inherit=%d,", req->inherit );
+ fprintf( stderr, " attributes=%08x,", req->attributes );
fprintf( stderr, " sharing=%08x,", req->sharing );
fprintf( stderr, " create=%d,", req->create );
fprintf( stderr, " options=%08x,", req->options );
@@ -1025,7 +1025,7 @@ static void dump_create_file_reply( cons
static void dump_alloc_file_handle_request( const struct alloc_file_handle_request *req )
{
fprintf( stderr, " access=%08x,", req->access );
- fprintf( stderr, " inherit=%d,", req->inherit );
+ fprintf( stderr, " attributes=%08x,", req->attributes );
fprintf( stderr, " fd=%d", req->fd );
}
More information about the wine-cvs
mailing list