mirror of https://github.com/acidanthera/audk.git
Fixed update file time error problem.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10913 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
e0919a5856
commit
f515069c19
|
@ -1,6 +1,6 @@
|
||||||
/**@file
|
/**@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
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -676,6 +676,15 @@ BOOL
|
||||||
CONST SYSTEMTIME *SystemTime
|
CONST SYSTEMTIME *SystemTime
|
||||||
);
|
);
|
||||||
|
|
||||||
|
typedef
|
||||||
|
WINBASEAPI
|
||||||
|
BOOL
|
||||||
|
(WINAPI *WinNtLocalFileTimeToFileTime) (
|
||||||
|
CONST FILETIME *LocalFileTime,
|
||||||
|
LPFILETIME FileTime
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
typedef
|
typedef
|
||||||
WINBASEAPI
|
WINBASEAPI
|
||||||
BOOL
|
BOOL
|
||||||
|
@ -1197,6 +1206,7 @@ typedef struct {
|
||||||
//
|
//
|
||||||
// Win32 Time APIs
|
// Win32 Time APIs
|
||||||
//
|
//
|
||||||
|
WinNtLocalFileTimeToFileTime LocalFileTimeToFileTime;
|
||||||
WinNtFileTimeToLocalFileTime FileTimeToLocalFileTime;
|
WinNtFileTimeToLocalFileTime FileTimeToLocalFileTime;
|
||||||
WinNtFileTimeToSystemTime FileTimeToSystemTime;
|
WinNtFileTimeToSystemTime FileTimeToSystemTime;
|
||||||
WinNtGetSystemTime GetSystemTime;
|
WinNtGetSystemTime GetSystemTime;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/**@file
|
/**@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
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
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,
|
MoveFile,
|
||||||
SetFileTime,
|
SetFileTime,
|
||||||
SystemTimeToFileTime,
|
SystemTimeToFileTime,
|
||||||
|
LocalFileTimeToFileTime,
|
||||||
FileTimeToLocalFileTime,
|
FileTimeToLocalFileTime,
|
||||||
FileTimeToSystemTime,
|
FileTimeToSystemTime,
|
||||||
GetSystemTime,
|
GetSystemTime,
|
||||||
|
|
|
@ -1995,6 +1995,7 @@ Returns:
|
||||||
Info->FileSize = FileInfo.nFileSizeLow;
|
Info->FileSize = FileInfo.nFileSizeLow;
|
||||||
Info->PhysicalSize = Info->FileSize;
|
Info->PhysicalSize = Info->FileSize;
|
||||||
|
|
||||||
|
PrivateFile->WinNtThunk->FileTimeToLocalFileTime(&FileInfo.ftCreationTime, &FileInfo.ftCreationTime);
|
||||||
PrivateFile->WinNtThunk->FileTimeToSystemTime (&FileInfo.ftCreationTime, &SystemTime);
|
PrivateFile->WinNtThunk->FileTimeToSystemTime (&FileInfo.ftCreationTime, &SystemTime);
|
||||||
Info->CreateTime.Year = SystemTime.wYear;
|
Info->CreateTime.Year = SystemTime.wYear;
|
||||||
Info->CreateTime.Month = (UINT8) SystemTime.wMonth;
|
Info->CreateTime.Month = (UINT8) SystemTime.wMonth;
|
||||||
|
@ -2003,6 +2004,7 @@ Returns:
|
||||||
Info->CreateTime.Minute = (UINT8) SystemTime.wMinute;
|
Info->CreateTime.Minute = (UINT8) SystemTime.wMinute;
|
||||||
Info->CreateTime.Second = (UINT8) SystemTime.wSecond;
|
Info->CreateTime.Second = (UINT8) SystemTime.wSecond;
|
||||||
|
|
||||||
|
PrivateFile->WinNtThunk->FileTimeToLocalFileTime(&FileInfo.ftLastAccessTime, &FileInfo.ftLastAccessTime);
|
||||||
PrivateFile->WinNtThunk->FileTimeToSystemTime (&FileInfo.ftLastAccessTime, &SystemTime);
|
PrivateFile->WinNtThunk->FileTimeToSystemTime (&FileInfo.ftLastAccessTime, &SystemTime);
|
||||||
Info->LastAccessTime.Year = SystemTime.wYear;
|
Info->LastAccessTime.Year = SystemTime.wYear;
|
||||||
Info->LastAccessTime.Month = (UINT8) SystemTime.wMonth;
|
Info->LastAccessTime.Month = (UINT8) SystemTime.wMonth;
|
||||||
|
@ -2011,6 +2013,7 @@ Returns:
|
||||||
Info->LastAccessTime.Minute = (UINT8) SystemTime.wMinute;
|
Info->LastAccessTime.Minute = (UINT8) SystemTime.wMinute;
|
||||||
Info->LastAccessTime.Second = (UINT8) SystemTime.wSecond;
|
Info->LastAccessTime.Second = (UINT8) SystemTime.wSecond;
|
||||||
|
|
||||||
|
PrivateFile->WinNtThunk->FileTimeToLocalFileTime(&FileInfo.ftLastWriteTime, &FileInfo.ftLastWriteTime);
|
||||||
PrivateFile->WinNtThunk->FileTimeToSystemTime (&FileInfo.ftLastWriteTime, &SystemTime);
|
PrivateFile->WinNtThunk->FileTimeToSystemTime (&FileInfo.ftLastWriteTime, &SystemTime);
|
||||||
Info->ModificationTime.Year = SystemTime.wYear;
|
Info->ModificationTime.Year = SystemTime.wYear;
|
||||||
Info->ModificationTime.Month = (UINT8) SystemTime.wMonth;
|
Info->ModificationTime.Month = (UINT8) SystemTime.wMonth;
|
||||||
|
@ -2730,6 +2733,13 @@ Reopen: ;
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!PrivateFile->WinNtThunk->LocalFileTimeToFileTime (
|
||||||
|
&NewCreationFileTime,
|
||||||
|
&NewCreationFileTime
|
||||||
|
)) {
|
||||||
|
goto Done;
|
||||||
|
}
|
||||||
|
|
||||||
NewLastAccessSystemTime.wYear = NewFileInfo->LastAccessTime.Year;
|
NewLastAccessSystemTime.wYear = NewFileInfo->LastAccessTime.Year;
|
||||||
NewLastAccessSystemTime.wMonth = NewFileInfo->LastAccessTime.Month;
|
NewLastAccessSystemTime.wMonth = NewFileInfo->LastAccessTime.Month;
|
||||||
NewLastAccessSystemTime.wDay = NewFileInfo->LastAccessTime.Day;
|
NewLastAccessSystemTime.wDay = NewFileInfo->LastAccessTime.Day;
|
||||||
|
@ -2745,6 +2755,13 @@ Reopen: ;
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!PrivateFile->WinNtThunk->LocalFileTimeToFileTime (
|
||||||
|
&NewLastAccessFileTime,
|
||||||
|
&NewLastAccessFileTime
|
||||||
|
)) {
|
||||||
|
goto Done;
|
||||||
|
}
|
||||||
|
|
||||||
NewLastWriteSystemTime.wYear = NewFileInfo->ModificationTime.Year;
|
NewLastWriteSystemTime.wYear = NewFileInfo->ModificationTime.Year;
|
||||||
NewLastWriteSystemTime.wMonth = NewFileInfo->ModificationTime.Month;
|
NewLastWriteSystemTime.wMonth = NewFileInfo->ModificationTime.Month;
|
||||||
NewLastWriteSystemTime.wDay = NewFileInfo->ModificationTime.Day;
|
NewLastWriteSystemTime.wDay = NewFileInfo->ModificationTime.Day;
|
||||||
|
@ -2760,6 +2777,13 @@ Reopen: ;
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!PrivateFile->WinNtThunk->LocalFileTimeToFileTime (
|
||||||
|
&NewLastWriteFileTime,
|
||||||
|
&NewLastWriteFileTime
|
||||||
|
)) {
|
||||||
|
goto Done;
|
||||||
|
}
|
||||||
|
|
||||||
if (!PrivateFile->WinNtThunk->SetFileTime (
|
if (!PrivateFile->WinNtThunk->SetFileTime (
|
||||||
PrivateFile->IsDirectoryPath ? PrivateFile->DirHandle : PrivateFile->LHandle,
|
PrivateFile->IsDirectoryPath ? PrivateFile->DirHandle : PrivateFile->LHandle,
|
||||||
&NewCreationFileTime,
|
&NewCreationFileTime,
|
||||||
|
|
Loading…
Reference in New Issue