--- trunk/reactos/lib/kernel32/file/npipe.c 2005-10-31 19:12:07 UTC (rev 18914)
+++ trunk/reactos/lib/kernel32/file/npipe.c 2005-10-31 19:39:22 UTC (rev 18915)
@@ -128,23 +128,16 @@
if (!(dwOpenMode & FILE_FLAG_OVERLAPPED))
CreateOptions |= FILE_SYNCHRONOUS_IO_NONALERT;
- switch (dwOpenMode & PIPE_ACCESS_DUPLEX)
+ if (dwOpenMode & PIPE_ACCESS_INBOUND)
{
- case PIPE_ACCESS_INBOUND:
- ShareAccess |= FILE_SHARE_WRITE;
- DesiredAccess |= GENERIC_READ;
- break;
-
- case PIPE_ACCESS_OUTBOUND:
- ShareAccess |= FILE_SHARE_READ;
- DesiredAccess |= GENERIC_WRITE;
- break;
-
- case PIPE_ACCESS_DUPLEX:
- ShareAccess |= FILE_SHARE_READ | FILE_SHARE_WRITE;
- DesiredAccess |= GENERIC_READ | GENERIC_WRITE;
- break;
+ ShareAccess |= FILE_SHARE_WRITE;
+ DesiredAccess |= GENERIC_READ;
}
+ if (dwOpenMode & PIPE_ACCESS_OUTBOUND)
+ {
+ ShareAccess |= FILE_SHARE_READ;
+ DesiredAccess |= GENERIC_WRITE;
+ }
if (dwPipeMode & PIPE_TYPE_MESSAGE)
WriteModeMessage = FILE_PIPE_MESSAGE_TYPE;
@@ -243,7 +236,7 @@
NULL,
NULL);
Status = NtOpenFile(&FileHandle,
- FILE_GENERIC_READ,
+ FILE_READ_ATTRIBUTES | SYNCHRONIZE,
&ObjectAttributes,
&Iosb,
FILE_SHARE_READ | FILE_SHARE_WRITE,