Make wine_server_fd_to_handle use attributes instead of inherit flag.
This commit is contained in:
parent
2c54b34467
commit
d02c4a1b82
|
@ -250,8 +250,8 @@ HANDLE WINAPI OpenConsoleW(LPCWSTR name, DWORD access, BOOL inherit, DWORD creat
|
||||||
ret = INVALID_HANDLE_VALUE;
|
ret = INVALID_HANDLE_VALUE;
|
||||||
if (fd != -1)
|
if (fd != -1)
|
||||||
{
|
{
|
||||||
DWORD attr = (output ? GENERIC_WRITE : GENERIC_READ) | SYNCHRONIZE;
|
DWORD access = (output ? GENERIC_WRITE : GENERIC_READ) | SYNCHRONIZE;
|
||||||
wine_server_fd_to_handle(fd, attr, inherit, &ret);
|
wine_server_fd_to_handle(fd, access, inherit ? OBJ_INHERIT : 0, &ret);
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -440,13 +440,13 @@ static int receive_fd( obj_handle_t *handle )
|
||||||
* PARAMS
|
* PARAMS
|
||||||
* fd [I] Unix file descriptor.
|
* fd [I] Unix file descriptor.
|
||||||
* access [I] Win32 access flags.
|
* 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.
|
* handle [O] Address where Wine file handle will be stored.
|
||||||
*
|
*
|
||||||
* RETURNS
|
* RETURNS
|
||||||
* NTSTATUS code
|
* 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;
|
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 )
|
SERVER_START_REQ( alloc_file_handle )
|
||||||
{
|
{
|
||||||
req->access = access;
|
req->access = access;
|
||||||
req->attributes = inherit ? OBJ_INHERIT : 0;
|
req->attributes = attributes;
|
||||||
req->fd = fd;
|
req->fd = fd;
|
||||||
if (!(ret = wine_server_call( req ))) *handle = reply->handle;
|
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)
|
/* This is wine specific: we have no parent (we're started from unix)
|
||||||
* so, create a simple console with bare handles to unix stdio
|
* so, create a simple console with bare handles to unix stdio
|
||||||
*/
|
*/
|
||||||
wine_server_fd_to_handle( 0, GENERIC_READ|SYNCHRONIZE, TRUE, ¶ms.hStdInput );
|
wine_server_fd_to_handle( 0, GENERIC_READ|SYNCHRONIZE, OBJ_INHERIT, ¶ms.hStdInput );
|
||||||
wine_server_fd_to_handle( 1, GENERIC_WRITE|SYNCHRONIZE, TRUE, ¶ms.hStdOutput );
|
wine_server_fd_to_handle( 1, GENERIC_WRITE|SYNCHRONIZE, OBJ_INHERIT, ¶ms.hStdOutput );
|
||||||
wine_server_fd_to_handle( 2, GENERIC_WRITE|SYNCHRONIZE, TRUE, ¶ms.hStdError );
|
wine_server_fd_to_handle( 2, GENERIC_WRITE|SYNCHRONIZE, OBJ_INHERIT, ¶ms.hStdError );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -533,7 +533,7 @@ struct x11drv_thread_data *x11drv_init_thread_data(void)
|
||||||
WARN("Input Method is not available\n");
|
WARN("Input Method is not available\n");
|
||||||
|
|
||||||
if (wine_server_fd_to_handle( ConnectionNumber(data->display), GENERIC_READ | SYNCHRONIZE,
|
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" );
|
MESSAGE( "x11drv: Can't allocate handle for display fd\n" );
|
||||||
ExitProcess(1);
|
ExitProcess(1);
|
||||||
|
|
|
@ -51,7 +51,7 @@ struct __server_request_info
|
||||||
|
|
||||||
extern unsigned int wine_server_call( void *req_ptr );
|
extern unsigned int wine_server_call( void *req_ptr );
|
||||||
extern void wine_server_send_fd( int fd );
|
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 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 );
|
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->fnSetFont = WCCURSES_SetFont;
|
||||||
data->fnDeleteBackend = WCCURSES_DeleteBackend;
|
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))
|
(obj_handle_t*)&PRIVATE(data)->hInput))
|
||||||
{
|
{
|
||||||
WINE_FIXME("Cannot open 0\n");
|
WINE_FIXME("Cannot open 0\n");
|
||||||
|
|
Loading…
Reference in New Issue