Herve Poussineau <poussine@freesurf.fr>
Use DDK types instead of Win32 types (BOOL, WORD, DWORD).
Modified: trunk/reactos/drivers/fs/vfat/blockdev.c
Modified: trunk/reactos/drivers/fs/vfat/dir.c
Modified: trunk/reactos/drivers/fs/vfat/direntry.c
Modified: trunk/reactos/drivers/fs/vfat/dirwr.c
Modified: trunk/reactos/drivers/fs/vfat/fcb.c
Modified: trunk/reactos/drivers/fs/vfat/finfo.c
Modified: trunk/reactos/drivers/fs/vfat/fsctl.c
Modified: trunk/reactos/drivers/fs/vfat/iface.c
Modified: trunk/reactos/drivers/fs/vfat/rw.c
Modified: trunk/reactos/drivers/fs/vfat/vfat.h
Modified: trunk/reactos/drivers/fs/vfat/volume.c

Modified: trunk/reactos/drivers/fs/vfat/blockdev.c
--- trunk/reactos/drivers/fs/vfat/blockdev.c	2005-01-12 10:24:56 UTC (rev 12953)
+++ trunk/reactos/drivers/fs/vfat/blockdev.c	2005-01-12 10:46:13 UTC (rev 12954)
@@ -71,7 +71,7 @@
 
   KeInitializeEvent (&event, NotificationEvent, FALSE);
 
