Build file system drivers w/ W32API headers.
Modified: trunk/reactos/drivers/fs/cdfs/cdfs.h
Modified: trunk/reactos/drivers/fs/cdfs/cdfs.xml
Modified: trunk/reactos/drivers/fs/cdfs/create.c
Modified: trunk/reactos/drivers/fs/cdfs/dirctl.c
Modified: trunk/reactos/drivers/fs/cdfs/fcb.c
Modified: trunk/reactos/drivers/fs/cdfs/fsctl.c
Modified: trunk/reactos/drivers/fs/fs_rec/cdfs.c
Modified: trunk/reactos/drivers/fs/fs_rec/fat.c
Modified: trunk/reactos/drivers/fs/fs_rec/fs_rec.c
Modified: trunk/reactos/drivers/fs/fs_rec/fs_rec.xml
Modified: trunk/reactos/drivers/fs/fs_rec/ntfs.c
Modified: trunk/reactos/drivers/fs/fs_rec/udfs.c
Modified: trunk/reactos/drivers/fs/ms/create.c
Modified: trunk/reactos/drivers/fs/ms/finfo.c
Modified: trunk/reactos/drivers/fs/ms/fsctrl.c
Modified: trunk/reactos/drivers/fs/ms/msfs.c
Modified: trunk/reactos/drivers/fs/ms/msfs.xml
Modified: trunk/reactos/drivers/fs/ms/rw.c
Modified: trunk/reactos/drivers/fs/mup/create.c
Modified: trunk/reactos/drivers/fs/mup/mup.h
Modified: trunk/reactos/drivers/fs/mup/mup.xml
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.xml
Modified: trunk/reactos/drivers/fs/np/rw.c
Modified: trunk/reactos/drivers/fs/np/volume.c
Modified: trunk/reactos/drivers/fs/ntfs/fcb.c
Modified: trunk/reactos/drivers/fs/ntfs/fsctl.c
Modified: trunk/reactos/drivers/fs/ntfs/ntfs.h
Modified: trunk/reactos/drivers/fs/ntfs/ntfs.xml

Modified: trunk/reactos/drivers/fs/cdfs/cdfs.h
--- trunk/reactos/drivers/fs/cdfs/cdfs.h	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/cdfs/cdfs.h	2005-06-17 12:29:33 UTC (rev 15972)
@@ -213,7 +213,9 @@
   ULONG LastOffset;
 } CCB, *PCCB;
 
+#ifndef TAG
 #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
+#endif
 
 #define TAG_CCB TAG('I', 'C', 'C', 'B')
 

Modified: trunk/reactos/drivers/fs/cdfs/cdfs.xml
--- trunk/reactos/drivers/fs/cdfs/cdfs.xml	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/cdfs/cdfs.xml	2005-06-17 12:29:33 UTC (rev 15972)
@@ -1,6 +1,7 @@
 <module name="cdfs" type="kernelmodedriver" installbase="system32/drivers" installname="cdfs.sys">
 	<bootstrap base="reactos" />
 	<include base="cdfs">.</include>
+        <define name="__USE_W32API" />
 	<library>ntoskrnl</library>
 	<library>hal</library>
 	<file>cdfs.c</file>

Modified: trunk/reactos/drivers/fs/cdfs/create.c
--- trunk/reactos/drivers/fs/cdfs/create.c	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/cdfs/create.c	2005-06-17 12:29:33 UTC (rev 15972)
@@ -29,6 +29,7 @@
 /* INCLUDES *****************************************************************/
 
 #include <ddk/ntddk.h>
+#include <ntddcdrm.h>
 
 #define NDEBUG
 #include <debug.h>

Modified: trunk/reactos/drivers/fs/cdfs/dirctl.c
--- trunk/reactos/drivers/fs/cdfs/dirctl.c	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/cdfs/dirctl.c	2005-06-17 12:29:33 UTC (rev 15972)
@@ -39,6 +39,7 @@
 /* DEFINES ******************************************************************/
 
 #define ROUND_DOWN(N, S) (((N) / (S)) * (S))
+#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
 
 /* FUNCTIONS ****************************************************************/
 

