From ea9c9fe5bdbf4cacbda093759780ccac1ef386b4 Mon Sep 17 00:00:00 2001 From: Jinoh Kang Date: Sat, 15 Oct 2022 20:02:57 +0900 Subject: [PATCH] kernel32/tests: Add test for pipe name with a trailing backslash. --- dlls/kernel32/tests/pipe.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c index 9481835b49b..797e7e0031b 100644 --- a/dlls/kernel32/tests/pipe.c +++ b/dlls/kernel32/tests/pipe.c @@ -682,6 +682,17 @@ static void test_CreateNamedPipe(int pipemode) CloseHandle(hFile); CloseHandle(hnp); + hnp = CreateNamedPipeA("\\\\.\\pipe\\trailingslash\\", PIPE_ACCESS_DUPLEX, + PIPE_TYPE_BYTE, 1, 1024, 1024, NMPWAIT_USE_DEFAULT_WAIT, NULL); + ok(hnp != INVALID_HANDLE_VALUE, "failed to create pipe, error %lu\n", GetLastError()); + hFile = CreateFileA("\\\\.\\pipe\\trailingslash", 0, 0, NULL, OPEN_EXISTING, 0, 0); + ok(hFile == INVALID_HANDLE_VALUE, "expected opening pipe to fail\n"); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "expected ERROR_FILE_NOT_FOUND, got %lu\n", GetLastError()); + hFile = CreateFileA("\\\\.\\pipe\\trailingslash\\", 0, 0, NULL, OPEN_EXISTING, 0, 0); + ok(hFile != INVALID_HANDLE_VALUE, "failed to open pipe, error %lu\n", GetLastError()); + CloseHandle(hFile); + CloseHandle(hnp); + if (winetest_debug > 1) trace("test_CreateNamedPipe returning\n"); } -- 2.11.4.GIT