server: Use attributes instead of inherit flag in console requests.
This commit is contained in:
parent
27b1aec925
commit
7a096601e3
|
@ -232,8 +232,8 @@ HANDLE WINAPI OpenConsoleW(LPCWSTR name, DWORD access, BOOL inherit, DWORD creat
|
||||||
{
|
{
|
||||||
req->from = output;
|
req->from = output;
|
||||||
req->access = access;
|
req->access = access;
|
||||||
|
req->attributes = inherit ? OBJ_INHERIT : 0;
|
||||||
req->share = FILE_SHARE_READ | FILE_SHARE_WRITE;
|
req->share = FILE_SHARE_READ | FILE_SHARE_WRITE;
|
||||||
req->inherit = inherit;
|
|
||||||
SetLastError(0);
|
SetLastError(0);
|
||||||
wine_server_call_err( req );
|
wine_server_call_err( req );
|
||||||
ret = reply->handle;
|
ret = reply->handle;
|
||||||
|
@ -1667,8 +1667,8 @@ HANDLE WINAPI CreateConsoleScreenBuffer(DWORD dwDesiredAccess, DWORD dwShareMode
|
||||||
{
|
{
|
||||||
req->handle_in = 0;
|
req->handle_in = 0;
|
||||||
req->access = dwDesiredAccess;
|
req->access = dwDesiredAccess;
|
||||||
|
req->attributes = (sa && sa->bInheritHandle) ? OBJ_INHERIT : 0;
|
||||||
req->share = dwShareMode;
|
req->share = dwShareMode;
|
||||||
req->inherit = (sa && sa->bInheritHandle);
|
|
||||||
if (!wine_server_call_err( req )) ret = reply->handle_out;
|
if (!wine_server_call_err( req )) ret = reply->handle_out;
|
||||||
}
|
}
|
||||||
SERVER_END_REQ;
|
SERVER_END_REQ;
|
||||||
|
|
|
@ -977,7 +977,7 @@ struct alloc_console_request
|
||||||
{
|
{
|
||||||
struct request_header __header;
|
struct request_header __header;
|
||||||
unsigned int access;
|
unsigned int access;
|
||||||
int inherit;
|
unsigned int attributes;
|
||||||
process_id_t pid;
|
process_id_t pid;
|
||||||
};
|
};
|
||||||
struct alloc_console_reply
|
struct alloc_console_reply
|
||||||
|
@ -1063,7 +1063,7 @@ struct open_console_request
|
||||||
int from;
|
int from;
|
||||||
|
|
||||||
unsigned int access;
|
unsigned int access;
|
||||||
int inherit;
|
unsigned int attributes;
|
||||||
int share;
|
int share;
|
||||||
};
|
};
|
||||||
struct open_console_reply
|
struct open_console_reply
|
||||||
|
@ -1183,9 +1183,9 @@ struct create_console_output_request
|
||||||
{
|
{
|
||||||
struct request_header __header;
|
struct request_header __header;
|
||||||
obj_handle_t handle_in;
|
obj_handle_t handle_in;
|
||||||
int access;
|
unsigned int access;
|
||||||
int share;
|
unsigned int attributes;
|
||||||
int inherit;
|
unsigned int share;
|
||||||
};
|
};
|
||||||
struct create_console_output_reply
|
struct create_console_output_reply
|
||||||
{
|
{
|
||||||
|
@ -4316,6 +4316,6 @@ union generic_reply
|
||||||
struct query_symlink_reply query_symlink_reply;
|
struct query_symlink_reply query_symlink_reply;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define SERVER_PROTOCOL_VERSION 209
|
#define SERVER_PROTOCOL_VERSION 210
|
||||||
|
|
||||||
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */
|
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */
|
||||||
|
|
|
@ -276,8 +276,8 @@ int WINECON_GrabChanges(struct inner_data* data)
|
||||||
{
|
{
|
||||||
req->from = (int)data->hConIn;
|
req->from = (int)data->hConIn;
|
||||||
req->access = GENERIC_READ | GENERIC_WRITE;
|
req->access = GENERIC_READ | GENERIC_WRITE;
|
||||||
|
req->attributes = 0;
|
||||||
req->share = FILE_SHARE_READ | FILE_SHARE_WRITE;
|
req->share = FILE_SHARE_READ | FILE_SHARE_WRITE;
|
||||||
req->inherit = FALSE;
|
|
||||||
h = wine_server_call_err( req ) ? 0 : (HANDLE)reply->handle;
|
h = wine_server_call_err( req ) ? 0 : (HANDLE)reply->handle;
|
||||||
}
|
}
|
||||||
SERVER_END_REQ;
|
SERVER_END_REQ;
|
||||||
|
@ -608,7 +608,7 @@ static struct inner_data* WINECON_Init(HINSTANCE hInst, DWORD pid, LPCWSTR appna
|
||||||
SERVER_START_REQ(alloc_console)
|
SERVER_START_REQ(alloc_console)
|
||||||
{
|
{
|
||||||
req->access = GENERIC_READ | GENERIC_WRITE;
|
req->access = GENERIC_READ | GENERIC_WRITE;
|
||||||
req->inherit = FALSE;
|
req->attributes = 0;
|
||||||
req->pid = pid;
|
req->pid = pid;
|
||||||
|
|
||||||
ret = !wine_server_call_err( req );
|
ret = !wine_server_call_err( req );
|
||||||
|
@ -631,10 +631,10 @@ static struct inner_data* WINECON_Init(HINSTANCE hInst, DWORD pid, LPCWSTR appna
|
||||||
|
|
||||||
SERVER_START_REQ(create_console_output)
|
SERVER_START_REQ(create_console_output)
|
||||||
{
|
{
|
||||||
req->handle_in = (obj_handle_t)data->hConIn;
|
req->handle_in = data->hConIn;
|
||||||
req->access = GENERIC_WRITE|GENERIC_READ;
|
req->access = GENERIC_WRITE|GENERIC_READ;
|
||||||
|
req->attributes = 0;
|
||||||
req->share = FILE_SHARE_READ|FILE_SHARE_WRITE;
|
req->share = FILE_SHARE_READ|FILE_SHARE_WRITE;
|
||||||
req->inherit = FALSE;
|
|
||||||
ret = !wine_server_call_err( req );
|
ret = !wine_server_call_err( req );
|
||||||
data->hConOut = (HANDLE)reply->handle_out;
|
data->hConOut = (HANDLE)reply->handle_out;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1240,7 +1240,7 @@ DECL_HANDLER(alloc_console)
|
||||||
}
|
}
|
||||||
if ((console = (struct console_input*)create_console_input( current )))
|
if ((console = (struct console_input*)create_console_input( current )))
|
||||||
{
|
{
|
||||||
if ((in = alloc_handle( renderer, console, req->access, req->inherit )))
|
if ((in = alloc_handle( renderer, console, req->access, req->attributes & OBJ_INHERIT )))
|
||||||
{
|
{
|
||||||
if ((evt = alloc_handle( renderer, console->evt,
|
if ((evt = alloc_handle( renderer, console->evt,
|
||||||
SYNCHRONIZE|GENERIC_READ|GENERIC_WRITE, FALSE )))
|
SYNCHRONIZE|GENERIC_READ|GENERIC_WRITE, FALSE )))
|
||||||
|
@ -1312,7 +1312,7 @@ DECL_HANDLER(open_console)
|
||||||
/* FIXME: req->share is not used (as in screen buffer creation) */
|
/* FIXME: req->share is not used (as in screen buffer creation) */
|
||||||
if (obj)
|
if (obj)
|
||||||
{
|
{
|
||||||
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 );
|
release_object( obj );
|
||||||
}
|
}
|
||||||
else if (!get_error()) set_error( STATUS_ACCESS_DENIED );
|
else if (!get_error()) set_error( STATUS_ACCESS_DENIED );
|
||||||
|
@ -1411,7 +1411,7 @@ DECL_HANDLER(create_console_output)
|
||||||
/* FIXME: should store sharing and test it when opening the CONOUT$ device
|
/* FIXME: should store sharing and test it when opening the CONOUT$ device
|
||||||
* see file.c on how this could be done */
|
* see file.c on how this could be done */
|
||||||
reply->handle_out = alloc_handle( current->process, screen_buffer,
|
reply->handle_out = alloc_handle( current->process, screen_buffer,
|
||||||
req->access, req->inherit );
|
req->access, req->attributes & OBJ_INHERIT );
|
||||||
release_object( screen_buffer );
|
release_object( screen_buffer );
|
||||||
}
|
}
|
||||||
release_object( console );
|
release_object( console );
|
||||||
|
|
|
@ -738,7 +738,7 @@ enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
|
||||||
/* Allocate a console (only used by a console renderer) */
|
/* Allocate a console (only used by a console renderer) */
|
||||||
@REQ(alloc_console)
|
@REQ(alloc_console)
|
||||||
unsigned int access; /* wanted access rights */
|
unsigned int access; /* wanted access rights */
|
||||||
int inherit; /* inherit flag */
|
unsigned int attributes; /* object attributes */
|
||||||
process_id_t pid; /* pid of process which shall be attached to the console */
|
process_id_t pid; /* pid of process which shall be attached to the console */
|
||||||
@REPLY
|
@REPLY
|
||||||
obj_handle_t handle_in; /* handle to console input */
|
obj_handle_t handle_in; /* handle to console input */
|
||||||
|
@ -808,7 +808,7 @@ struct console_renderer_event
|
||||||
int from; /* 0 (resp 1) input (resp output) of current process console */
|
int from; /* 0 (resp 1) input (resp output) of current process console */
|
||||||
/* otherwise console_in handle to get active screen buffer? */
|
/* otherwise console_in handle to get active screen buffer? */
|
||||||
unsigned int access; /* wanted access rights */
|
unsigned int access; /* wanted access rights */
|
||||||
int inherit; /* inherit flag */
|
unsigned int attributes; /* object attributes */
|
||||||
int share; /* share mask (only for output handles) */
|
int share; /* share mask (only for output handles) */
|
||||||
@REPLY
|
@REPLY
|
||||||
obj_handle_t handle; /* handle to the console */
|
obj_handle_t handle; /* handle to the console */
|
||||||
|
@ -885,9 +885,9 @@ struct console_renderer_event
|
||||||
/* creates a new screen buffer on process' console */
|
/* creates a new screen buffer on process' console */
|
||||||
@REQ(create_console_output)
|
@REQ(create_console_output)
|
||||||
obj_handle_t handle_in; /* handle to console input, or 0 for process' console */
|
obj_handle_t handle_in; /* handle to console input, or 0 for process' console */
|
||||||
int access; /* wanted access rights */
|
unsigned int access; /* wanted access rights */
|
||||||
int share; /* sharing credentials */
|
unsigned int attributes; /* object attributes */
|
||||||
int inherit; /* inherit flag */
|
unsigned int share; /* sharing credentials */
|
||||||
@REPLY
|
@REPLY
|
||||||
obj_handle_t handle_out; /* handle to the screen buffer */
|
obj_handle_t handle_out; /* handle to the screen buffer */
|
||||||
@END
|
@END
|
||||||
|
|
|
@ -1169,7 +1169,7 @@ static void dump_set_socket_deferred_request( const struct set_socket_deferred_r
|
||||||
static void dump_alloc_console_request( const struct alloc_console_request *req )
|
static void dump_alloc_console_request( const struct alloc_console_request *req )
|
||||||
{
|
{
|
||||||
fprintf( stderr, " access=%08x,", req->access );
|
fprintf( stderr, " access=%08x,", req->access );
|
||||||
fprintf( stderr, " inherit=%d,", req->inherit );
|
fprintf( stderr, " attributes=%08x,", req->attributes );
|
||||||
fprintf( stderr, " pid=%04x", req->pid );
|
fprintf( stderr, " pid=%04x", req->pid );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1198,7 +1198,7 @@ static void dump_open_console_request( const struct open_console_request *req )
|
||||||
{
|
{
|
||||||
fprintf( stderr, " from=%d,", req->from );
|
fprintf( stderr, " from=%d,", req->from );
|
||||||
fprintf( stderr, " access=%08x,", req->access );
|
fprintf( stderr, " access=%08x,", req->access );
|
||||||
fprintf( stderr, " inherit=%d,", req->inherit );
|
fprintf( stderr, " attributes=%08x,", req->attributes );
|
||||||
fprintf( stderr, " share=%d", req->share );
|
fprintf( stderr, " share=%d", req->share );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1282,9 +1282,9 @@ static void dump_get_console_input_history_reply( const struct get_console_input
|
||||||
static void dump_create_console_output_request( const struct create_console_output_request *req )
|
static void dump_create_console_output_request( const struct create_console_output_request *req )
|
||||||
{
|
{
|
||||||
fprintf( stderr, " handle_in=%p,", req->handle_in );
|
fprintf( stderr, " handle_in=%p,", req->handle_in );
|
||||||
fprintf( stderr, " access=%d,", req->access );
|
fprintf( stderr, " access=%08x,", req->access );
|
||||||
fprintf( stderr, " share=%d,", req->share );
|
fprintf( stderr, " attributes=%08x,", req->attributes );
|
||||||
fprintf( stderr, " inherit=%d", req->inherit );
|
fprintf( stderr, " share=%08x", req->share );
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dump_create_console_output_reply( const struct create_console_output_reply *req )
|
static void dump_create_console_output_reply( const struct create_console_output_reply *req )
|
||||||
|
|
Loading…
Reference in New Issue