update for HEAD-2003050101
[reactos.git] / drivers / fs / vfat / create.c
index 3aa7ac1..74666e1 100644 (file)
@@ -238,12 +238,14 @@ FindFile (PDEVICE_EXTENSION DeviceExt,
        CHECKPOINT;
        Fcb->PathName[0]='\\';
        Fcb->ObjectName = &Fcb->PathName[1];
-       Fcb->entry.FileSize = DeviceExt->FatInfo.rootDirectorySectors * DeviceExt->FatInfo.BytesPerSector;
        Fcb->entry.Attrib = FILE_ATTRIBUTE_DIRECTORY;
+       Fcb->entry.CreationDate = 0x0021;    /* 1.1.1980 */
+       Fcb->entry.AccessDate = 0x0021;
+       Fcb->entry.UpdateDate = 0x0021;
        if (DeviceExt->FatInfo.FatType == FAT32)
        {
-          Fcb->entry.FirstCluster = ((PUSHORT)FirstCluster)[0];
-          Fcb->entry.FirstClusterHigh = ((PUSHORT)FirstCluster)[1];
+          Fcb->entry.FirstCluster = ((PUSHORT)&FirstCluster)[0];
+          Fcb->entry.FirstClusterHigh = ((PUSHORT)&FirstCluster)[1];
        }
        else
          Fcb->entry.FirstCluster = 1;
@@ -364,12 +366,9 @@ vfatMakeAbsoluteFilename (PFILE_OBJECT pFileObject,
 {
   PWSTR  rcName;
   PVFATFCB  fcb;
-  PVFATCCB  ccb;
 
   DPRINT ("try related for %S\n", pRelativeFileName);
-  ccb = pFileObject->FsContext2;
-  assert (ccb);
-  fcb = ccb->pFcb;
+  fcb = pFileObject->FsContext;
   assert (fcb);
 
   /* verify related object is a directory and target name
@@ -600,11 +599,8 @@ VfatCreateFile (PDEVICE_OBJECT DeviceObject, PIRP Irp)
       memset(pCcb, 0, sizeof(VFATCCB));
       FileObject->Flags |= FO_FCB_IS_VALID;
       FileObject->SectionObjectPointers = &pFcb->SectionObjectPointers;
-      FileObject->FsContext = (PVOID) &pFcb->RFCB;
+      FileObject->FsContext = pFcb;
       FileObject->FsContext2 = pCcb;
-      pCcb->pFcb = pFcb;
-      pCcb->PtrFileObject = FileObject;
-      pFcb->pDevExt = DeviceExt;
       pFcb->RefCount++;
 
       Irp->IoStatus.Information = FILE_OPENED;
@@ -654,8 +650,7 @@ VfatCreateFile (PDEVICE_OBJECT DeviceObject, PIRP Irp)
                                 Attributes & FILE_ATTRIBUTE_VALID_FLAGS);
          if (NT_SUCCESS (Status))
            {
-             pCcb = FileObject->FsContext2;
-             pFcb = pCcb->pFcb;
+             pFcb = FileObject->FsContext;
              Irp->IoStatus.Information = FILE_CREATED;
              VfatSetAllocationSizeInformation(FileObject, 
                                               pFcb,
@@ -689,8 +684,7 @@ VfatCreateFile (PDEVICE_OBJECT DeviceObject, PIRP Irp)
          return(STATUS_OBJECT_NAME_COLLISION);
        }
 
-      pCcb = FileObject->FsContext2;
-      pFcb = pCcb->pFcb;
+      pFcb = FileObject->FsContext;
 
       /*
        * Check the file has the requested attributes