Commit 693bbd79 authored by Alexandre Julliard's avatar Alexandre Julliard

Make it possible to retrieve an inheritable handle in open_named_pipe

(spotted by Uwe Bonnes).
parent 15566391
......@@ -497,7 +497,7 @@ HANDLE FILE_CreateDevice( int client_id, DWORD access, LPSECURITY_ATTRIBUTES sa
return ret;
}
static HANDLE FILE_OpenPipe(LPCWSTR name, DWORD access)
static HANDLE FILE_OpenPipe(LPCWSTR name, DWORD access, LPSECURITY_ATTRIBUTES sa )
{
HANDLE ret;
DWORD len = 0;
......@@ -510,6 +510,7 @@ static HANDLE FILE_OpenPipe(LPCWSTR name, DWORD access)
SERVER_START_REQ( open_named_pipe )
{
req->access = access;
req->inherit = (sa && (sa->nLength>=sizeof(*sa)) && sa->bInheritHandle);
SetLastError(0);
wine_server_add_data( req, name, len * sizeof(WCHAR) );
wine_server_call_err( req );
......@@ -597,7 +598,7 @@ HANDLE WINAPI CreateFileW( LPCWSTR filename, DWORD access, DWORD sharing,
if(!strncmpiW(filename + 4, pipeW, 5))
{
TRACE("Opening a pipe: %s\n", debugstr_w(filename));
ret = FILE_OpenPipe(filename,access);
ret = FILE_OpenPipe( filename, access, sa );
goto done;
}
else if (isalphaW(filename[4]) && filename[5] == ':' && filename[6] == '\0')
......
......@@ -2406,6 +2406,7 @@ struct open_named_pipe_request
{
struct request_header __header;
unsigned int access;
int inherit;
/* VARARG(name,unicode_str); */
};
struct open_named_pipe_reply
......@@ -3568,6 +3569,6 @@ union generic_reply
struct get_next_hook_reply get_next_hook_reply;
};
#define SERVER_PROTOCOL_VERSION 108
#define SERVER_PROTOCOL_VERSION 109
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */
......@@ -683,7 +683,7 @@ DECL_HANDLER(open_named_pipe)
server->client = client;
client->server = server;
reply->handle = alloc_handle( current->process, client,
req->access, 0 );
req->access, req->inherit );
}
}
else
......
......@@ -1710,6 +1710,7 @@ enum message_type
/* Open an existing named pipe */
@REQ(open_named_pipe)
unsigned int access;
int inherit; /* inherit flag */
VARARG(name,unicode_str); /* pipe name */
@REPLY
obj_handle_t handle; /* handle to the pipe */
......
......@@ -1967,6 +1967,7 @@ static void dump_create_named_pipe_reply( const struct create_named_pipe_reply *
static void dump_open_named_pipe_request( const struct open_named_pipe_request *req )
{
fprintf( stderr, " access=%08x,", req->access );
fprintf( stderr, " inherit=%d,", req->inherit );
fprintf( stderr, " name=" );
dump_varargs_unicode_str( cur_size );
}
......
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