diff --git a/dlls/kernel32/sync.c b/dlls/kernel32/sync.c index 6c7249ca127..a855e95117b 100644 --- a/dlls/kernel32/sync.c +++ b/dlls/kernel32/sync.c @@ -2085,8 +2085,8 @@ BOOL WINAPI CreatePipe( PHANDLE hReadPipe, PHANDLE hWritePipe, snprintfW(name, ARRAY_SIZE(name), nameFmt, GetCurrentProcessId(), ++index); RtlInitUnicodeString(&nt_name, name); - status = NtCreateNamedPipeFile(&hr, GENERIC_READ | SYNCHRONIZE, &attr, &iosb, - FILE_SHARE_WRITE, FILE_OVERWRITE_IF, + status = NtCreateNamedPipeFile(&hr, GENERIC_READ | FILE_WRITE_ATTRIBUTES | SYNCHRONIZE, + &attr, &iosb, FILE_SHARE_WRITE, FILE_OVERWRITE_IF, FILE_SYNCHRONOUS_IO_NONALERT, FALSE, FALSE, FALSE, 1, size, size, &timeout); @@ -2099,7 +2099,7 @@ BOOL WINAPI CreatePipe( PHANDLE hReadPipe, PHANDLE hWritePipe, /* from completion sakeness, I think system resources might be exhausted before this happens !! */ if (hr == INVALID_HANDLE_VALUE) return FALSE; - status = NtOpenFile(&hw, GENERIC_WRITE | SYNCHRONIZE, &attr, &iosb, 0, + status = NtOpenFile(&hw, GENERIC_WRITE | FILE_READ_ATTRIBUTES | SYNCHRONIZE, &attr, &iosb, 0, FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE); if (status) diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c index 209a0c0fd2a..1e67f70f2d7 100644 --- a/dlls/kernel32/tests/pipe.c +++ b/dlls/kernel32/tests/pipe.c @@ -1534,6 +1534,11 @@ static void test_CreatePipe(void) ok(CreatePipe(&piperead, &pipewrite, &pipe_attr, 0) != 0, "CreatePipe failed\n"); test_pipe_info(piperead, FILE_PIPE_SERVER_END, 4096, 4096, 1); test_pipe_info(pipewrite, 0, 4096, 4096, 1); + test_file_access(piperead, SYNCHRONIZE | READ_CONTROL | FILE_WRITE_ATTRIBUTES + | FILE_READ_ATTRIBUTES | FILE_READ_PROPERTIES | FILE_READ_DATA); + test_file_access(pipewrite, SYNCHRONIZE | READ_CONTROL | FILE_WRITE_ATTRIBUTES + | FILE_READ_ATTRIBUTES | FILE_WRITE_PROPERTIES | FILE_APPEND_DATA + | FILE_WRITE_DATA); ok(WriteFile(pipewrite,PIPENAME,sizeof(PIPENAME), &written, NULL), "Write to anonymous pipe failed\n"); ok(written == sizeof(PIPENAME), "Write to anonymous pipe wrote %d bytes\n", written);