ShellPkg: Correct incorrect use of sizeof to use macro for EFI_FILE_INFO size.

Signed-off-by: jcarsey
Reviewed-by: niruiyu


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12740 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jcarsey 2011-11-18 17:02:36 +00:00
parent 901ba0e78d
commit 73c83c69c0
1 changed files with 3 additions and 3 deletions

View File

@ -324,13 +324,13 @@ ValidateAndMoveFiles(
// construct the new file info block
//
NewSize = StrSize(DestPath);
NewSize += StrSize(Node->FileName) + sizeof(EFI_FILE_INFO) + sizeof(CHAR16);
NewSize += StrSize(Node->FileName) + SIZE_OF_EFI_FILE_INFO + sizeof(CHAR16);
NewFileInfo = AllocateZeroPool(NewSize);
if (NewFileInfo == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_MEM), gShellLevel2HiiHandle);
ShellStatus = SHELL_OUT_OF_RESOURCES;
} else {
CopyMem(NewFileInfo, Node->Info, sizeof(EFI_FILE_INFO));
CopyMem(NewFileInfo, Node->Info, SIZE_OF_EFI_FILE_INFO);
if (DestPath[0] != L'\\') {
StrCpy(NewFileInfo->FileName, L"\\");
StrCat(NewFileInfo->FileName, DestPath);
@ -350,7 +350,7 @@ ValidateAndMoveFiles(
}
StrCat(NewFileInfo->FileName, Node->FileName);
}
NewFileInfo->Size = sizeof(EFI_FILE_INFO) + StrSize(NewFileInfo->FileName);
NewFileInfo->Size = SIZE_OF_EFI_FILE_INFO + StrSize(NewFileInfo->FileName);
ShellPrintEx(-1, -1, HiiOutput, Node->FullName, NewFileInfo->FileName);
if (!EFI_ERROR(ShellFileExists(NewFileInfo->FileName))) {