-  DPRINT ("VfatReadSectors(pDeviceObject %x, Offset %I64x, Length %d, Buffer %x)\n",
+  DPRINT ("VfatReadDisk(pDeviceObject %x, Offset %I64x, Length %d, Buffer %x)\n",
 	  pDeviceObject, ReadOffset->QuadPart, ReadLength, Buffer);
 
   DPRINT ("Building synchronous FSD Request...\n");
@@ -108,7 +108,7 @@
 
   if (!NT_SUCCESS (Status))
     {
-      DPRINT ("IO failed!!! VfatReadSectors : Error code: %x\n", Status);
+      DPRINT ("IO failed!!! VfatReadDisk : Error code: %x\n", Status);
       DPRINT ("(pDeviceObject %x, Offset %I64x, Size %d, Buffer %x\n",
 	      pDeviceObject, ReadOffset->QuadPart, ReadLength, Buffer);
       return (Status);
@@ -134,7 +134,7 @@
 
   DPRINT ("Building asynchronous FSD Request...\n");
 
-  Buffer = MmGetMdlVirtualAddress(IrpContext->Irp->MdlAddress) + BufferOffset;
+  Buffer = (PCHAR)MmGetMdlVirtualAddress(IrpContext->Irp->MdlAddress) + BufferOffset;
  
   Irp = IoAllocateIrp(IrpContext->DeviceExt->StorageDevice->StackSize, TRUE);
   if (Irp == NULL)
@@ -212,7 +212,7 @@
   DPRINT ("VfatWriteDiskPartial(IrpContext %x, WriteOffset %I64x, WriteLength %d, BufferOffset %x, Wait %d)\n",
 	  IrpContext, WriteOffset->QuadPart, WriteLength, BufferOffset, Wait);
 
-  Buffer = MmGetMdlVirtualAddress(IrpContext->Irp->MdlAddress) + BufferOffset;
+  Buffer = (PCHAR)MmGetMdlVirtualAddress(IrpContext->Irp->MdlAddress) + BufferOffset;
 
   DPRINT ("Building asynchronous FSD Request...\n");
   Irp = IoAllocateIrp(IrpContext->DeviceExt->StorageDevice->StackSize, TRUE);

Modified: trunk/reactos/drivers/fs/vfat/dir.c
--- trunk/reactos/drivers/fs/vfat/dir.c	2005-01-12 10:24:56 UTC (rev 12953)
+++ trunk/reactos/drivers/fs/vfat/dir.c	2005-01-12 10:46:13 UTC (rev 12954)
@@ -20,7 +20,7 @@
 
 
 // function like DosDateTimeToFileTime
-BOOL
+BOOLEAN
 FsdDosDateTimeToSystemTime (PDEVICE_EXTENSION DeviceExt, WORD wDosDate, WORD wDosTime, PLARGE_INTEGER SystemTime)
 {
   PDOSTIME pdtime = (PDOSTIME) & wDosTime;
@@ -47,11 +47,11 @@
 }
 
 // function like FileTimeToDosDateTime
-BOOL
-FsdSystemTimeToDosDateTime (PDEVICE_EXTENSION DeviceExt, PLARGE_INTEGER SystemTime, WORD * pwDosDate, WORD * pwDosTime)
+BOOLEAN
+FsdSystemTimeToDosDateTime (PDEVICE_EXTENSION DeviceExt, PLARGE_INTEGER SystemTime, USHORT *pDosDate, USHORT *pDosTime)
 {
-  PDOSTIME pdtime = (PDOSTIME) pwDosTime;
-  PDOSDATE pddate = (PDOSDATE) pwDosDate;
+  PDOSTIME pdtime = (PDOSTIME) pDosTime;
+  PDOSDATE pddate = (PDOSDATE) pDosDate;
   TIME_FIELDS TimeFields;
   LARGE_INTEGER LocalTime;
 
@@ -72,13 +72,13 @@
     {
       pddate->Day = TimeFields.Day;
       pddate->Month = TimeFields.Month;
-      pddate->Year = TimeFields.Year - DeviceExt->BaseDateYear;
+      pddate->Year = (USHORT) (TimeFields.Year - DeviceExt->BaseDateYear);
     }
 
   return TRUE;
 }
 
-#define DWORD_ROUND_UP(x)   ROUND_UP((x), (sizeof(DWORD)))
+#define ULONG_ROUND_UP(x)   ROUND_UP((x), (sizeof(ULONG)))
 
 NTSTATUS
 VfatGetFileNameInformation (PVFAT_DIRENTRY_CONTEXT DirContext,
@@ -88,7 +88,7 @@
     return STATUS_BUFFER_OVERFLOW;
   pInfo->FileNameLength = DirContext->LongNameU.Length;
   pInfo->NextEntryOffset =
-    DWORD_ROUND_UP (sizeof (FILE_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length);
+    ULONG_ROUND_UP (sizeof (FILE_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length);
   RtlCopyMemory (pInfo->FileName, DirContext->LongNameU.Buffer, DirContext->LongNameU.Length);
   return STATUS_SUCCESS;
 }
@@ -103,7 +103,7 @@
     return STATUS_BUFFER_OVERFLOW;
   pInfo->FileNameLength = DirContext->LongNameU.Length;
   pInfo->NextEntryOffset =
-    DWORD_ROUND_UP (sizeof (FILE_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length);
+    ULONG_ROUND_UP (sizeof (FILE_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length);
   RtlCopyMemory (pInfo->FileName, DirContext->LongNameU.Buffer, DirContext->LongNameU.Length);
 //      pInfo->FileIndex=;
   if (DeviceExt->Flags & VCB_IS_FATX)
@@ -173,7 +173,7 @@
     return STATUS_BUFFER_OVERFLOW;
   pInfo->FileNameLength = DirContext->LongNameU.Length;
   pInfo->NextEntryOffset =
-    DWORD_ROUND_UP (sizeof (FILE_FULL_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length);
+    ULONG_ROUND_UP (sizeof (FILE_FULL_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length);
   RtlCopyMemory (pInfo->FileName, DirContext->LongNameU.Buffer, DirContext->LongNameU.Length);
 //      pInfo->FileIndex=;
   if (DeviceExt->Flags & VCB_IS_FATX)
@@ -231,7 +231,7 @@
     pInfo->FileNameLength = DirContext->LongNameU.Length;
     RtlCopyMemory(pInfo->FileName, DirContext->LongNameU.Buffer, DirContext->LongNameU.Length);
     pInfo->NextEntryOffset = 
-      DWORD_ROUND_UP (sizeof (FILE_BOTH_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length);
+      ULONG_ROUND_UP (sizeof (FILE_BOTH_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length);
     pInfo->ShortName[0] = 0;
     pInfo->ShortNameLength = 0;
     //      pInfo->FileIndex=;
@@ -264,7 +264,7 @@
   {
     pInfo->FileNameLength = DirContext->LongNameU.Length;
     pInfo->NextEntryOffset = 
-      DWORD_ROUND_UP (sizeof (FILE_BOTH_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length);
+      ULONG_ROUND_UP (sizeof (FILE_BOTH_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length);
     RtlCopyMemory(pInfo->ShortName, DirContext->ShortNameU.Buffer, DirContext->ShortNameU.Length);
     pInfo->ShortNameLength = DirContext->ShortNameU.Length;
     RtlCopyMemory (pInfo->FileName, DirContext->LongNameU.Buffer, DirContext->LongNameU.Length);

Modified: trunk/reactos/drivers/fs/vfat/direntry.c
--- trunk/reactos/drivers/fs/vfat/direntry.c	2005-01-12 10:24:56 UTC (rev 12953)
+++ trunk/reactos/drivers/fs/vfat/direntry.c	2005-01-12 10:46:13 UTC (rev 12954)
@@ -45,7 +45,7 @@
   return  cluster;
 }
 
-BOOL FATIsDirectoryEmpty(PVFATFCB Fcb)
+BOOLEAN FATIsDirectoryEmpty(PVFATFCB Fcb)
 {
    LARGE_INTEGER FileOffset;
    PVOID Context = NULL;
@@ -98,7 +98,7 @@
    return TRUE;
 }
 
-BOOL FATXIsDirectoryEmpty(PVFATFCB Fcb)
+BOOLEAN FATXIsDirectoryEmpty(PVFATFCB Fcb)
 {
    LARGE_INTEGER FileOffset;
    PVOID Context = NULL;
@@ -144,7 +144,7 @@
    return TRUE;
 }
 
-BOOL VfatIsDirectoryEmpty(PVFATFCB Fcb)
+BOOLEAN VfatIsDirectoryEmpty(PVFATFCB Fcb)
 {
    if (Fcb->Flags & FCB_IS_FATX_ENTRY)
       return FATXIsDirectoryEmpty(Fcb);

Modified: trunk/reactos/drivers/fs/vfat/dirwr.c
--- trunk/reactos/drivers/fs/vfat/dirwr.c	2005-01-12 10:24:56 UTC (rev 12953)
+++ trunk/reactos/drivers/fs/vfat/dirwr.c	2005-01-12 10:46:13 UTC (rev 12954)
@@ -151,7 +151,7 @@
         return FALSE;
       }
       // clear the new dir cluster
-      FileOffset.u.LowPart = (DWORD)(pDirFcb->RFCB.FileSize.QuadPart -
+      FileOffset.u.LowPart = (ULONG)(pDirFcb->RFCB.FileSize.QuadPart -
                                      DeviceExt->FatInfo.BytesPerCluster);
       CcMapData (pDirFcb->FileObject, &FileOffset, DeviceExt->FatInfo.BytesPerCluster,
                  TRUE, &Context, (PVOID*)&pFatEntry);
@@ -195,7 +195,7 @@
   PVOID Context = NULL;
   PFAT_DIR_ENTRY pFatEntry;
   slot *pSlots;
-  short nbSlots = 0, j, posCar;
+  USHORT nbSlots = 0, j, posCar;
   PUCHAR Buffer;
   BOOLEAN needTilde = FALSE, needLong = FALSE;
   BOOLEAN lCaseBase = FALSE, uCaseBase, lCaseExt = FALSE, uCaseExt;
@@ -402,11 +402,11 @@
           pSlots[i].attr = 0xf;
           if (i)
             {
-              pSlots[i].id = nbSlots - i - 1;
+              pSlots[i].id = (unsigned char)(nbSlots - i - 1);
             }
           else
             {
-              pSlots[i].id = nbSlots - i - 1 + 0x40;
+              pSlots[i].id = (unsigned char)(nbSlots - i - 1 + 0x40);
             }
           pSlots[i].alias_checksum = pSlots[0].alias_checksum;
           RtlCopyMemory (pSlots[i].name0_4, DirContext.LongNameU.Buffer + (nbSlots - i - 2) * 13, 10);

Modified: trunk/reactos/drivers/fs/vfat/fcb.c
--- trunk/reactos/drivers/fs/vfat/fcb.c	2005-01-12 10:24:56 UTC (rev 12953)
+++ trunk/reactos/drivers/fs/vfat/fcb.c	2005-01-12 10:46:13 UTC (rev 12954)
@@ -151,13 +151,13 @@
   ExFreeToNPagedLookasideList(&VfatGlobalData->FcbLookasideList, pFCB);
 }
 
-BOOL
+BOOLEAN
 vfatFCBIsDirectory(PVFATFCB FCB)
 {
   return  *FCB->Attributes & FILE_ATTRIBUTE_DIRECTORY;
 }
 
-BOOL
+BOOLEAN
 vfatFCBIsRoot(PVFATFCB FCB)
 {
   return  FCB->PathNameU.Length == sizeof(WCHAR) && FCB->PathNameU.Buffer[0] == L'\\' ? TRUE : FALSE;

Modified: trunk/reactos/drivers/fs/vfat/finfo.c
--- trunk/reactos/drivers/fs/vfat/finfo.c	2005-01-12 10:24:56 UTC (rev 12953)
+++ trunk/reactos/drivers/fs/vfat/finfo.c	2005-01-12 10:46:13 UTC (rev 12954)
@@ -479,7 +479,7 @@
   ULONG ClusterSize = DeviceExt->FatInfo.BytesPerCluster;
   ULONG NewSize = AllocationSize->u.LowPart;
   ULONG NCluster;
-  BOOL AllocSizeChanged = FALSE;
+  BOOLEAN AllocSizeChanged = FALSE;
 
   DPRINT("VfatSetAllocationSizeInformation()\n");
 
@@ -746,7 +746,7 @@
   PVFATFCB FCB = NULL;
   NTSTATUS RC = STATUS_SUCCESS;
   PVOID SystemBuffer;
-  BOOL CanWait = IrpContext->Flags & IRPCONTEXT_CANWAIT;
+  BOOLEAN CanWait = (IrpContext->Flags & IRPCONTEXT_CANWAIT) != 0;
   
   /* PRECONDITION */
   ASSERT(IrpContext);

Modified: trunk/reactos/drivers/fs/vfat/fsctl.c
--- trunk/reactos/drivers/fs/vfat/fsctl.c	2005-01-12 10:24:56 UTC (rev 12953)
+++ trunk/reactos/drivers/fs/vfat/fsctl.c	2005-01-12 10:46:13 UTC (rev 12954)
@@ -56,7 +56,7 @@
    LARGE_INTEGER Offset;
    struct _BootSector* Boot;
    struct _BootSectorFatX* BootFatX;
-   BOOL PartitionInfoIsValid = FALSE;
+   BOOLEAN PartitionInfoIsValid = FALSE;
 
    DPRINT("VfatHasFileSystem\n");
 

Modified: trunk/reactos/drivers/fs/vfat/iface.c
--- trunk/reactos/drivers/fs/vfat/iface.c	2005-01-12 10:24:56 UTC (rev 12953)
+++ trunk/reactos/drivers/fs/vfat/iface.c	2005-01-12 10:46:13 UTC (rev 12954)
@@ -45,7 +45,7 @@
 DriverEntry(PDRIVER_OBJECT DriverObject,
 	    PUNICODE_STRING RegistryPath)
 /*
- * FUNCTION: Called by the system to initalize the driver
+ * FUNCTION: Called by the system to initialize the driver
  * ARGUMENTS:
  *           DriverObject = object describing this driver
  *           RegistryPath = path to our configuration entries

Modified: trunk/reactos/drivers/fs/vfat/rw.c
--- trunk/reactos/drivers/fs/vfat/rw.c	2005-01-12 10:24:56 UTC (rev 12953)
+++ trunk/reactos/drivers/fs/vfat/rw.c	2005-01-12 10:46:13 UTC (rev 12954)
@@ -375,7 +375,7 @@
 
    ASSERT(WriteOffset.QuadPart + Length <= Fcb->RFCB.AllocationSize.QuadPart);
    ASSERT(WriteOffset.u.LowPart % BytesPerSector == 0);
-   ASSERT(Length % BytesPerSector == 0)
+   ASSERT(Length % BytesPerSector == 0);
 
    // Is this a write of the volume ?
    if (Fcb->Flags & FCB_IS_VOLUME)
@@ -705,7 +705,7 @@
       CHECKPOINT;
       if (ByteOffset.QuadPart + Length > ROUND_UP(Fcb->RFCB.FileSize.QuadPart, BytesPerSector))
       {
-         Length = ROUND_UP(Fcb->RFCB.FileSize.QuadPart, BytesPerSector) - ByteOffset.QuadPart;
+         Length = (ULONG)(ROUND_UP(Fcb->RFCB.FileSize.QuadPart, BytesPerSector) - ByteOffset.QuadPart);
       }
 
       Status = VfatLockUserBuffer(IrpContext->Irp, Length, IoWriteAccess);
@@ -719,8 +719,8 @@
       if (Status == STATUS_VERIFY_REQUIRED)
       {
          DPRINT("VfatReadFile returned STATUS_VERIFY_REQUIRED\n");
-         DeviceToVerify = IoGetDeviceToVerify((struct _ETHREAD*)KeGetCurrentThread());
-         IoSetDeviceToVerify((struct _ETHREAD*)KeGetCurrentThread(), NULL);
+         DeviceToVerify = IoGetDeviceToVerify(PsGetCurrentThread());
+         IoSetDeviceToVerify(PsGetCurrentThread(), NULL);
          Status = IoVerifyVolume (DeviceToVerify, FALSE);
 
          if (NT_SUCCESS(Status))

Modified: trunk/reactos/drivers/fs/vfat/vfat.h
--- trunk/reactos/drivers/fs/vfat/vfat.h	2005-01-12 10:24:56 UTC (rev 12953)
+++ trunk/reactos/drivers/fs/vfat/vfat.h	2005-01-12 10:46:13 UTC (rev 12954)
@@ -179,7 +179,7 @@
   ULONG NumberOfClusters;
   ULONG FatType;
   ULONG Sectors;
-  BOOL FixedMedia;
+  BOOLEAN FixedMedia;
 } FATINFO, *PFATINFO;
 
 struct _VFATFCB;
@@ -356,17 +356,17 @@
 
 typedef struct __DOSTIME
 {
-   WORD	Second:5;
-   WORD	Minute:6;
-   WORD Hour:5;
+   USHORT Second:5;
+   USHORT Minute:6;
+   USHORT Hour:5;
 }
 DOSTIME, *PDOSTIME;
 
 typedef struct __DOSDATE
 {
-   WORD	Day:5;
-   WORD	Month:4;
-   WORD Year:5;
+   USHORT Day:5;
+   USHORT Month:4;
+   USHORT Year:5;
 }
 DOSDATE, *PDOSDATE;
 
@@ -441,15 +441,15 @@
 
 NTSTATUS VfatDirectoryControl (PVFAT_IRP_CONTEXT);
 
-BOOL FsdDosDateTimeToSystemTime (PDEVICE_EXTENSION DeviceExt,
-                                 WORD wDosDate,
-                                 WORD wDosTime,
-                                 PLARGE_INTEGER SystemTime);
+BOOLEAN FsdDosDateTimeToSystemTime (PDEVICE_EXTENSION DeviceExt,
+                                    USHORT DosDate,
+                                    USHORT DosTime,
+                                    PLARGE_INTEGER SystemTime);
 
-BOOL FsdSystemTimeToDosDateTime (PDEVICE_EXTENSION DeviceExt,
-                                 PLARGE_INTEGER SystemTime,
-                                 WORD *pwDosDate,
-                                 WORD *pwDosTime);
+BOOLEAN FsdSystemTimeToDosDateTime (PDEVICE_EXTENSION DeviceExt,
+                                    PLARGE_INTEGER SystemTime,
+                                    USHORT *pDosDate,
+                                    USHORT *pDosTime);
 
 /*  --------------------------------------------------------  create.c  */
 
@@ -602,7 +602,7 @@
 ULONG  vfatDirEntryGetFirstCluster (PDEVICE_EXTENSION  pDeviceExt,
                                     PDIR_ENTRY  pDirEntry);
 
-BOOL VfatIsDirectoryEmpty(PVFATFCB Fcb);
+BOOLEAN VfatIsDirectoryEmpty(PVFATFCB Fcb);
 
 NTSTATUS FATGetNextDirEntry(PVOID * pContext,
 			     PVOID * pPage,
@@ -641,9 +641,9 @@
 
 PVFATFCB vfatOpenRootFCB (PDEVICE_EXTENSION  pVCB);
 
-BOOL vfatFCBIsDirectory (PVFATFCB FCB);
+BOOLEAN vfatFCBIsDirectory (PVFATFCB FCB);
 
-BOOL vfatFCBIsRoot(PVFATFCB FCB);
+BOOLEAN vfatFCBIsRoot(PVFATFCB FCB);
 
 NTSTATUS vfatAttachFCBToFileObject (PDEVICE_EXTENSION  vcb,
                                     PVFATFCB  fcb,

Modified: trunk/reactos/drivers/fs/vfat/volume.c
--- trunk/reactos/drivers/fs/vfat/volume.c	2005-01-12 10:24:56 UTC (rev 12953)
+++ trunk/reactos/drivers/fs/vfat/volume.c	2005-01-12 10:46:13 UTC (rev 12954)
@@ -169,7 +169,7 @@
   PDIR_ENTRY Entry;
   PVFATFCB pRootFcb;
   LARGE_INTEGER FileOffset;
-  BOOL LabelFound = FALSE;
+  BOOLEAN LabelFound = FALSE;
   DIR_ENTRY VolumeLabelDirEntry;
   ULONG VolumeLabelDirIndex;
   ULONG LabelLen;