little simplification

svn path=/trunk/; revision=11241
This commit is contained in:
Thomas Bluemel 2004-10-08 23:12:29 +00:00
parent 6961ff9728
commit a30f6d7c94

View file

@ -1,4 +1,4 @@
/* $Id: pipe.c,v 1.11 2004/10/08 21:48:46 weiden Exp $ /* $Id: pipe.c,v 1.12 2004/10/08 23:12:29 weiden Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
@ -37,7 +37,7 @@ BOOL STDCALL CreatePipe(PHANDLE hReadPipe,
NTSTATUS Status; NTSTATUS Status;
HANDLE ReadPipeHandle; HANDLE ReadPipeHandle;
HANDLE WritePipeHandle; HANDLE WritePipeHandle;
ULONG PipeId; ULONG PipeId, Attributes;
PSECURITY_DESCRIPTOR SecurityDescriptor = NULL; PSECURITY_DESCRIPTOR SecurityDescriptor = NULL;
DefaultTimeout.QuadPart = 300000000; /* 30 seconds */ DefaultTimeout.QuadPart = 300000000; /* 30 seconds */
@ -50,23 +50,19 @@ BOOL STDCALL CreatePipe(PHANDLE hReadPipe,
RtlInitUnicodeString (&PipeName, RtlInitUnicodeString (&PipeName,
Buffer); Buffer);
Attributes = OBJ_CASE_INSENSITIVE;
if (lpPipeAttributes) if (lpPipeAttributes)
{ {
SecurityDescriptor = lpPipeAttributes->lpSecurityDescriptor; SecurityDescriptor = lpPipeAttributes->lpSecurityDescriptor;
if(lpPipeAttributes->bInheritHandle)
Attributes |= OBJ_INHERIT;
} }
InitializeObjectAttributes(&ObjectAttributes, InitializeObjectAttributes(&ObjectAttributes,
&PipeName, &PipeName,
OBJ_CASE_INSENSITIVE, Attributes,
NULL, NULL,
SecurityDescriptor); SecurityDescriptor);
if (lpPipeAttributes)
{
if(lpPipeAttributes->bInheritHandle)
ObjectAttributes.Attributes |= OBJ_INHERIT;
if (lpPipeAttributes->lpSecurityDescriptor)
ObjectAttributes.SecurityDescriptor = lpPipeAttributes->lpSecurityDescriptor;
}
Status = NtCreateNamedPipeFile(&ReadPipeHandle, Status = NtCreateNamedPipeFile(&ReadPipeHandle,
FILE_GENERIC_READ, FILE_GENERIC_READ,