Commit 8712db6f authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

kernel32: Use proper access flags in CreatePipe.

parent 8db78ecc
......@@ -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)
......
......@@ -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);
......
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