]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fixed update file time error problem.
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 9 Oct 2010 02:46:37 +0000 (02:46 +0000)
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 9 Oct 2010 02:46:37 +0000 (02:46 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10913 6f19259b-4bc3-4df7-8a09-765794883524

Nt32Pkg/Include/Protocol/WinNtThunk.h
Nt32Pkg/Sec/WinNtThunk.c
Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c

index e63322d6c02e499170b2a78c7441a469aea40cbe..5a5d8290d254ca8068d12d9f5b52b8b7ca82f254 100644 (file)
@@ -1,6 +1,6 @@
 /**@file\r
 \r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -676,6 +676,15 @@ BOOL
   CONST SYSTEMTIME    *SystemTime\r
   );\r
 \r
+typedef\r
+WINBASEAPI\r
+BOOL\r
+(WINAPI *WinNtLocalFileTimeToFileTime) (\r
+  CONST FILETIME  *LocalFileTime,\r
+  LPFILETIME      FileTime\r
+  );\r
+\r
+\r
 typedef\r
 WINBASEAPI\r
 BOOL\r
@@ -1197,6 +1206,7 @@ typedef struct {
   //\r
   // Win32 Time APIs\r
   //\r
+  WinNtLocalFileTimeToFileTime        LocalFileTimeToFileTime;\r
   WinNtFileTimeToLocalFileTime        FileTimeToLocalFileTime;\r
   WinNtFileTimeToSystemTime           FileTimeToSystemTime;\r
   WinNtGetSystemTime                  GetSystemTime;\r
index 45b255243858405106f735bd3e26f2843ee14117..e4589cbfc716e80aad3598f9386a6860c8ac4bb2 100644 (file)
@@ -1,6 +1,6 @@
 /**@file\r
 \r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -124,6 +124,7 @@ EFI_WIN_NT_THUNK_PROTOCOL mWinNtThunkTable = {
   MoveFile,\r
   SetFileTime,\r
   SystemTimeToFileTime,\r
+  LocalFileTimeToFileTime,\r
   FileTimeToLocalFileTime,\r
   FileTimeToSystemTime,\r
   GetSystemTime,\r
index 250d4bf536c9012e3adca8949d39263c8a145e93..fd925b931244404156fd608a1dc9be52a1d86a5c 100644 (file)
@@ -1995,6 +1995,7 @@ Returns:
     Info->FileSize      = FileInfo.nFileSizeLow;\r
     Info->PhysicalSize  = Info->FileSize;\r
 \r
+    PrivateFile->WinNtThunk->FileTimeToLocalFileTime(&FileInfo.ftCreationTime, &FileInfo.ftCreationTime);\r
     PrivateFile->WinNtThunk->FileTimeToSystemTime (&FileInfo.ftCreationTime, &SystemTime);\r
     Info->CreateTime.Year   = SystemTime.wYear;\r
     Info->CreateTime.Month  = (UINT8) SystemTime.wMonth;\r
@@ -2003,6 +2004,7 @@ Returns:
     Info->CreateTime.Minute = (UINT8) SystemTime.wMinute;\r
     Info->CreateTime.Second = (UINT8) SystemTime.wSecond;\r
 \r
+    PrivateFile->WinNtThunk->FileTimeToLocalFileTime(&FileInfo.ftLastAccessTime, &FileInfo.ftLastAccessTime);\r
     PrivateFile->WinNtThunk->FileTimeToSystemTime (&FileInfo.ftLastAccessTime, &SystemTime);\r
     Info->LastAccessTime.Year   = SystemTime.wYear;\r
     Info->LastAccessTime.Month  = (UINT8) SystemTime.wMonth;\r
@@ -2011,6 +2013,7 @@ Returns:
     Info->LastAccessTime.Minute = (UINT8) SystemTime.wMinute;\r
     Info->LastAccessTime.Second = (UINT8) SystemTime.wSecond;\r
 \r
+    PrivateFile->WinNtThunk->FileTimeToLocalFileTime(&FileInfo.ftLastWriteTime, &FileInfo.ftLastWriteTime);\r
     PrivateFile->WinNtThunk->FileTimeToSystemTime (&FileInfo.ftLastWriteTime, &SystemTime);\r
     Info->ModificationTime.Year   = SystemTime.wYear;\r
     Info->ModificationTime.Month  = (UINT8) SystemTime.wMonth;\r
@@ -2730,6 +2733,13 @@ Reopen: ;
       goto Done;\r
     }\r
 \r
+    if (!PrivateFile->WinNtThunk->LocalFileTimeToFileTime (\r
+                                    &NewCreationFileTime,\r
+                                    &NewCreationFileTime\r
+                                    )) {\r
+      goto Done;\r
+    }\r
+\r
     NewLastAccessSystemTime.wYear         = NewFileInfo->LastAccessTime.Year;\r
     NewLastAccessSystemTime.wMonth        = NewFileInfo->LastAccessTime.Month;\r
     NewLastAccessSystemTime.wDay          = NewFileInfo->LastAccessTime.Day;\r
@@ -2745,6 +2755,13 @@ Reopen: ;
       goto Done;\r
     }\r
 \r
+    if (!PrivateFile->WinNtThunk->LocalFileTimeToFileTime (\r
+                                    &NewLastAccessFileTime,\r
+                                    &NewLastAccessFileTime\r
+                                    )) {\r
+      goto Done;\r
+    }\r
+\r
     NewLastWriteSystemTime.wYear          = NewFileInfo->ModificationTime.Year;\r
     NewLastWriteSystemTime.wMonth         = NewFileInfo->ModificationTime.Month;\r
     NewLastWriteSystemTime.wDay           = NewFileInfo->ModificationTime.Day;\r
@@ -2760,6 +2777,13 @@ Reopen: ;
       goto Done;\r
     }\r
 \r
+    if (!PrivateFile->WinNtThunk->LocalFileTimeToFileTime (\r
+                                    &NewLastWriteFileTime,\r
+                                    &NewLastWriteFileTime\r
+                                    )) {\r
+      goto Done;\r
+    }\r
+\r
     if (!PrivateFile->WinNtThunk->SetFileTime (\r
                                     PrivateFile->IsDirectoryPath ? PrivateFile->DirHandle : PrivateFile->LHandle,\r
                                     &NewCreationFileTime,\r