kernel32/tests: Test that ConnectNamedPipe() works immediately after DisconnectNamedPipe() without waiting for the client to close.

Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Ken Thomases 2016-10-20 14:31:51 -05:00 committed by Alexandre Julliard
parent 780ede1cde
commit e85f0e0c3b
1 changed files with 14 additions and 0 deletions

View File

@ -2060,6 +2060,20 @@ static DWORD CALLBACK overlapped_server(LPVOID arg)
ok(ret == 1, "ret %d\n", ret); ok(ret == 1, "ret %d\n", ret);
DisconnectNamedPipe(pipe); DisconnectNamedPipe(pipe);
ret = ConnectNamedPipe(pipe, &ol);
err = GetLastError();
ok(ret == 0, "ret %d\n", ret);
ok(err == ERROR_IO_PENDING, "gle %d\n", err);
CancelIo(pipe);
ret = WaitForSingleObjectEx(ol.hEvent, INFINITE, 1);
ok(ret == WAIT_OBJECT_0, "ret %x\n", ret);
ret = GetOverlappedResult(pipe, &ol, &num, 1);
err = GetLastError();
ok(ret == 0, "ret %d\n", ret);
ok(err == ERROR_OPERATION_ABORTED, "gle %d\n", err);
CloseHandle(ol.hEvent); CloseHandle(ol.hEvent);
CloseHandle(pipe); CloseHandle(pipe);
return 1; return 1;