Herve Poussineau <poussine@freesurf.fr>
- Use documented structures names instead of ReactOS equivalents.
- Replace CcMapData with CcPinRead on places where we're modifying the data.
Modified: trunk/reactos/drivers/fs/vfat/dir.c
Modified: trunk/reactos/drivers/fs/vfat/dirwr.c
Modified: trunk/reactos/drivers/fs/vfat/fat.c
Modified: trunk/reactos/drivers/fs/vfat/volume.c

Modified: trunk/reactos/drivers/fs/vfat/dir.c
--- trunk/reactos/drivers/fs/vfat/dir.c	2005-01-12 10:49:47 UTC (rev 12955)
+++ trunk/reactos/drivers/fs/vfat/dir.c	2005-01-12 11:07:31 UTC (rev 12956)
@@ -166,14 +166,14 @@
 NTSTATUS
 VfatGetFileFullDirectoryInformation (PVFAT_DIRENTRY_CONTEXT DirContext,
 				     PDEVICE_EXTENSION DeviceExt,
-				     PFILE_FULL_DIRECTORY_INFORMATION pInfo,
+				     PFILE_FULL_DIR_INFORMATION pInfo,
 				     ULONG BufferLength)
 {
-  if ((sizeof (FILE_FULL_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length) > BufferLength)
+  if ((sizeof (FILE_FULL_DIR_INFORMATION) + DirContext->LongNameU.Length) > BufferLength)
     return STATUS_BUFFER_OVERFLOW;
   pInfo->FileNameLength = DirContext->LongNameU.Length;
   pInfo->NextEntryOffset =
-    ULONG_ROUND_UP (sizeof (FILE_FULL_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length);
+    ULONG_ROUND_UP (sizeof (FILE_FULL_DIR_INFORMATION) + DirContext->LongNameU.Length);
   RtlCopyMemory (pInfo->FileName, DirContext->LongNameU.Buffer, DirContext->LongNameU.Length);
 //      pInfo->FileIndex=;
   if (DeviceExt->Flags & VCB_IS_FATX)
@@ -220,10 +220,10 @@
 NTSTATUS
 VfatGetFileBothInformation (PVFAT_DIRENTRY_CONTEXT DirContext,
 			    PDEVICE_EXTENSION DeviceExt,
-			    PFILE_BOTH_DIRECTORY_INFORMATION pInfo,
+			    PFILE_BOTH_DIR_INFORMATION pInfo,
 			    ULONG BufferLength)
 {
-  if ((sizeof (FILE_BOTH_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length) > BufferLength)
+  if ((sizeof (FILE_BOTH_DIR_INFORMATION) + DirContext->LongNameU.Length) > BufferLength)
     return STATUS_BUFFER_OVERFLOW;
   
   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 = 
-      ULONG_ROUND_UP (sizeof (FILE_BOTH_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length);
+      ULONG_ROUND_UP (sizeof (FILE_BOTH_DIR_INFORMATION) + DirContext->LongNameU.Length);
     pInfo->ShortName[0] = 0;
     pInfo->ShortNameLength = 0;
     //      pInfo->FileIndex=;
@@ -264,7 +264,7 @@
   {
     pInfo->FileNameLength = DirContext->LongNameU.Length;
     pInfo->NextEntryOffset = 
-      ULONG_ROUND_UP (sizeof (FILE_BOTH_DIRECTORY_INFORMATION) + DirContext->LongNameU.Length);
+      ULONG_ROUND_UP (sizeof (FILE_BOTH_DIR_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);
@@ -427,13 +427,13 @@
              case FileFullDirectoryInformation:
                RC = VfatGetFileFullDirectoryInformation (&DirContext, 
 	                                                 IrpContext->DeviceExt,
-						         (PFILE_FULL_DIRECTORY_INFORMATION) Buffer, 
+						         (PFILE_FULL_DIR_INFORMATION) Buffer, 
 						         BufferLength);
                break;
              case FileBothDirectoryInformation:
                RC = VfatGetFileBothInformation (&DirContext, 
 	                                        IrpContext->DeviceExt,
-					        (PFILE_BOTH_DIRECTORY_INFORMATION) Buffer, 
+					        (PFILE_BOTH_DIR_INFORMATION) Buffer, 
 					        BufferLength);
                break;
              default:

Modified: trunk/reactos/drivers/fs/vfat/dirwr.c
--- trunk/reactos/drivers/fs/vfat/dirwr.c	2005-01-12 10:49:47 UTC (rev 12955)
+++ trunk/reactos/drivers/fs/vfat/dirwr.c	2005-01-12 11:07:31 UTC (rev 12956)
@@ -49,7 +49,7 @@
 
   Offset.u.HighPart = 0;
   Offset.u.LowPart = dirIndex * SizeDirEntry;
-  if (CcMapData (pFcb->parentFcb->FileObject, &Offset, SizeDirEntry,
+  if (CcPinRead (pFcb->parentFcb->FileObject, &Offset, SizeDirEntry,
       TRUE, &Context, (PVOID*)&PinEntry))
     {
       pFcb->Flags &= ~FCB_IS_DIRTY;
@@ -99,7 +99,7 @@
         CcUnpinData(Context);
       }
       // FIXME: check return value
-      CcMapData (pDirFcb->FileObject, &FileOffset, DeviceExt->FatInfo.BytesPerCluster,
+      CcPinRead (pDirFcb->FileObject, &FileOffset, DeviceExt->FatInfo.BytesPerCluster,
                  TRUE, &Context, (PVOID*)&pFatEntry);
       FileOffset.u.LowPart += DeviceExt->FatInfo.BytesPerCluster;
     }
@@ -153,7 +153,7 @@
       // clear the new dir cluster
       FileOffset.u.LowPart = (ULONG)(pDirFcb->RFCB.FileSize.QuadPart -
                                      DeviceExt->FatInfo.BytesPerCluster);
-      CcMapData (pDirFcb->FileObject, &FileOffset, DeviceExt->FatInfo.BytesPerCluster,
+      CcPinRead (pDirFcb->FileObject, &FileOffset, DeviceExt->FatInfo.BytesPerCluster,
                  TRUE, &Context, (PVOID*)&pFatEntry);
       if (DeviceExt->Flags & VCB_IS_FATX)
         memset(pFatEntry, 0xff, DeviceExt->FatInfo.BytesPerCluster);
@@ -164,7 +164,7 @@
     {
       // clear the entry after the last new entry
       FileOffset.u.LowPart = (*start + nbSlots) * SizeDirEntry;
-      CcMapData (pDirFcb->FileObject, &FileOffset, SizeDirEntry,
+      CcPinRead (pDirFcb->FileObject, &FileOffset, SizeDirEntry,
                  TRUE, &Context, (PVOID*)&pFatEntry);
       if (DeviceExt->Flags & VCB_IS_FATX)
         memset(pFatEntry, 0xff, SizeDirEntry);
@@ -448,7 +448,7 @@
     {
       /* one cluster */
       CHECKPOINT;
-      CcMapData (ParentFcb->FileObject, &FileOffset, nbSlots * sizeof(FAT_DIR_ENTRY),
+      CcPinRead (ParentFcb->FileObject, &FileOffset, nbSlots * sizeof(FAT_DIR_ENTRY),
                  TRUE, &Context, (PVOID*)&pFatEntry);
       if (nbSlots > 1)
         {
@@ -463,13 +463,13 @@
       size = DeviceExt->FatInfo.BytesPerCluster -
              (DirContext.StartIndex * sizeof(FAT_DIR_ENTRY)) % DeviceExt->FatInfo.BytesPerCluster;
       i = size / sizeof(FAT_DIR_ENTRY);
-      CcMapData (ParentFcb->FileObject, &FileOffset, size, TRUE,
+      CcPinRead (ParentFcb->FileObject, &FileOffset, size, TRUE,
                  &Context, (PVOID*)&pFatEntry);
       RtlCopyMemory(pFatEntry, Buffer, size);
       CcSetDirtyPinnedData(Context, NULL);
       CcUnpinData(Context);
       FileOffset.u.LowPart += size;
-      CcMapData (ParentFcb->FileObject, &FileOffset,
+      CcPinRead (ParentFcb->FileObject, &FileOffset,
                  nbSlots * sizeof(FAT_DIR_ENTRY) - size,
                  TRUE, &Context, (PVOID*)&pFatEntry);
       if (nbSlots - 1 > i)
@@ -587,7 +587,7 @@
    /* add entry into parent directory */
    FileOffset.u.HighPart = 0;
    FileOffset.u.LowPart = DirContext.StartIndex * sizeof(FATX_DIR_ENTRY);
-   CcMapData(ParentFcb->FileObject, &FileOffset, sizeof(FATX_DIR_ENTRY),
+   CcPinRead(ParentFcb->FileObject, &FileOffset, sizeof(FATX_DIR_ENTRY),
              TRUE, &Context, (PVOID*)&pFatXDirEntry);
    RtlCopyMemory(pFatXDirEntry, &DirContext.DirEntry.FatX, sizeof(FATX_DIR_ENTRY));
    CcSetDirtyPinnedData(Context, NULL);
@@ -641,7 +641,7 @@
             CcUnpinData(Context);
           }
           Offset.u.LowPart = (i * sizeof(FAT_DIR_ENTRY) / PAGE_SIZE) * PAGE_SIZE;
-          CcMapData (pFcb->parentFcb->FileObject, &Offset, PAGE_SIZE, TRUE,
+          CcPinRead (pFcb->parentFcb->FileObject, &Offset, PAGE_SIZE, TRUE,
                      &Context, (PVOID*)&pDirEntry);
         }
       pDirEntry[i % (PAGE_SIZE / sizeof(FAT_DIR_ENTRY))].Filename[0] = 0xe5;
@@ -690,10 +690,10 @@
   DPRINT ("delete entry: %d\n", StartIndex);
   Offset.u.HighPart = 0;
   Offset.u.LowPart = (StartIndex * sizeof(FATX_DIR_ENTRY) / PAGE_SIZE) * PAGE_SIZE;
-  if (!CcMapData (pFcb->parentFcb->FileObject, &Offset, PAGE_SIZE, TRUE,
+  if (!CcPinRead (pFcb->parentFcb->FileObject, &Offset, PAGE_SIZE, TRUE,
                      &Context, (PVOID*)&pDirEntry))
   {
-    DPRINT1("CcMapData(Offset %x:%x, Length %d) failed\n", Offset.u.HighPart, Offset.u.LowPart, PAGE_SIZE);
+    DPRINT1("CcPinRead(Offset %x:%x, Length %d) failed\n", Offset.u.HighPart, Offset.u.LowPart, PAGE_SIZE);
     return STATUS_UNSUCCESSFUL;
   }
   pDirEntry = &pDirEntry[StartIndex % (PAGE_SIZE / sizeof(FATX_DIR_ENTRY))];

Modified: trunk/reactos/drivers/fs/vfat/fat.c
--- trunk/reactos/drivers/fs/vfat/fat.c	2005-01-12 10:49:47 UTC (rev 12955)
+++ trunk/reactos/drivers/fs/vfat/fat.c	2005-01-12 11:07:31 UTC (rev 12956)
@@ -157,7 +157,7 @@
     for (i = StartCluster; i < FatLength; )
     {
       Offset.QuadPart = ROUND_DOWN(i * 2, ChunkSize);
-      if(!CcMapData(DeviceExt->FATFileObject, &Offset, ChunkSize, 1, &Context, &BaseAddress))
+      if(!CcPinRead(DeviceExt->FATFileObject, &Offset, ChunkSize, 1, &Context, &BaseAddress))
       {
         DPRINT1("CcMapData(Offset %x, Length %d) failed\n", (ULONG)Offset.QuadPart, ChunkSize);
         return STATUS_UNSUCCESSFUL;
@@ -209,7 +209,7 @@
   *Cluster = 0;
   StartCluster = DeviceExt->LastAvailableCluster;
   Offset.QuadPart = 0;
-  if(!CcMapData(DeviceExt->FATFileObject, &Offset, DeviceExt->FatInfo.FATSectors * DeviceExt->FatInfo.BytesPerSector, 1, &Context, &BaseAddress))
+  if(!CcPinRead(DeviceExt->FATFileObject, &Offset, DeviceExt->FatInfo.FATSectors * DeviceExt->FatInfo.BytesPerSector, 1, &Context, &BaseAddress))
   {
     DPRINT1("CcMapData(Offset %x, Length %d) failed\n", (ULONG)Offset.QuadPart, DeviceExt->FatInfo.FATSectors * DeviceExt->FatInfo.BytesPerSector);
     return STATUS_UNSUCCESSFUL;
@@ -274,7 +274,7 @@
     for (i = StartCluster; i < FatLength;)
     {
       Offset.QuadPart = ROUND_DOWN(i * 4, ChunkSize);
-      if(!CcMapData(DeviceExt->FATFileObject, &Offset, ChunkSize, 1, &Context, &BaseAddress))
+      if(!CcPinRead(DeviceExt->FATFileObject, &Offset, ChunkSize, 1, &Context, &BaseAddress))
       {
         DPRINT1("CcMapData(Offset %x, Length %d) failed\n", (ULONG)Offset.QuadPart, ChunkSize);
         return STATUS_UNSUCCESSFUL;
@@ -491,7 +491,7 @@
   LARGE_INTEGER Offset;
 
   Offset.QuadPart = 0;
-  if(!CcMapData(DeviceExt->FATFileObject, &Offset, DeviceExt->FatInfo.FATSectors * DeviceExt->FatInfo.BytesPerSector, 1, &Context, &BaseAddress))
+  if(!CcPinRead(DeviceExt->FATFileObject, &Offset, DeviceExt->FatInfo.FATSectors * DeviceExt->FatInfo.BytesPerSector, 1, &Context, &BaseAddress))
   {
     return STATUS_UNSUCCESSFUL;
   }
@@ -540,7 +540,7 @@
   ChunkSize = CACHEPAGESIZE(DeviceExt);
   FATOffset = ClusterToWrite * 2;
   Offset.QuadPart = ROUND_DOWN(FATOffset, ChunkSize);
-  if(!CcMapData(DeviceExt->FATFileObject, &Offset, ChunkSize, 1, &Context, &BaseAddress))
+  if(!CcPinRead(DeviceExt->FATFileObject, &Offset, ChunkSize, 1, &Context, &BaseAddress))
   {
     return STATUS_UNSUCCESSFUL;
   }
@@ -574,7 +574,7 @@
 
   FATOffset = (ClusterToWrite * 4);
   Offset.QuadPart = ROUND_DOWN(FATOffset, ChunkSize);
-  if(!CcMapData(DeviceExt->FATFileObject, &Offset, ChunkSize, 1, &Context, &BaseAddress))
+  if(!CcPinRead(DeviceExt->FATFileObject, &Offset, ChunkSize, 1, &Context, &BaseAddress))
   {
     return STATUS_UNSUCCESSFUL;
   }

Modified: trunk/reactos/drivers/fs/vfat/volume.c
--- trunk/reactos/drivers/fs/vfat/volume.c	2005-01-12 10:49:47 UTC (rev 12955)
+++ trunk/reactos/drivers/fs/vfat/volume.c	2005-01-12 11:07:31 UTC (rev 12956)
@@ -233,7 +233,7 @@
    
   /* Search existing volume entry on disk */
   FileOffset.QuadPart = 0;
-  if (CcMapData(pRootFcb->FileObject, &FileOffset, PAGE_SIZE, TRUE, &Context, (PVOID*)&Entry))
+  if (CcPinRead(pRootFcb->FileObject, &FileOffset, PAGE_SIZE, TRUE, &Context, (PVOID*)&Entry))
   {
     while (TRUE)
     {
@@ -256,7 +256,7 @@
       {
 	     CcUnpinData(Context);
 	     FileOffset.u.LowPart += PAGE_SIZE;
-	     if (!CcMapData(pRootFcb->FileObject, &FileOffset, PAGE_SIZE, TRUE, &Context, (PVOID*)&Entry))
+	     if (!CcPinRead(pRootFcb->FileObject, &FileOffset, PAGE_SIZE, TRUE, &Context, (PVOID*)&Entry))
 	     {
 	       Context = NULL;
 	       break;
@@ -277,7 +277,7 @@
     {
       FileOffset.u.HighPart = 0;
       FileOffset.u.LowPart = VolumeLabelDirIndex * SizeDirEntry;
-      CcMapData(pRootFcb->FileObject, &FileOffset, SizeDirEntry,
+      CcPinRead(pRootFcb->FileObject, &FileOffset, SizeDirEntry,
                  TRUE, &Context, (PVOID*)&Entry);
       RtlCopyMemory(Entry, &VolumeLabelDirEntry, SizeDirEntry);
       CcSetDirtyPinnedData(Context, NULL);