Alexandre Julliard : server: Use attributes instead of inherit flag in socket requests.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Dec 9 05:54:16 CST 2005


Module: wine
Branch: refs/heads/master
Commit: bc30303c5668877f7dcb927ddf8777da9e3b5316
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=bc30303c5668877f7dcb927ddf8777da9e3b5316

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Dec  9 11:58:55 2005 +0100

server: Use attributes instead of inherit flag in socket requests.

---

 dlls/winsock/socket.c          |   18 +++++++++---------
 include/wine/server_protocol.h |    6 +++---
 server/protocol.def            |    4 ++--
 server/sock.c                  |    6 ++++--
 server/trace.c                 |    4 ++--
 5 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/dlls/winsock/socket.c b/dlls/winsock/socket.c
index e83e747..e67363b 100644
--- a/dlls/winsock/socket.c
+++ b/dlls/winsock/socket.c
@@ -1592,9 +1592,9 @@ SOCKET WINAPI WS_accept(SOCKET s, struct
         }
         SERVER_START_REQ( accept_socket )
         {
-            req->lhandle = SOCKET2HANDLE(s);
-            req->access  = GENERIC_READ|GENERIC_WRITE|SYNCHRONIZE;
-            req->inherit = TRUE;
+            req->lhandle    = SOCKET2HANDLE(s);
+            req->access     = GENERIC_READ|GENERIC_WRITE|SYNCHRONIZE;
+            req->attributes = OBJ_INHERIT;
             set_error( wine_server_call( req ) );
             as = HANDLE2SOCKET( reply->handle );
         }
@@ -3513,12 +3513,12 @@ SOCKET WINAPI WSASocketW(int af, int typ
 
     SERVER_START_REQ( create_socket )
     {
-        req->family   = af;
-        req->type     = type;
-        req->protocol = protocol;
-        req->access   = GENERIC_READ|GENERIC_WRITE|SYNCHRONIZE;
-        req->flags    = dwFlags;
-        req->inherit  = TRUE;
+        req->family     = af;
+        req->type       = type;
+        req->protocol   = protocol;
+        req->access     = GENERIC_READ|GENERIC_WRITE|SYNCHRONIZE;
+        req->attributes = OBJ_INHERIT;
+        req->flags      = dwFlags;
         set_error( wine_server_call( req ) );
         ret = HANDLE2SOCKET( reply->handle );
     }
diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h
index b81cc6c..359affa 100644
--- a/include/wine/server_protocol.h
+++ b/include/wine/server_protocol.h
@@ -885,7 +885,7 @@ struct create_socket_request
 {
     struct request_header __header;
     unsigned int access;
-    int          inherit;
+    unsigned int attributes;
     int          family;
     int          type;
     int          protocol;
@@ -904,7 +904,7 @@ struct accept_socket_request
     struct request_header __header;
     obj_handle_t lhandle;
     unsigned int access;
-    int          inherit;
+    unsigned int attributes;
 };
 struct accept_socket_reply
 {
@@ -4316,6 +4316,6 @@ union generic_reply
     struct query_symlink_reply query_symlink_reply;
 };
 
-#define SERVER_PROTOCOL_VERSION 207
+#define SERVER_PROTOCOL_VERSION 208
 
 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */
diff --git a/server/protocol.def b/server/protocol.def
index dc302b0..bbb842e 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -679,7 +679,7 @@ enum event_op { PULSE_EVENT, SET_EVENT, 
 /* Create a socket */
 @REQ(create_socket)
     unsigned int access;        /* wanted access rights */
-    int          inherit;       /* inherit flag */
+    unsigned int attributes;    /* object attributes */
     int          family;        /* family, see socket manpage */
     int          type;          /* type, see socket manpage */
     int          protocol;      /* protocol, see socket manpage */
@@ -693,7 +693,7 @@ enum event_op { PULSE_EVENT, SET_EVENT, 
 @REQ(accept_socket)
     obj_handle_t lhandle;       /* handle to the listening socket */
     unsigned int access;        /* wanted access rights */
-    int          inherit;       /* inherit flag */
+    unsigned int attributes;    /* object attributes */
 @REPLY
     obj_handle_t handle;        /* handle to the new socket */
 @END
diff --git a/server/sock.c b/server/sock.c
index 62f39e5..6e2acbb 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -773,7 +773,8 @@ DECL_HANDLER(create_socket)
     reply->handle = 0;
     if ((obj = create_socket( req->family, req->type, req->protocol, req->flags )) != NULL)
     {
-        reply->handle = alloc_handle( current->process, obj, req->access, req->inherit );
+        reply->handle = alloc_handle( current->process, obj, req->access,
+                                      req->attributes & OBJ_INHERIT );
         release_object( obj );
     }
 }
@@ -786,7 +787,8 @@ DECL_HANDLER(accept_socket)
     reply->handle = 0;
     if ((sock = accept_socket( req->lhandle )) != NULL)
     {
-        reply->handle = alloc_handle( current->process, &sock->obj, req->access, req->inherit );
+        reply->handle = alloc_handle( current->process, &sock->obj, req->access,
+                                      req->attributes & OBJ_INHERIT );
         sock->wparam = reply->handle;  /* wparam for message is the socket handle */
         sock_reselect( sock );
         release_object( &sock->obj );
diff --git a/server/trace.c b/server/trace.c
index 5319912..eeb4e76 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -1103,7 +1103,7 @@ static void dump_unmount_device_request(
 static void dump_create_socket_request( const struct create_socket_request *req )
 {
     fprintf( stderr, " access=%08x,", req->access );
-    fprintf( stderr, " inherit=%d,", req->inherit );
+    fprintf( stderr, " attributes=%08x,", req->attributes );
     fprintf( stderr, " family=%d,", req->family );
     fprintf( stderr, " type=%d,", req->type );
     fprintf( stderr, " protocol=%d,", req->protocol );
@@ -1119,7 +1119,7 @@ static void dump_accept_socket_request( 
 {
     fprintf( stderr, " lhandle=%p,", req->lhandle );
     fprintf( stderr, " access=%08x,", req->access );
-    fprintf( stderr, " inherit=%d", req->inherit );
+    fprintf( stderr, " attributes=%08x", req->attributes );
 }
 
 static void dump_accept_socket_reply( const struct accept_socket_reply *req )




More information about the wine-cvs mailing list