]> git.proxmox.com Git - mirror_edk2.git/blobdiff - FatPkg/EnhancedFatDxe/DirectoryManage.c
1. FAT doesn't support to store time information in its FileLastAccess field. The...
[mirror_edk2.git] / FatPkg / EnhancedFatDxe / DirectoryManage.c
index 9fdb7affe4547b4a9c4beeec805d17f33762e5d6..8d6d15467e6b5e9341fae27758e3df1d4e5d93fb 100644 (file)
@@ -989,7 +989,8 @@ Returns:
   // We will append this entry to the end of directory\r
   //\r
   FatGetCurrentFatTime (&DirEnt->Entry.FileCreateTime);\r
-  FatGetCurrentFatTime (&DirEnt->Entry.FileModificationTime);\r
+  CopyMem (&DirEnt->Entry.FileModificationTime, &DirEnt->Entry.FileCreateTime, sizeof (FAT_DATE_TIME));\r
+  CopyMem (&DirEnt->Entry.FileLastAccess, &DirEnt->Entry.FileCreateTime.Date, sizeof (FAT_DATE));\r
   NewEndPos = ODir->CurrentEndPos + DirEnt->EntryCount;\r
   if (NewEndPos * sizeof (FAT_DIRECTORY_ENTRY) > OFile->FileSize) {\r
     if (NewEndPos >= (OFile->IsFixedRootDir ? OFile->Volume->RootEntries : FAT_MAX_DIRENTRY_COUNT)) {\r