Alexandre Julliard : Make wine_server_fd_to_handle use attributes instead of inherit flag.

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


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Dec  9 12:22:35 2005 +0100

Make wine_server_fd_to_handle use attributes instead of inherit flag.

---

 dlls/kernel/console.c         |    4 ++--
 dlls/ntdll/server.c           |    6 +++---
 dlls/ntdll/thread.c           |    6 +++---
 dlls/x11drv/x11drv_main.c     |    2 +-
 include/wine/server.h         |    2 +-
 programs/wineconsole/curses.c |    2 +-
 6 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/dlls/kernel/console.c b/dlls/kernel/console.c
index 5dac5ec..249c7c2 100644
--- a/dlls/kernel/console.c
+++ b/dlls/kernel/console.c
@@ -250,8 +250,8 @@ HANDLE WINAPI OpenConsoleW(LPCWSTR name,
         ret = INVALID_HANDLE_VALUE;
         if (fd != -1)
         {
-            DWORD attr = (output ? GENERIC_WRITE : GENERIC_READ) | SYNCHRONIZE;
-            wine_server_fd_to_handle(fd, attr, inherit, &ret);
+            DWORD access = (output ? GENERIC_WRITE : GENERIC_READ) | SYNCHRONIZE;
+            wine_server_fd_to_handle(fd, access, inherit ? OBJ_INHERIT : 0, &ret);
             close(fd);
         }
     }
diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c
index 43629a0..88c0015 100644
--- a/dlls/ntdll/server.c
+++ b/dlls/ntdll/server.c
@@ -440,13 +440,13 @@ static int receive_fd( obj_handle_t *han
  * PARAMS
  *     fd      [I] Unix file descriptor.
  *     access  [I] Win32 access flags.
- *     inherit [I] Indicates whether this handle is inherited by child processes.
+ *     attributes [I] Object attributes.
  *     handle  [O] Address where Wine file handle will be stored.
  *
  * RETURNS
  *     NTSTATUS code
  */
-int wine_server_fd_to_handle( int fd, unsigned int access, int inherit, obj_handle_t *handle )
+int wine_server_fd_to_handle( int fd, unsigned int access, unsigned int attributes, obj_handle_t *handle )
 {
     int ret;
 
@@ -456,7 +456,7 @@ int wine_server_fd_to_handle( int fd, un
     SERVER_START_REQ( alloc_file_handle )
     {
         req->access     = access;
-        req->attributes = inherit ? OBJ_INHERIT : 0;
+        req->attributes = attributes;
         req->fd         = fd;
         if (!(ret = wine_server_call( req ))) *handle = reply->handle;
     }
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index 6088c97..8367751 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -181,9 +181,9 @@ void thread_init(void)
         /* This is wine specific: we have no parent (we're started from unix)
          * so, create a simple console with bare handles to unix stdio
          */
-        wine_server_fd_to_handle( 0, GENERIC_READ|SYNCHRONIZE,  TRUE, &params.hStdInput );
-        wine_server_fd_to_handle( 1, GENERIC_WRITE|SYNCHRONIZE, TRUE, &params.hStdOutput );
-        wine_server_fd_to_handle( 2, GENERIC_WRITE|SYNCHRONIZE, TRUE, &params.hStdError );
+        wine_server_fd_to_handle( 0, GENERIC_READ|SYNCHRONIZE,  OBJ_INHERIT, &params.hStdInput );
+        wine_server_fd_to_handle( 1, GENERIC_WRITE|SYNCHRONIZE, OBJ_INHERIT, &params.hStdOutput );
+        wine_server_fd_to_handle( 2, GENERIC_WRITE|SYNCHRONIZE, OBJ_INHERIT, &params.hStdError );
     }
 }
 
diff --git a/dlls/x11drv/x11drv_main.c b/dlls/x11drv/x11drv_main.c
index 2eee0b8..5c10690 100644
--- a/dlls/x11drv/x11drv_main.c
+++ b/dlls/x11drv/x11drv_main.c
@@ -533,7 +533,7 @@ struct x11drv_thread_data *x11drv_init_t
         WARN("Input Method is not available\n");
 
     if (wine_server_fd_to_handle( ConnectionNumber(data->display), GENERIC_READ | SYNCHRONIZE,
-                                  FALSE, &data->display_fd ))
+                                  0, &data->display_fd ))
     {
         MESSAGE( "x11drv: Can't allocate handle for display fd\n" );
         ExitProcess(1);
diff --git a/include/wine/server.h b/include/wine/server.h
index aa83cac..4f7ed68 100644
--- a/include/wine/server.h
+++ b/include/wine/server.h
@@ -51,7 +51,7 @@ struct __server_request_info
 
 extern unsigned int wine_server_call( void *req_ptr );
 extern void wine_server_send_fd( int fd );
-extern int wine_server_fd_to_handle( int fd, unsigned int access, int inherit, obj_handle_t *handle );
+extern int wine_server_fd_to_handle( int fd, unsigned int access, unsigned int attributes, obj_handle_t *handle );
 extern int wine_server_handle_to_fd( obj_handle_t handle, unsigned int access, int *unix_fd, int *flags );
 extern void wine_server_release_fd( obj_handle_t handle, int unix_fd );
 
diff --git a/programs/wineconsole/curses.c b/programs/wineconsole/curses.c
index 7ec3baa..8b283da 100644
--- a/programs/wineconsole/curses.c
+++ b/programs/wineconsole/curses.c
@@ -919,7 +919,7 @@ enum init_return WCCURSES_InitBackend(st
     data->fnSetFont            = WCCURSES_SetFont;
     data->fnDeleteBackend      = WCCURSES_DeleteBackend;
 
-    if (wine_server_fd_to_handle(0, GENERIC_READ|SYNCHRONIZE, FALSE, 
+    if (wine_server_fd_to_handle(0, GENERIC_READ|SYNCHRONIZE, 0,
                                  (obj_handle_t*)&PRIVATE(data)->hInput))
     {
         WINE_FIXME("Cannot open 0\n");




More information about the wine-cvs mailing list