Commit d02c4a1b authored by Alexandre Julliard's avatar Alexandre Julliard

Make wine_server_fd_to_handle use attributes instead of inherit flag.

parent 2c54b344
......@@ -250,8 +250,8 @@ HANDLE WINAPI OpenConsoleW(LPCWSTR name, DWORD access, BOOL inherit, DWORD creat
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);
}
}
......
......@@ -440,13 +440,13 @@ static int receive_fd( obj_handle_t *handle )
* 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, unsigned int access, int inherit, obj_hand
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;
}
......
......@@ -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 );
}
}
......
......@@ -533,7 +533,7 @@ struct x11drv_thread_data *x11drv_init_thread_data(void)
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);
......
......@@ -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 );
......
......@@ -919,7 +919,7 @@ enum init_return WCCURSES_InitBackend(struct inner_data* data)
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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment