Commit in reactos/ntoskrnl/io on MAIN
create.c+31-201.75 -> 1.76
Pass create parameters for named pipes and mailslots in the stack location.

reactos/ntoskrnl/io
create.c 1.75 -> 1.76
diff -u -r1.75 -r1.76
--- create.c	22 Oct 2004 20:25:52 -0000	1.75
+++ create.c	23 Dec 2004 23:55:56 -0000	1.76
@@ -1,4 +1,4 @@
-/* $Id: create.c,v 1.75 2004/10/22 20:25:52 ekohl Exp $
+/* $Id: create.c,v 1.76 2004/12/23 23:55:56 ekohl Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -367,7 +367,7 @@
    if (!NT_SUCCESS(Status))
      {
 	DPRINT("ObCreateObject() failed! (Status %lx)\n", Status);
-	return(Status);
+	return Status;
      }
 
    RtlMapGenericMask(&DesiredAccess,
@@ -383,7 +383,7 @@
      {
 	DPRINT("ObInsertObject() failed! (Status %lx)\n", Status);
 	ObDereferenceObject (FileObject);
-	return(Status);
+	return Status;
      }
 
    if (CreateOptions & FILE_SYNCHRONOUS_IO_ALERT)
@@ -395,7 +395,7 @@
 	FileObject->Flags |= FO_SYNCHRONOUS_IO;
      }
 
-   if( CreateOptions & FILE_NO_INTERMEDIATE_BUFFERING )
+   if (CreateOptions & FILE_NO_INTERMEDIATE_BUFFERING)
      FileObject->Flags |= FO_NO_INTERMEDIATE_BUFFERING;
 
    SecurityContext.SecurityQos = NULL; /* ?? */
@@ -417,7 +417,7 @@
    if (Irp == NULL)
      {
 	ZwClose(*FileHandle);
-	return (STATUS_UNSUCCESSFUL);
+	return STATUS_UNSUCCESSFUL;
      }
 
    //trigger FileObject/Event dereferencing
@@ -425,7 +425,7 @@
    Irp->RequestorMode = PreviousMode;
    Irp->UserIosb = IoStatusBlock;
    Irp->AssociatedIrp.SystemBuffer = EaBuffer;
-   Irp->Tail.Overlay.AuxiliaryBuffer = (PCHAR)ExtraCreateParameters;
+   Irp->Tail.Overlay.AuxiliaryBuffer = NULL;
    Irp->Tail.Overlay.Thread = PsGetCurrentThread();
    Irp->UserEvent = &FileObject->Event;
    if (AllocationSize)
@@ -438,35 +438,46 @@
     * IRP and prepare it.
     */
    StackLoc = IoGetNextIrpStackLocation(Irp);
+   StackLoc->MinorFunction = 0;
+   StackLoc->Flags = (UCHAR)Options;
+   StackLoc->Control = 0;
+   StackLoc->DeviceObject = FileObject->DeviceObject;
+   StackLoc->FileObject = FileObject;
+
    switch (CreateFileType)
      {
 	default:
 	case CreateFileTypeNone:
 	  StackLoc->MajorFunction = IRP_MJ_CREATE;
+	  StackLoc->Parameters.Create.SecurityContext = &SecurityContext;
+	  StackLoc->Parameters.Create.Options = (CreateOptions & FILE_VALID_OPTION_FLAGS);
+	  StackLoc->Parameters.Create.Options |= (CreateDisposition << 24);
+	  StackLoc->Parameters.Create.FileAttributes = (USHORT)FileAttributes;
+	  StackLoc->Parameters.Create.ShareAccess = (USHORT)ShareAccess;
+	  StackLoc->Parameters.Create.EaLength = EaLength;
 	  break;
 	
 	case CreateFileTypeNamedPipe:
 	  StackLoc->MajorFunction = IRP_MJ_CREATE_NAMED_PIPE;
+	  StackLoc->Parameters.CreatePipe.SecurityContext = &SecurityContext;
+	  StackLoc->Parameters.CreatePipe.Options = (CreateOptions & FILE_VALID_OPTION_FLAGS);
+	  StackLoc->Parameters.CreatePipe.Options |= (CreateDisposition << 24);
+	  StackLoc->Parameters.CreatePipe.ShareAccess = (USHORT)ShareAccess;
+	  StackLoc->Parameters.CreatePipe.Parameters = ExtraCreateParameters;
 	  break;
 
 	case CreateFileTypeMailslot:
 	  StackLoc->MajorFunction = IRP_MJ_CREATE_MAILSLOT;
+	  StackLoc->Parameters.CreateMailslot.SecurityContext = &SecurityContext;
+	  StackLoc->Parameters.CreateMailslot.Options = (CreateOptions & FILE_VALID_OPTION_FLAGS);
+	  StackLoc->Parameters.CreateMailslot.Options |= (CreateDisposition << 24);
+	  StackLoc->Parameters.CreateMailslot.ShareAccess = (USHORT)ShareAccess;
+	  StackLoc->Parameters.CreateMailslot.Parameters = ExtraCreateParameters;
 	  break;
      }
-   StackLoc->MinorFunction = 0;
-   StackLoc->Flags = (UCHAR)Options;
-   StackLoc->Control = 0;
-   StackLoc->DeviceObject = FileObject->DeviceObject;
-   StackLoc->FileObject = FileObject;
-   StackLoc->Parameters.Create.SecurityContext = &SecurityContext;
-   StackLoc->Parameters.Create.Options = (CreateOptions & FILE_VALID_OPTION_FLAGS);
-   StackLoc->Parameters.Create.Options |= (CreateDisposition << 24);
-   StackLoc->Parameters.Create.FileAttributes = (USHORT)FileAttributes;
-   StackLoc->Parameters.Create.ShareAccess = (USHORT)ShareAccess;
-   StackLoc->Parameters.Create.EaLength = EaLength;
-   
+
    /*
-    * Now call the driver and 
+    * Now call the driver and
     * possibly wait if it can
     * not complete the request
     * immediately.
@@ -495,7 +506,7 @@
 
    DPRINT("Finished IoCreateFile() (*FileHandle) %x\n", (*FileHandle));
 
-   return (Status);
+   return Status;
 }
 
 
CVSspam 0.2.8