Modified: trunk/reactos/drivers/fs/cdfs/fcb.c
--- trunk/reactos/drivers/fs/cdfs/fcb.c	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/cdfs/fcb.c	2005-06-17 12:29:33 UTC (rev 15972)
@@ -29,7 +29,6 @@
 /* INCLUDES *****************************************************************/
 
 #include <ddk/ntddk.h>
-#include <ntos/kefuncs.h>
 
 #define NDEBUG
 #include <debug.h>
@@ -39,7 +38,6 @@
 
 /* MACROS *******************************************************************/
 
-#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
 #define TAG_FCB TAG('I', 'F', 'C', 'B')
 
 #define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))

Modified: trunk/reactos/drivers/fs/cdfs/fsctl.c
--- trunk/reactos/drivers/fs/cdfs/fsctl.c	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/cdfs/fsctl.c	2005-06-17 12:29:33 UTC (rev 15972)
@@ -29,6 +29,7 @@
 /* INCLUDES *****************************************************************/
 
 #include <ddk/ntddk.h>
+#include <ntddcdrm.h>
 #include <ntos/minmax.h>
 
 #define NDEBUG

Modified: trunk/reactos/drivers/fs/fs_rec/cdfs.c
--- trunk/reactos/drivers/fs/fs_rec/cdfs.c	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/fs_rec/cdfs.c	2005-06-17 12:29:33 UTC (rev 15972)
@@ -27,8 +27,9 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
-#include <rosrtl/string.h>
+#include <ntifs.h>
+#include <ntdddisk.h>
+#include <ntddcdrm.h>
 
 #define NDEBUG
 #include <debug.h>
