Allow compilation of npfs driver with MSVC
Modified: trunk/reactos/drivers/fs/np/create.c
Modified: trunk/reactos/drivers/fs/np/finfo.c
Modified: trunk/reactos/drivers/fs/np/fsctrl.c
Modified: trunk/reactos/drivers/fs/np/npfs.c
Modified: trunk/reactos/drivers/fs/np/npfs.h
Modified: trunk/reactos/drivers/fs/np/npfs.rc
Modified: trunk/reactos/drivers/fs/np/npfs.xml
Modified: trunk/reactos/drivers/fs/np/rw.c
Modified: trunk/reactos/drivers/fs/np/volume.c

Modified: trunk/reactos/drivers/fs/np/create.c
--- trunk/reactos/drivers/fs/np/create.c	2005-09-04 21:14:54 UTC (rev 17641)
+++ trunk/reactos/drivers/fs/np/create.c	2005-09-04 21:44:02 UTC (rev 17642)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:  See COPYING in the top level directory
  * PROJECT:    ReactOS kernel
  * FILE:       drivers/fs/np/create.c
@@ -9,13 +8,11 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <ntifs.h>
-#include <ndk/iotypes.h>
-#include "npfs.h"
-
 #define NDEBUG
 #include <debug.h>
 
+#include "npfs.h"
+
 /* FUNCTIONS *****************************************************************/
 
 static PNPFS_PIPE
