Allow compilation of npfs driver with MSVC
authorHervé Poussineau <hpoussin@reactos.org>
Sun, 4 Sep 2005 21:44:02 +0000 (21:44 +0000)
committerHervé Poussineau <hpoussin@reactos.org>
Sun, 4 Sep 2005 21:44:02 +0000 (21:44 +0000)
svn path=/trunk/; revision=17642

reactos/drivers/fs/np/create.c
reactos/drivers/fs/np/finfo.c
reactos/drivers/fs/np/fsctrl.c
reactos/drivers/fs/np/npfs.c
reactos/drivers/fs/np/npfs.h
reactos/drivers/fs/np/npfs.rc
reactos/drivers/fs/np/npfs.xml
reactos/drivers/fs/np/rw.c
reactos/drivers/fs/np/volume.c

index a8b27f6..773abf7 100644 (file)
@@ -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 @@ NTSTATUS STDCALL
 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 @@ NpfsCreate(PDEVICE_OBJECT DeviceObject,
   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 @@ NTSTATUS STDCALL
 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 @@ NpfsCreateNamedPipe(PDEVICE_OBJECT DeviceObject,
    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 @@ NpfsCreateNamedPipe(PDEVICE_OBJECT DeviceObject,
        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 @@ NpfsCreateNamedPipe(PDEVICE_OBJECT DeviceObject,
            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 @@ NpfsCleanup(PDEVICE_OBJECT DeviceObject,
    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 @@ NpfsClose(PDEVICE_OBJECT DeviceObject,
    PFILE_OBJECT FileObject;
    PNPFS_FCB Fcb;
    PNPFS_PIPE Pipe;
-   BOOL Server;
+   BOOLEAN Server;
 
    DPRINT("NpfsClose(DeviceObject %p Irp %p)\n", DeviceObject, Irp);
 
index 5baddf0..ef61d3a 100644 (file)
@@ -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
index 5b5c9da..5dcacd4 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:  See COPYING in the top level directory
  * PROJECT:    ReactOS kernel
  * FILE:       drivers/fs/np/fsctrl.c
 
 /* INCLUDES ******************************************************************/
 
-#include <ntifs.h>
-#include "npfs.h"
-
 #define NDEBUG
 #include <debug.h>
 
+#include "npfs.h"
+
 /* FUNCTIONS *****************************************************************/
 
 static VOID STDCALL
@@ -170,7 +168,7 @@ NpfsDisconnectPipe(PNPFS_FCB Fcb)
    NTSTATUS Status;
    PNPFS_FCB OtherSide;
    PNPFS_PIPE Pipe;
-   BOOL Server;
+   BOOLEAN Server;
 
    DPRINT("NpfsDisconnectPipe()\n");
 
index 3b6fdc8..66ca097 100644 (file)
@@ -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
index 34874f9..a1595d1 100644 (file)
@@ -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;
index 71d7df5..91ea2d8 100644 (file)
@@ -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"
index b5a8b52..64262c1 100644 (file)
@@ -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>
index dc39215..dfd7a2a 100644 (file)
@@ -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 @@ NpfsRead(IN PDEVICE_OBJECT DeviceObject,
           }
           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);
index acc35ab..e0a8eb7 100644 (file)
@@ -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>