@@ -102,7 +103,8 @@
 		   IN PIRP Irp)
 {
   PIO_STACK_LOCATION Stack;
-  UNICODE_STRING RegistryPath;
+  static UNICODE_STRING RegistryPath =
+    RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Cdfs");
   NTSTATUS Status;
 
   Stack = IoGetCurrentIrpStackLocation(Irp);
@@ -121,8 +123,6 @@
 
       case IRP_MN_LOAD_FILE_SYSTEM:
 	DPRINT("Cdfs: IRP_MN_LOAD_FILE_SYSTEM\n");
-	RtlRosInitUnicodeStringFromLiteral(&RegistryPath,
-			     L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Cdfs");
 	Status = ZwLoadDriver(&RegistryPath);
 	if (!NT_SUCCESS(Status))
 	  {

Modified: trunk/reactos/drivers/fs/fs_rec/fat.c
--- trunk/reactos/drivers/fs/fs_rec/fat.c	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/fs_rec/fat.c	2005-06-17 12:29:33 UTC (rev 15972)
@@ -27,8 +27,8 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
-#include <rosrtl/string.h>
+#include <ntifs.h>
+#include <ntdddisk.h>
 
 #define NDEBUG
 #include <debug.h>
@@ -186,7 +186,8 @@
 		   IN PIRP Irp)
 {
   PIO_STACK_LOCATION Stack;
-  UNICODE_STRING RegistryPath;
+  static UNICODE_STRING RegistryPath =
+    RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Vfatfs");
   NTSTATUS Status;
 
   Stack = IoGetCurrentIrpStackLocation(Irp);
@@ -205,8 +206,6 @@
 
       case IRP_MN_LOAD_FILE_SYSTEM:
 	DPRINT("FAT: IRP_MN_LOAD_FILE_SYSTEM\n");
-	RtlRosInitUnicodeStringFromLiteral(&RegistryPath,
-			     L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Vfatfs");
 	Status = ZwLoadDriver(&RegistryPath);
 	if (!NT_SUCCESS(Status))
 	  {

Modified: trunk/reactos/drivers/fs/fs_rec/fs_rec.c
--- trunk/reactos/drivers/fs/fs_rec/fs_rec.c	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/fs_rec/fs_rec.c	2005-06-17 12:29:33 UTC (rev 15972)
@@ -27,7 +27,7 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
+#include <ntifs.h>
 
 #define NDEBUG
 #include <debug.h>
@@ -154,7 +154,7 @@
 			NULL,
 			0,
 			FILE_SHARE_READ | FILE_SHARE_WRITE,
-			OPEN_EXISTING,
+			FILE_OPEN,
 			0,
 			NULL,
 			0);

Modified: trunk/reactos/drivers/fs/fs_rec/fs_rec.xml
--- trunk/reactos/drivers/fs/fs_rec/fs_rec.xml	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/fs_rec/fs_rec.xml	2005-06-17 12:29:33 UTC (rev 15972)
@@ -1,5 +1,6 @@
 <module name="fs_rec" type="kernelmodedriver" installbase="system32/drivers" installname="fs_rec.sys">
 	<include base="fs_rec">.</include>
+        <define name="__USE_W32API" />
 	<library>ntoskrnl</library>
 	<library>hal</library>
 	<file>blockdev.c</file>

Modified: trunk/reactos/drivers/fs/fs_rec/ntfs.c
--- trunk/reactos/drivers/fs/fs_rec/ntfs.c	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/fs_rec/ntfs.c	2005-06-17 12:29:33 UTC (rev 15972)
@@ -27,7 +27,8 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
+#include <ntifs.h>
+#include <ntdddisk.h>
 
 #define NDEBUG
 #include <debug.h>
@@ -99,7 +100,8 @@
 		   IN PIRP Irp)
 {
   PIO_STACK_LOCATION Stack;
-  UNICODE_STRING RegistryPath;
+  static UNICODE_STRING RegistryPath =
+    RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Ntfs");
   NTSTATUS Status;
 
   Stack = IoGetCurrentIrpStackLocation(Irp);
@@ -119,8 +121,6 @@
 
       case IRP_MN_LOAD_FILE_SYSTEM:
 	DPRINT("NTFS: IRP_MN_LOAD_FILE_SYSTEM\n");
-	RtlInitUnicodeString(&RegistryPath,
-			     L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Ntfs");
 	Status = ZwLoadDriver(&RegistryPath);
 	if (!NT_SUCCESS(Status))
 	  {

Modified: trunk/reactos/drivers/fs/fs_rec/udfs.c
--- trunk/reactos/drivers/fs/fs_rec/udfs.c	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/fs_rec/udfs.c	2005-06-17 12:29:33 UTC (rev 15972)
@@ -27,8 +27,9 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
-#include <rosrtl/string.h>
+#include <ntifs.h>
+#include <ntdddisk.h>
+#include <ntddcdrm.h>
 
 #define NDEBUG
 #include <debug.h>
@@ -258,7 +259,8 @@
 		   IN PIRP Irp)
 {
   PIO_STACK_LOCATION Stack;
-  UNICODE_STRING RegistryPath;
+  static UNICODE_STRING RegistryPath =
+    RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Udfs");
   NTSTATUS Status;
 
   Stack = IoGetCurrentIrpStackLocation(Irp);
@@ -277,8 +279,6 @@
 
       case IRP_MN_LOAD_FILE_SYSTEM:
 	DPRINT("Udfs: IRP_MN_LOAD_FILE_SYSTEM\n");
-	RtlRosInitUnicodeStringFromLiteral(&RegistryPath,
-			     L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Udfs");
 	Status = ZwLoadDriver(&RegistryPath);
 	if (!NT_SUCCESS(Status))
 	  {

Modified: trunk/reactos/drivers/fs/ms/create.c
--- trunk/reactos/drivers/fs/ms/create.c	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/ms/create.c	2005-06-17 12:29:33 UTC (rev 15972)
@@ -9,8 +9,9 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <ddk/ntddk.h>
-#include <ddk/iotypes.h> /* FIXME: Temporary Until NDK implemented */
+#include <ntifs.h>
+/* FIXME: The headers are broken! */
+#undef CreateMailslot
 #include "msfs.h"
 
 #define NDEBUG
@@ -137,7 +138,10 @@
 	return(STATUS_NO_MEMORY);
      }
 
-   if (!RtlCreateUnicodeString(&Mailslot->Name, FileObject->FileName.Buffer))
+   Mailslot->Name.Length = FileObject->FileName.Length;
+   Mailslot->Name.MaximumLength = Mailslot->Name.Length + sizeof(UNICODE_NULL);
+   Mailslot->Name.Buffer = ExAllocatePool(NonPagedPool, Mailslot->Name.MaximumLength);
+   if (Mailslot->Name.Buffer == NULL)
      {
 	ExFreePool(Mailslot);
 
@@ -149,6 +153,8 @@
 	return(STATUS_NO_MEMORY);
      }
 
+   RtlCopyUnicodeString(&Mailslot->Name, &FileObject->FileName);
+
    Fcb = ExAllocatePool(NonPagedPool, sizeof(MSFS_FCB));
    if (Fcb == NULL)
      {

Modified: trunk/reactos/drivers/fs/ms/finfo.c
--- trunk/reactos/drivers/fs/ms/finfo.c	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/ms/finfo.c	2005-06-17 12:29:33 UTC (rev 15972)
@@ -9,7 +9,7 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <ddk/ntddk.h>
+#include <ntifs.h>
 #include "msfs.h"
 
 #define NDEBUG
@@ -31,19 +31,19 @@
 
    Mailslot = Fcb->Mailslot;
 
-   Buffer->MaxMessageSize = Mailslot->MaxMessageSize;
-   Buffer->Timeout = Mailslot->TimeOut;
+   Buffer->MaximumMessageSize = Mailslot->MaxMessageSize;
+   Buffer->ReadTimeout = Mailslot->TimeOut;
 
    KeAcquireSpinLock(&Mailslot->MessageListLock, &oldIrql);
-   Buffer->MessageCount = Mailslot->MessageCount;
+   Buffer->MessagesAvailable = Mailslot->MessageCount;
    if (Mailslot->MessageCount == 0)
      {
-	Buffer->NextSize = 0;
+	Buffer->NextMessageSize = 0;
      }
    else
      {
 	/* FIXME: read size of first message (head) */
-	Buffer->NextSize = 0;
+	Buffer->NextMessageSize = 0;
      }
    KeReleaseSpinLock(&Mailslot->MessageListLock, oldIrql);
 
@@ -61,7 +61,7 @@
    if (*BufferLength < sizeof(FILE_MAILSLOT_SET_INFORMATION))
      return(STATUS_BUFFER_OVERFLOW);
 
-   Fcb->Mailslot->TimeOut = Buffer->Timeout;
+   Fcb->Mailslot->TimeOut = Buffer->ReadTimeout;
 
    return(STATUS_SUCCESS);
 }

Modified: trunk/reactos/drivers/fs/ms/fsctrl.c
--- trunk/reactos/drivers/fs/ms/fsctrl.c	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/ms/fsctrl.c	2005-06-17 12:29:33 UTC (rev 15972)
@@ -9,7 +9,7 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <ddk/ntddk.h>
+#include <ntifs.h>
 #include "msfs.h"
 
 //#define NDEBUG

Modified: trunk/reactos/drivers/fs/ms/msfs.c
--- trunk/reactos/drivers/fs/ms/msfs.c	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/ms/msfs.c	2005-06-17 12:29:33 UTC (rev 15972)
@@ -9,7 +9,7 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <ddk/ntddk.h>
+#include <ntifs.h>
 #include "msfs.h"
 
 #define NDEBUG

Modified: trunk/reactos/drivers/fs/ms/msfs.xml
--- trunk/reactos/drivers/fs/ms/msfs.xml	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/ms/msfs.xml	2005-06-17 12:29:33 UTC (rev 15972)
@@ -1,5 +1,6 @@
 <module name="msfs" type="kernelmodedriver" installbase="system32/drivers" installname="msfs.sys">
 	<include base="msfs">.</include>
+        <define name="__USE_W32API" />
 	<library>ntoskrnl</library>
 	<library>hal</library>
 	<file>create.c</file>

Modified: trunk/reactos/drivers/fs/ms/rw.c
--- trunk/reactos/drivers/fs/ms/rw.c	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/ms/rw.c	2005-06-17 12:29:33 UTC (rev 15972)
@@ -9,8 +9,7 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <ddk/ntddk.h>
-#include <ntos/minmax.h>
+#include <ntifs.h>
 #include "msfs.h"
 
 #define NDEBUG

Modified: trunk/reactos/drivers/fs/mup/create.c
--- trunk/reactos/drivers/fs/mup/create.c	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/mup/create.c	2005-06-17 12:29:33 UTC (rev 15972)
@@ -27,7 +27,7 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
+#include <ntifs.h>
 
 //#define NDEBUG
 #include <debug.h>

Modified: trunk/reactos/drivers/fs/mup/mup.h
--- trunk/reactos/drivers/fs/mup/mup.h	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/mup/mup.h	2005-06-17 12:29:33 UTC (rev 15972)
@@ -1,10 +1,9 @@
 #ifndef MUP_H
 #define MUP_H
 
-#include <ddk/ntifs.h>
-
-
+#ifndef TAG
 #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
+#endif
 
 #define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
 

Modified: trunk/reactos/drivers/fs/mup/mup.xml
--- trunk/reactos/drivers/fs/mup/mup.xml	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/mup/mup.xml	2005-06-17 12:29:33 UTC (rev 15972)
@@ -1,5 +1,6 @@
 <module name="mup" type="kernelmodedriver" installbase="system32/drivers" installname="mup.sys">
 	<include base="mup">.</include>
+        <define name="__USE_W32API" />
 	<library>ntoskrnl</library>
 	<library>hal</library>
 	<file>create.c</file>

Modified: trunk/reactos/drivers/fs/np/create.c
--- trunk/reactos/drivers/fs/np/create.c	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/np/create.c	2005-06-17 12:29:33 UTC (rev 15972)
@@ -9,8 +9,7 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <ddk/ntddk.h>
-
+#include <ntifs.h>
 #include "npfs.h"
 
 #define NDEBUG
@@ -387,7 +386,10 @@
            return STATUS_NO_MEMORY;
          }
 
-       if (RtlCreateUnicodeString(&Pipe->PipeName, FileObject->FileName.Buffer) == FALSE)
+       Pipe->PipeName.Length = FileObject->FileName.Length;
+       Pipe->PipeName.MaximumLength = Pipe->PipeName.Length + sizeof(UNICODE_NULL);
+       Pipe->PipeName.Buffer = ExAllocatePool(NonPagedPool, Pipe->PipeName.MaximumLength);
+       if (Pipe->PipeName.Buffer == NULL)
          {
            KeUnlockMutex(&DeviceExt->PipeListLock);
            ExFreePool(Pipe);
@@ -398,6 +400,8 @@
            return STATUS_NO_MEMORY;
          }
 
+       RtlCopyUnicodeString(&Pipe->PipeName, &FileObject->FileName);
+
        InitializeListHead(&Pipe->ServerFcbListHead);
        InitializeListHead(&Pipe->ClientFcbListHead);
        InitializeListHead(&Pipe->WaiterListHead);

Modified: trunk/reactos/drivers/fs/np/finfo.c
--- trunk/reactos/drivers/fs/np/finfo.c	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/np/finfo.c	2005-06-17 12:29:33 UTC (rev 15972)
@@ -9,7 +9,7 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <ddk/ntddk.h>
+#include <ntifs.h>
 #include "npfs.h"
 
 #define NDEBUG

Modified: trunk/reactos/drivers/fs/np/fsctrl.c
--- trunk/reactos/drivers/fs/np/fsctrl.c	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/np/fsctrl.c	2005-06-17 12:29:33 UTC (rev 15972)
@@ -10,7 +10,8 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <ddk/ntddk.h>
+#include <ntifs.h>
+#include <napi/npipe.h>
 #include "npfs.h"
 
 #define NDEBUG

Modified: trunk/reactos/drivers/fs/np/npfs.c
--- trunk/reactos/drivers/fs/np/npfs.c	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/np/npfs.c	2005-06-17 12:29:33 UTC (rev 15972)
@@ -9,7 +9,7 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <ddk/ntddk.h>
+#include <ntifs.h>
 #include "npfs.h"
 
 #define NDEBUG
@@ -28,8 +28,8 @@
 
    DPRINT("Named Pipe FSD 0.0.2\n");
 
-   ASSERT (sizeof(NPFS_CONTEXT) <= sizeof (((PIRP)NULL)->Tail.Overlay.DriverContext));
-   ASSERT (sizeof(NPFS_WAITER_ENTRY) <= sizeof(((PIRP)NULL)->Tail.Overlay.DriverContext));
+   ASSERT (sizeof(NPFS_CONTEXT) <= FIELD_OFFSET(IRP, Tail.Overlay.DriverContext));
+   ASSERT (sizeof(NPFS_WAITER_ENTRY) <= FIELD_OFFSET(IRP, Tail.Overlay.DriverContext));
 
    DriverObject->MajorFunction[IRP_MJ_CREATE] = NpfsCreate;
    DriverObject->MajorFunction[IRP_MJ_CREATE_NAMED_PIPE] =

Modified: trunk/reactos/drivers/fs/np/npfs.h
--- trunk/reactos/drivers/fs/np/npfs.h	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/np/npfs.h	2005-06-17 12:29:33 UTC (rev 15972)
@@ -94,6 +94,7 @@
 
 #define KeUnlockMutex(x) KeReleaseMutex(x, FALSE);
 
+#define PAGE_ROUND_UP(x) ( (((ULONG_PTR)x)%PAGE_SIZE) ? ((((ULONG_PTR)x)&(~(PAGE_SIZE-1)))+PAGE_SIZE) : ((ULONG_PTR)x) )
 
 NTSTATUS STDCALL NpfsCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp);
 NTSTATUS STDCALL NpfsCreateNamedPipe(PDEVICE_OBJECT DeviceObject, PIRP Irp);

Modified: trunk/reactos/drivers/fs/np/npfs.xml
--- trunk/reactos/drivers/fs/np/npfs.xml	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/np/npfs.xml	2005-06-17 12:29:33 UTC (rev 15972)
@@ -1,5 +1,6 @@
 <module name="npfs" type="kernelmodedriver" installbase="system32/drivers" installname="npfs.sys">
 	<include base="npfs">.</include>
+        <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-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/np/rw.c	2005-06-17 12:29:33 UTC (rev 15972)
@@ -9,7 +9,7 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <ddk/ntddk.h>
+#include <ntifs.h>
 #include <rosrtl/minmax.h>
 #include "npfs.h"
 

Modified: trunk/reactos/drivers/fs/np/volume.c
--- trunk/reactos/drivers/fs/np/volume.c	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/np/volume.c	2005-06-17 12:29:33 UTC (rev 15972)
@@ -9,7 +9,7 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
+#include <ntifs.h>
 #include <wchar.h>
 
 #define NDEBUG

Modified: trunk/reactos/drivers/fs/ntfs/fcb.c
--- trunk/reactos/drivers/fs/ntfs/fcb.c	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/ntfs/fcb.c	2005-06-17 12:29:33 UTC (rev 15972)
@@ -27,9 +27,6 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
-#include <ntos/kefuncs.h>
-
 #include "ntfs.h"
 
 #define NDEBUG

Modified: trunk/reactos/drivers/fs/ntfs/fsctl.c
--- trunk/reactos/drivers/fs/ntfs/fsctl.c	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/ntfs/fsctl.c	2005-06-17 12:29:33 UTC (rev 15972)
@@ -28,14 +28,12 @@
 
 /* INCLUDES *****************************************************************/
 
-#include <ddk/ntddk.h>
-#include <ntos/minmax.h>
+#include "ntfs.h"
+#include <ntdddisk.h>
 
 //#define NDEBUG
 #include <debug.h>
 
-#include "ntfs.h"
-
 /* FUNCTIONS ****************************************************************/
 
 static NTSTATUS

Modified: trunk/reactos/drivers/fs/ntfs/ntfs.h
--- trunk/reactos/drivers/fs/ntfs/ntfs.h	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/ntfs/ntfs.h	2005-06-17 12:29:33 UTC (rev 15972)
@@ -10,7 +10,9 @@
 	((pDeviceExt)->NtfsInfo.BytesPerCluster > PAGE_SIZE ? \
 	 (pDeviceExt)->NtfsInfo.BytesPerCluster : PAGE_SIZE)
 
+#ifndef TAG
 #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
+#endif
 
 #define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
 
@@ -128,8 +130,6 @@
   ULONG LastOffset;
 } CCB, *PCCB;
 
-#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
-
 #define TAG_CCB TAG('I', 'C', 'C', 'B')
 
 typedef struct

Modified: trunk/reactos/drivers/fs/ntfs/ntfs.xml
--- trunk/reactos/drivers/fs/ntfs/ntfs.xml	2005-06-17 12:24:29 UTC (rev 15971)
+++ trunk/reactos/drivers/fs/ntfs/ntfs.xml	2005-06-17 12:29:33 UTC (rev 15972)
@@ -1,6 +1,7 @@
 <module name="ntfs" type="kernelmodedriver" installbase="system32/drivers" installname="ntfs.sys">
 	<bootstrap base="reactos" />
 	<include base="ntfs">.</include>
+        <define name="__USE_W32API" />
 	<library>ntoskrnl</library>
 	<library>hal</library>
 	<file>attrib.c</file>