Commit in reactos/lib/kernel32/file on MAIN
npipe.c+13-41.19 -> 1.20
Create named pipes with security information if argument is present

reactos/lib/kernel32/file
npipe.c 1.19 -> 1.20
diff -u -r1.19 -r1.20
--- npipe.c	8 Oct 2004 21:25:18 -0000	1.19
+++ npipe.c	8 Oct 2004 23:24:01 -0000	1.20
@@ -1,4 +1,4 @@
-/* $Id: npipe.c,v 1.19 2004/10/08 21:25:18 weiden Exp $
+/* $Id: npipe.c,v 1.20 2004/10/08 23:24:01 weiden Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
@@ -77,8 +77,9 @@
    BOOLEAN ReadModeMessage;
    BOOLEAN NonBlocking;
    IO_STATUS_BLOCK Iosb;
-   ULONG ShareAccess;
+   ULONG ShareAccess, Attributes;
    LARGE_INTEGER DefaultTimeOut;
+   PSECURITY_DESCRIPTOR SecurityDescriptor = NULL;
    
    Result = RtlDosPathNameToNtPathName_U((LPWSTR)lpName,
 					 &NamedPipeName,
@@ -93,11 +94,19 @@
    DPRINT("Pipe name: %wZ\n", &NamedPipeName);
    DPRINT("Pipe name: %S\n", NamedPipeName.Buffer);
    
+   Attributes = OBJ_CASE_INSENSITIVE;
+   if(lpSecurityAttributes)
+     {
+       SecurityDescriptor = lpSecurityAttributes->lpSecurityDescriptor;
+       if(lpSecurityAttributes->bInheritHandle)
+          Attributes |= OBJ_INHERIT;
+     }
+
    InitializeObjectAttributes(&ObjectAttributes,
 			      &NamedPipeName,
-			      OBJ_CASE_INSENSITIVE,
+			      Attributes,
 			      NULL,
-			      NULL);
+			      SecurityDescriptor);
    
    DesiredAccess = 0;
    
CVSspam 0.2.8