From 52e523d86c4eab764bfe183ecee3815acc8fdd81 Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Mon, 31 Oct 2005 19:39:22 +0000 Subject: [PATCH] don't ask for generic read access rights in WaitNamedPipe svn path=/trunk/; revision=18915 --- reactos/lib/kernel32/file/npipe.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/reactos/lib/kernel32/file/npipe.c b/reactos/lib/kernel32/file/npipe.c index fabf3a82299..d464992c8f5 100644 --- a/reactos/lib/kernel32/file/npipe.c +++ b/reactos/lib/kernel32/file/npipe.c @@ -128,22 +128,15 @@ CreateNamedPipeW(LPCWSTR lpName, 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) @@ -243,7 +236,7 @@ WaitNamedPipeW(LPCWSTR lpNamedPipeName, NULL, NULL); Status = NtOpenFile(&FileHandle, - FILE_GENERIC_READ, + FILE_READ_ATTRIBUTES | SYNCHRONIZE, &ObjectAttributes, &Iosb, FILE_SHARE_READ | FILE_SHARE_WRITE,