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

This commit is contained in:
Alexandre Julliard 2005-12-09 12:05:20 +01:00
parent 27b1aec925
commit 7a096601e3
6 changed files with 36 additions and 36 deletions

View File

@ -232,8 +232,8 @@ HANDLE WINAPI OpenConsoleW(LPCWSTR name, DWORD access, BOOL inherit, DWORD creat
{
req->from = output;
req->access = access;
req->attributes = inherit ? OBJ_INHERIT : 0;
req->share = FILE_SHARE_READ | FILE_SHARE_WRITE;
req->inherit = inherit;
SetLastError(0);
wine_server_call_err( req );
ret = reply->handle;
@ -1667,8 +1667,8 @@ HANDLE WINAPI CreateConsoleScreenBuffer(DWORD dwDesiredAccess, DWORD dwShareMode
{
req->handle_in = 0;
req->access = dwDesiredAccess;
req->attributes = (sa && sa->bInheritHandle) ? OBJ_INHERIT : 0;
req->share = dwShareMode;
req->inherit = (sa && sa->bInheritHandle);
if (!wine_server_call_err( req )) ret = reply->handle_out;
}
SERVER_END_REQ;

View File

@ -977,7 +977,7 @@ struct alloc_console_request
{
struct request_header __header;
unsigned int access;
int inherit;
unsigned int attributes;
process_id_t pid;
};
struct alloc_console_reply
@ -1063,7 +1063,7 @@ struct open_console_request
int from;
unsigned int access;
int inherit;
unsigned int attributes;
int share;
};
struct open_console_reply
@ -1183,9 +1183,9 @@ struct create_console_output_request
{
struct request_header __header;
obj_handle_t handle_in;
int access;
int share;
int inherit;
unsigned int access;
unsigned int attributes;
unsigned int share;
};
struct create_console_output_reply
{
@ -4316,6 +4316,6 @@ union generic_reply
struct query_symlink_reply query_symlink_reply;
};
#define SERVER_PROTOCOL_VERSION 209
#define SERVER_PROTOCOL_VERSION 210
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */

View File

@ -276,8 +276,8 @@ int WINECON_GrabChanges(struct inner_data* data)
{
req->from = (int)data->hConIn;
req->access = GENERIC_READ | GENERIC_WRITE;
req->attributes = 0;
req->share = FILE_SHARE_READ | FILE_SHARE_WRITE;
req->inherit = FALSE;
h = wine_server_call_err( req ) ? 0 : (HANDLE)reply->handle;
}
SERVER_END_REQ;
@ -608,7 +608,7 @@ static struct inner_data* WINECON_Init(HINSTANCE hInst, DWORD pid, LPCWSTR appna
SERVER_START_REQ(alloc_console)
{
req->access = GENERIC_READ | GENERIC_WRITE;
req->inherit = FALSE;
req->attributes = 0;
req->pid = pid;
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)
{
req->handle_in = (obj_handle_t)data->hConIn;
req->handle_in = data->hConIn;
req->access = GENERIC_WRITE|GENERIC_READ;
req->attributes = 0;
req->share = FILE_SHARE_READ|FILE_SHARE_WRITE;
req->inherit = FALSE;
ret = !wine_server_call_err( req );
data->hConOut = (HANDLE)reply->handle_out;
}

View File

@ -1240,7 +1240,7 @@ DECL_HANDLER(alloc_console)
}
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,
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) */
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 );
}
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
* see file.c on how this could be done */
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( console );

View File

@ -738,7 +738,7 @@ enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
/* Allocate a console (only used by a console renderer) */
@REQ(alloc_console)
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 */
@REPLY
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 */
/* otherwise console_in handle to get active screen buffer? */
unsigned int access; /* wanted access rights */
int inherit; /* inherit flag */
unsigned int attributes; /* object attributes */
int share; /* share mask (only for output handles) */
@REPLY
obj_handle_t handle; /* handle to the console */
@ -885,9 +885,9 @@ struct console_renderer_event
/* creates a new screen buffer on process' console */
@REQ(create_console_output)
obj_handle_t handle_in; /* handle to console input, or 0 for process' console */
int access; /* wanted access rights */
int share; /* sharing credentials */
int inherit; /* inherit flag */
unsigned int access; /* wanted access rights */
unsigned int attributes; /* object attributes */
unsigned int share; /* sharing credentials */
@REPLY
obj_handle_t handle_out; /* handle to the screen buffer */
@END

View File

@ -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 )
{
fprintf( stderr, " access=%08x,", req->access );
fprintf( stderr, " inherit=%d,", req->inherit );
fprintf( stderr, " attributes=%08x,", req->attributes );
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, " access=%08x,", req->access );
fprintf( stderr, " inherit=%d,", req->inherit );
fprintf( stderr, " attributes=%08x,", req->attributes );
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 )
{
fprintf( stderr, " handle_in=%p,", req->handle_in );
fprintf( stderr, " access=%d,", req->access );
fprintf( stderr, " share=%d,", req->share );
fprintf( stderr, " inherit=%d", req->inherit );
fprintf( stderr, " access=%08x,", req->access );
fprintf( stderr, " attributes=%08x,", req->attributes );
fprintf( stderr, " share=%08x", req->share );
}
static void dump_create_console_output_reply( const struct create_console_output_reply *req )