From 7b910f40f266476514cbafd4c43199c8651cdb18 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 9 Dec 2005 12:21:35 +0100 Subject: [PATCH] server: Use attributes instead of inherit flag in dup_handle request. --- dlls/ntdll/om.c | 2 +- include/wine/server_protocol.h | 6 +++--- server/handle.c | 4 ++-- server/protocol.def | 4 ++-- server/trace.c | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dlls/ntdll/om.c b/dlls/ntdll/om.c index 8a358eb184e..c46845a8d60 100644 --- a/dlls/ntdll/om.c +++ b/dlls/ntdll/om.c @@ -306,7 +306,7 @@ NTSTATUS WINAPI NtDuplicateObject( HANDLE source_process, HANDLE source, req->src_handle = source; req->dst_process = dest_process; req->access = access; - req->inherit = (attributes & OBJ_INHERIT) != 0; + req->attributes = attributes; req->options = options; if (!(ret = wine_server_call( req ))) diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 65a5be81269..f494e54113d 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -547,8 +547,8 @@ struct dup_handle_request obj_handle_t src_handle; obj_handle_t dst_process; unsigned int access; - int inherit; - int options; + unsigned int attributes; + unsigned int options; }; struct dup_handle_reply { @@ -4321,6 +4321,6 @@ union generic_reply struct query_symlink_reply query_symlink_reply; }; -#define SERVER_PROTOCOL_VERSION 213 +#define SERVER_PROTOCOL_VERSION 214 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/handle.c b/server/handle.c index 176249efe76..9ba56b6c2bb 100644 --- a/server/handle.c +++ b/server/handle.c @@ -573,12 +573,12 @@ DECL_HANDLER(dup_handle) if (req->options & DUP_HANDLE_MAKE_GLOBAL) { reply->handle = duplicate_handle( src, req->src_handle, NULL, - req->access, req->inherit, req->options ); + req->access, req->attributes & OBJ_INHERIT, req->options ); } else if ((dst = get_process_from_handle( req->dst_process, PROCESS_DUP_HANDLE ))) { reply->handle = duplicate_handle( src, req->src_handle, dst, - req->access, req->inherit, req->options ); + req->access, req->attributes & OBJ_INHERIT, req->options ); release_object( dst ); } /* close the handle no matter what happened */ diff --git a/server/protocol.def b/server/protocol.def index 70b587aaa10..3fd4ff0d322 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -450,8 +450,8 @@ enum apc_type { APC_NONE, APC_USER, APC_TIMER, APC_ASYNC_IO }; obj_handle_t src_handle; /* src handle to duplicate */ obj_handle_t dst_process; /* dst process handle */ unsigned int access; /* wanted access rights */ - int inherit; /* inherit flag */ - int options; /* duplicate options (see below) */ + unsigned int attributes; /* object attributes */ + unsigned int options; /* duplicate options (see below) */ @REPLY obj_handle_t handle; /* duplicated handle in dst process */ int fd; /* associated fd to close */ diff --git a/server/trace.c b/server/trace.c index aff977fae88..e0947e2a1de 100644 --- a/server/trace.c +++ b/server/trace.c @@ -846,8 +846,8 @@ static void dump_dup_handle_request( const struct dup_handle_request *req ) fprintf( stderr, " src_handle=%p,", req->src_handle ); fprintf( stderr, " dst_process=%p,", req->dst_process ); fprintf( stderr, " access=%08x,", req->access ); - fprintf( stderr, " inherit=%d,", req->inherit ); - fprintf( stderr, " options=%d", req->options ); + fprintf( stderr, " attributes=%08x,", req->attributes ); + fprintf( stderr, " options=%08x", req->options ); } static void dump_dup_handle_reply( const struct dup_handle_reply *req )