server: Signal pipe server fd in create_pipe_server.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2016-12-02 13:37:59 +01:00 committed by Alexandre Julliard
parent 7ce4ae6895
commit d8bfbbdc07
2 changed files with 9 additions and 0 deletions

View File

@ -110,6 +110,13 @@ static BOOL RpcReadFile(HANDLE hFile, LPVOID buffer, DWORD bytesToRead, LPDWORD
return (BOOL)rpcargs.returnValue; return (BOOL)rpcargs.returnValue;
} }
#define test_signaled(h) _test_signaled(__LINE__,h)
static void _test_signaled(unsigned line, HANDLE handle)
{
DWORD res = WaitForSingleObject(handle, 0);
ok_(__FILE__,line)(res == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", res);
}
static void test_CreateNamedPipe(int pipemode) static void test_CreateNamedPipe(int pipemode)
{ {
HANDLE hnp; HANDLE hnp;
@ -176,6 +183,7 @@ static void test_CreateNamedPipe(int pipemode)
/* nDefaultWait */ NMPWAIT_USE_DEFAULT_WAIT, /* nDefaultWait */ NMPWAIT_USE_DEFAULT_WAIT,
/* lpSecurityAttrib */ NULL); /* lpSecurityAttrib */ NULL);
ok(hnp != INVALID_HANDLE_VALUE, "CreateNamedPipe failed\n"); ok(hnp != INVALID_HANDLE_VALUE, "CreateNamedPipe failed\n");
test_signaled(hnp);
ret = WaitNamedPipeA(PIPENAME, 2000); ret = WaitNamedPipeA(PIPENAME, 2000);
ok(ret, "WaitNamedPipe failed (%d)\n", GetLastError()); ok(ret, "WaitNamedPipe failed (%d)\n", GetLastError());

View File

@ -690,6 +690,7 @@ static struct pipe_server *create_pipe_server( struct named_pipe *pipe, unsigned
release_object( server ); release_object( server );
return NULL; return NULL;
} }
set_fd_signaled( server->ioctl_fd, 1 );
set_server_state( server, ps_idle_server ); set_server_state( server, ps_idle_server );
return server; return server;
} }