@@ -110,7 +107,7 @@
 NpfsCreate(PDEVICE_OBJECT DeviceObject,
 	   PIRP Irp)
 {
-  PIO_STACK_LOCATION IoStack;
+  PEXTENDED_IO_STACK_LOCATION IoStack;
   PFILE_OBJECT FileObject;
   PNPFS_PIPE Pipe;
   PNPFS_FCB ClientFcb;
@@ -121,14 +118,14 @@
   DPRINT("NpfsCreate(DeviceObject %p Irp %p)\n", DeviceObject, Irp);
 
   DeviceExt = (PNPFS_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
-  IoStack = IoGetCurrentIrpStackLocation(Irp);
+  IoStack = (PEXTENDED_IO_STACK_LOCATION)IoGetCurrentIrpStackLocation(Irp);
   FileObject = IoStack->FileObject;
   DPRINT("FileObject %p\n", FileObject);
   DPRINT("FileName %wZ\n", &FileObject->FileName);
 
   Irp->IoStatus.Information = 0;
 
-  SpecialAccess = ((IoStack->Parameters.Create.ShareAccess & 3) == 3);
+  SpecialAccess = ((IoStack->Parameters.CreatePipe.ShareAccess & 3) == 3);
   if (SpecialAccess)
     {
       DPRINT("NpfsCreate() open client end for special use!\n");
@@ -310,7 +307,7 @@
 NpfsCreateNamedPipe(PDEVICE_OBJECT DeviceObject,
 		    PIRP Irp)
 {
-   PIO_STACK_LOCATION IoStack;
+   PEXTENDED_IO_STACK_LOCATION IoStack;
    PFILE_OBJECT FileObject;
    PNPFS_DEVICE_EXTENSION DeviceExt;
    PNPFS_PIPE Pipe;
@@ -321,7 +318,7 @@
    DPRINT("NpfsCreateNamedPipe(DeviceObject %p Irp %p)\n", DeviceObject, Irp);
 
    DeviceExt = (PNPFS_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
-   IoStack = IoGetCurrentIrpStackLocation(Irp);
+   IoStack = (PEXTENDED_IO_STACK_LOCATION)IoGetCurrentIrpStackLocation(Irp);
    FileObject = IoStack->FileObject;
    DPRINT("FileObject %p\n", FileObject);
    DPRINT("Pipe name %wZ\n", &FileObject->FileName);
@@ -416,8 +413,8 @@
        Pipe->MaximumInstances = Buffer->MaximumInstances;
        Pipe->CurrentInstances = 0;
        Pipe->TimeOut = Buffer->DefaultTimeout;
-       if (!(IoStack->Parameters.Create.Options & FILE_PIPE_OUTBOUND) ||
-           IoStack->Parameters.Create.Options & FILE_PIPE_FULL_DUPLEX)
+       if (!(IoStack->Parameters.CreatePipe.Options & FILE_PIPE_OUTBOUND) ||
+           IoStack->Parameters.CreatePipe.Options & FILE_PIPE_FULL_DUPLEX)
          {
            if (Buffer->InboundQuota == 0)
              {
@@ -441,7 +438,7 @@
            Pipe->InboundQuota = 0;
          }
 
-       if (IoStack->Parameters.Create.Options & (FILE_PIPE_FULL_DUPLEX|FILE_PIPE_OUTBOUND))
+       if (IoStack->Parameters.CreatePipe.Options & (FILE_PIPE_FULL_DUPLEX|FILE_PIPE_OUTBOUND))
          {
            if (Buffer->OutboundQuota == 0)
              {
@@ -540,7 +537,7 @@
    PFILE_OBJECT FileObject;
    PNPFS_FCB Fcb, OtherSide;
    PNPFS_PIPE Pipe;
-   BOOL Server;
+   BOOLEAN Server;
 
    DPRINT("NpfsCleanup(DeviceObject %p Irp %p)\n", DeviceObject, Irp);
 
@@ -676,7 +673,7 @@
    PFILE_OBJECT FileObject;
    PNPFS_FCB Fcb;
    PNPFS_PIPE Pipe;
-   BOOL Server;
+   BOOLEAN Server;
 
    DPRINT("NpfsClose(DeviceObject %p Irp %p)\n", DeviceObject, Irp);
 

Modified: trunk/reactos/drivers/fs/np/finfo.c
--- trunk/reactos/drivers/fs/np/finfo.c	2005-09-04 21:14:54 UTC (rev 17641)
+++ trunk/reactos/drivers/fs/np/finfo.c	2005-09-04 21:44:02 UTC (rev 17642)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:  See COPYING in the top level directory
  * PROJECT:    ReactOS kernel
  * FILE:       drivers/fs/np/finfo.c
@@ -9,12 +8,11 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <ntifs.h>
-#include "npfs.h"
-
 #define NDEBUG
 #include <debug.h>
 
+#include "npfs.h"
+
 /* FUNCTIONS *****************************************************************/
 
 static

Modified: trunk/reactos/drivers/fs/np/fsctrl.c
--- trunk/reactos/drivers/fs/np/fsctrl.c	2005-09-04 21:14:54 UTC (rev 17641)
+++ trunk/reactos/drivers/fs/np/fsctrl.c	2005-09-04 21:44:02 UTC (rev 17642)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:  See COPYING in the top level directory
  * PROJECT:    ReactOS kernel
  * FILE:       drivers/fs/np/fsctrl.c
@@ -10,12 +9,11 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <ntifs.h>
-#include "npfs.h"
-
 #define NDEBUG
 #include <debug.h>
 
+#include "npfs.h"
+
 /* FUNCTIONS *****************************************************************/
 
 static VOID STDCALL
@@ -170,7 +168,7 @@
    NTSTATUS Status;
    PNPFS_FCB OtherSide;
    PNPFS_PIPE Pipe;
-   BOOL Server;
+   BOOLEAN Server;
 
    DPRINT("NpfsDisconnectPipe()\n");
 

Modified: trunk/reactos/drivers/fs/np/npfs.c
--- trunk/reactos/drivers/fs/np/npfs.c	2005-09-04 21:14:54 UTC (rev 17641)
+++ trunk/reactos/drivers/fs/np/npfs.c	2005-09-04 21:44:02 UTC (rev 17642)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:  See COPYING in the top level directory
  * PROJECT:    ReactOS kernel
  * FILE:       drivers/fs/np/mount.c
@@ -9,12 +8,11 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <ntifs.h>
-#include "npfs.h"
-
 #define NDEBUG
 #include <debug.h>
 
+#include "npfs.h"
+
 /* FUNCTIONS *****************************************************************/
 
 NTSTATUS STDCALL

Modified: trunk/reactos/drivers/fs/np/npfs.h
--- trunk/reactos/drivers/fs/np/npfs.h	2005-09-04 21:14:54 UTC (rev 17641)
+++ trunk/reactos/drivers/fs/np/npfs.h	2005-09-04 21:44:02 UTC (rev 17642)
@@ -1,8 +1,58 @@
-/* $Id$ */
-
 #ifndef __DRIVERS_FS_NP_NPFS_H
 #define __DRIVERS_FS_NP_NPFS_H
 
+#include <ntifs.h>
+
+#if defined(__GNUC__)
+#include <ndk/iotypes.h>
+#define EXTENDED_IO_STACK_LOCATION IO_STACK_LOCATION
+#define PEXTENDED_IO_STACK_LOCATION PIO_STACK_LOCATION
+
+#elif defined(_MSC_VER)
+#define STDCALL
+#define KEBUGCHECK KeBugCheck
+typedef struct _NAMED_PIPE_CREATE_PARAMETERS
+{
+  ULONG           NamedPipeType;
+  ULONG           ReadMode;
+  ULONG           CompletionMode;
+  ULONG           MaximumInstances;
+  ULONG           InboundQuota;
+  ULONG           OutboundQuota;
+  LARGE_INTEGER   DefaultTimeout;
+  BOOLEAN         TimeoutSpecified;
+} NAMED_PIPE_CREATE_PARAMETERS, *PNAMED_PIPE_CREATE_PARAMETERS;
+typedef struct _EXTENDED_IO_STACK_LOCATION {
+
+    /* Included for padding */
+    UCHAR MajorFunction;
+    UCHAR MinorFunction;
+    UCHAR Flags;
+    UCHAR Control;
+
+    union {
+
+        struct {
+            PIO_SECURITY_CONTEXT            SecurityContext;
+            ULONG                           Options;
+            USHORT                          Reserved;
+            USHORT                          ShareAccess;
+            PNAMED_PIPE_CREATE_PARAMETERS   Parameters;
+        } CreatePipe;
+
+    } Parameters;
+    PDEVICE_OBJECT  DeviceObject;
+    PFILE_OBJECT  FileObject;
+    PIO_COMPLETION_ROUTINE  CompletionRoutine;
+    PVOID  Context;
+
+} EXTENDED_IO_STACK_LOCATION, *PEXTENDED_IO_STACK_LOCATION;
+
+
+#else
+#error Unknown compiler
+#endif
+
 typedef struct _NPFS_DEVICE_EXTENSION
 {
   LIST_ENTRY PipeListHead;

Modified: trunk/reactos/drivers/fs/np/npfs.rc
--- trunk/reactos/drivers/fs/np/npfs.rc	2005-09-04 21:14:54 UTC (rev 17641)
+++ trunk/reactos/drivers/fs/np/npfs.rc	2005-09-04 21:44:02 UTC (rev 17642)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION	"Named Pipe IFS Driver\0"
 #define REACTOS_STR_INTERNAL_NAME	"npfs\0"

Modified: trunk/reactos/drivers/fs/np/npfs.xml
--- trunk/reactos/drivers/fs/np/npfs.xml	2005-09-04 21:14:54 UTC (rev 17641)
+++ trunk/reactos/drivers/fs/np/npfs.xml	2005-09-04 21:44:02 UTC (rev 17642)
@@ -1,6 +1,6 @@
 <module name="npfs" type="kernelmodedriver" installbase="system32/drivers" installname="npfs.sys">
 	<include base="npfs">.</include>
-        <define name="__USE_W32API" />
+	<define name="__USE_W32API" />
 	<library>ntoskrnl</library>
 	<library>hal</library>
 	<file>create.c</file>

Modified: trunk/reactos/drivers/fs/np/rw.c
--- trunk/reactos/drivers/fs/np/rw.c	2005-09-04 21:14:54 UTC (rev 17641)
+++ trunk/reactos/drivers/fs/np/rw.c	2005-09-04 21:44:02 UTC (rev 17642)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:  See COPYING in the top level directory
  * PROJECT:    ReactOS kernel
  * FILE:       drivers/fs/np/rw.c
@@ -9,12 +8,11 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <ntifs.h>
-#include "npfs.h"
-
 #define NDEBUG
 #include <debug.h>
 
+#include "npfs.h"
+
 /* FUNCTIONS *****************************************************************/
 
 #ifndef NDEBUG
@@ -431,7 +429,7 @@
 	   }
 	   else
 	   {
-              PNPFS_CONTEXT Context = (PNPFS_CONTEXT)&Irp->Tail.Overlay.DriverContext;
+              Context = (PNPFS_CONTEXT)&Irp->Tail.Overlay.DriverContext;
 
               Context->WaitEvent = &Fcb->ReadEvent;
 	      Status = NpfsAddWaitingReadWriteRequest(DeviceObject, Irp);

Modified: trunk/reactos/drivers/fs/np/volume.c
--- trunk/reactos/drivers/fs/np/volume.c	2005-09-04 21:14:54 UTC (rev 17641)
+++ trunk/reactos/drivers/fs/np/volume.c	2005-09-04 21:44:02 UTC (rev 17642)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/fs/npfs/volume.c
@@ -9,9 +8,6 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ntifs.h>
-#include <wchar.h>
-
 #define NDEBUG
 #include <debug.h>