diff options
author | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-10-09 02:46:37 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-10-09 02:46:37 +0000 |
commit | f515069c194f418b74915be4a2e021c2b3ae2c46 (patch) | |
tree | 55ec2cc7ea52ee7abf90ed14dbd988019beabdf9 | |
parent | e0919a58562a55ae6964c51598dc0d76389ee109 (diff) | |
download | edk2-platforms-f515069c194f418b74915be4a2e021c2b3ae2c46.tar.xz |
Fixed update file time error problem.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10913 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | Nt32Pkg/Include/Protocol/WinNtThunk.h | 12 | ||||
-rw-r--r-- | Nt32Pkg/Sec/WinNtThunk.c | 3 | ||||
-rw-r--r-- | Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c | 24 |
3 files changed, 37 insertions, 2 deletions
diff --git a/Nt32Pkg/Include/Protocol/WinNtThunk.h b/Nt32Pkg/Include/Protocol/WinNtThunk.h index e63322d6c0..5a5d8290d2 100644 --- a/Nt32Pkg/Include/Protocol/WinNtThunk.h +++ b/Nt32Pkg/Include/Protocol/WinNtThunk.h @@ -1,6 +1,6 @@ /**@file
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -679,6 +679,15 @@ BOOL typedef
WINBASEAPI
BOOL
+(WINAPI *WinNtLocalFileTimeToFileTime) (
+ CONST FILETIME *LocalFileTime,
+ LPFILETIME FileTime
+ );
+
+
+typedef
+WINBASEAPI
+BOOL
(WINAPI *WinNtFileTimeToLocalFileTime) (
CONST FILETIME *FileTime,
LPFILETIME LocalFileTime
@@ -1197,6 +1206,7 @@ typedef struct { //
// Win32 Time APIs
//
+ WinNtLocalFileTimeToFileTime LocalFileTimeToFileTime;
WinNtFileTimeToLocalFileTime FileTimeToLocalFileTime;
WinNtFileTimeToSystemTime FileTimeToSystemTime;
WinNtGetSystemTime GetSystemTime;
diff --git a/Nt32Pkg/Sec/WinNtThunk.c b/Nt32Pkg/Sec/WinNtThunk.c index 45b2552438..e4589cbfc7 100644 --- a/Nt32Pkg/Sec/WinNtThunk.c +++ b/Nt32Pkg/Sec/WinNtThunk.c @@ -1,6 +1,6 @@ /**@file
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -124,6 +124,7 @@ EFI_WIN_NT_THUNK_PROTOCOL mWinNtThunkTable = { MoveFile,
SetFileTime,
SystemTimeToFileTime,
+ LocalFileTimeToFileTime,
FileTimeToLocalFileTime,
FileTimeToSystemTime,
GetSystemTime,
diff --git a/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c b/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c index 250d4bf536..fd925b9312 100644 --- a/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c +++ b/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c @@ -1995,6 +1995,7 @@ Returns: Info->FileSize = FileInfo.nFileSizeLow;
Info->PhysicalSize = Info->FileSize;
+ PrivateFile->WinNtThunk->FileTimeToLocalFileTime(&FileInfo.ftCreationTime, &FileInfo.ftCreationTime);
PrivateFile->WinNtThunk->FileTimeToSystemTime (&FileInfo.ftCreationTime, &SystemTime);
Info->CreateTime.Year = SystemTime.wYear;
Info->CreateTime.Month = (UINT8) SystemTime.wMonth;
@@ -2003,6 +2004,7 @@ Returns: Info->CreateTime.Minute = (UINT8) SystemTime.wMinute;
Info->CreateTime.Second = (UINT8) SystemTime.wSecond;
+ PrivateFile->WinNtThunk->FileTimeToLocalFileTime(&FileInfo.ftLastAccessTime, &FileInfo.ftLastAccessTime);
PrivateFile->WinNtThunk->FileTimeToSystemTime (&FileInfo.ftLastAccessTime, &SystemTime);
Info->LastAccessTime.Year = SystemTime.wYear;
Info->LastAccessTime.Month = (UINT8) SystemTime.wMonth;
@@ -2011,6 +2013,7 @@ Returns: Info->LastAccessTime.Minute = (UINT8) SystemTime.wMinute;
Info->LastAccessTime.Second = (UINT8) SystemTime.wSecond;
+ PrivateFile->WinNtThunk->FileTimeToLocalFileTime(&FileInfo.ftLastWriteTime, &FileInfo.ftLastWriteTime);
PrivateFile->WinNtThunk->FileTimeToSystemTime (&FileInfo.ftLastWriteTime, &SystemTime);
Info->ModificationTime.Year = SystemTime.wYear;
Info->ModificationTime.Month = (UINT8) SystemTime.wMonth;
@@ -2730,6 +2733,13 @@ Reopen: ; goto Done;
}
+ if (!PrivateFile->WinNtThunk->LocalFileTimeToFileTime (
+ &NewCreationFileTime,
+ &NewCreationFileTime
+ )) {
+ goto Done;
+ }
+
NewLastAccessSystemTime.wYear = NewFileInfo->LastAccessTime.Year;
NewLastAccessSystemTime.wMonth = NewFileInfo->LastAccessTime.Month;
NewLastAccessSystemTime.wDay = NewFileInfo->LastAccessTime.Day;
@@ -2745,6 +2755,13 @@ Reopen: ; goto Done;
}
+ if (!PrivateFile->WinNtThunk->LocalFileTimeToFileTime (
+ &NewLastAccessFileTime,
+ &NewLastAccessFileTime
+ )) {
+ goto Done;
+ }
+
NewLastWriteSystemTime.wYear = NewFileInfo->ModificationTime.Year;
NewLastWriteSystemTime.wMonth = NewFileInfo->ModificationTime.Month;
NewLastWriteSystemTime.wDay = NewFileInfo->ModificationTime.Day;
@@ -2760,6 +2777,13 @@ Reopen: ; goto Done;
}
+ if (!PrivateFile->WinNtThunk->LocalFileTimeToFileTime (
+ &NewLastWriteFileTime,
+ &NewLastWriteFileTime
+ )) {
+ goto Done;
+ }
+
if (!PrivateFile->WinNtThunk->SetFileTime (
PrivateFile->IsDirectoryPath ? PrivateFile->DirHandle : PrivateFile->LHandle,
&NewCreationFileTime,
|