summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Application
diff options
context:
space:
mode:
authorJiewen Yao <jiewen.yao@intel.com>2016-12-22 13:45:18 +0800
committerJiewen Yao <jiewen.yao@intel.com>2016-12-23 10:08:04 +0800
commitde5209d5db0b96c2a2c1572838e5fc1301f95aa9 (patch)
tree39d9e161b016da3d1561efd1baa572851cf6dc6d /MdeModulePkg/Application
parentd8487a34f0b931a007e64f02656d1f61882c317d (diff)
downloadedk2-de5209d5db0b96c2a2c1572838e5fc1301f95aa9.tar.gz
edk2-de5209d5db0b96c2a2c1572838e5fc1301f95aa9.tar.bz2
edk2-de5209d5db0b96c2a2c1572838e5fc1301f95aa9.zip
MdeModulePkg/CapsuleApp: Dump capsule name in record.
According to UEFI spec, capsule report variable should include a null terminator for capsule name and capsule target, if they are not present. Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'MdeModulePkg/Application')
-rw-r--r--MdeModulePkg/Application/CapsuleApp/CapsuleDump.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c
index 8f44e5e1ef..2bb5f1f02c 100644
--- a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c
+++ b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c
@@ -293,6 +293,8 @@ DmpCapsuleStatusVariable (
UINTN CapsuleFileNameSize;
CHAR16 CapsuleIndexData[12];
CHAR16 *CapsuleIndex;
+ CHAR16 *CapsuleFileName;
+ CHAR16 *CapsuleTarget;
Status = GetVariable2(
L"CapsuleMax",
@@ -353,19 +355,17 @@ DmpCapsuleStatusVariable (
}
if (CompareGuid(&CapsuleResult->CapsuleGuid, &gEfiFmpCapsuleGuid)) {
- if (CapsuleResult->VariableTotalSize >= sizeof(EFI_CAPSULE_RESULT_VARIABLE_HEADER) + sizeof(EFI_CAPSULE_RESULT_VARIABLE_FMP)) {
+ if (CapsuleResult->VariableTotalSize >= sizeof(EFI_CAPSULE_RESULT_VARIABLE_HEADER) + sizeof(EFI_CAPSULE_RESULT_VARIABLE_FMP) + sizeof(CHAR16) * 2) {
CapsuleResultFmp = (EFI_CAPSULE_RESULT_VARIABLE_FMP *)(CapsuleResult + 1);
Print(L" Capsule FMP Version: 0x%x\n", CapsuleResultFmp->Version);
Print(L" Capsule FMP PayloadIndex: 0x%x\n", CapsuleResultFmp->PayloadIndex);
Print(L" Capsule FMP UpdateImageIndex: 0x%x\n", CapsuleResultFmp->UpdateImageIndex);
Print(L" Capsule FMP UpdateImageTypeId: %g\n", &CapsuleResultFmp->UpdateImageTypeId);
- if (CapsuleResult->VariableTotalSize > sizeof(EFI_CAPSULE_RESULT_VARIABLE_HEADER) + sizeof(EFI_CAPSULE_RESULT_VARIABLE_FMP)) {
- Print(L" Capsule FMP CapsuleFileName: %s\n", (CapsuleResultFmp + 1));
- CapsuleFileNameSize = StrSize((CHAR16 *)(CapsuleResultFmp + 1));
- if (CapsuleResult->VariableTotalSize > sizeof(EFI_CAPSULE_RESULT_VARIABLE_HEADER) + sizeof(EFI_CAPSULE_RESULT_VARIABLE_FMP) + CapsuleFileNameSize) {
- Print(L" Capsule FMP CapsuleTarget: %s\n", (UINT8 *)(CapsuleResultFmp + 1) + CapsuleFileNameSize);
- }
- }
+ CapsuleFileName = (CHAR16 *)(CapsuleResultFmp + 1);
+ Print(L" Capsule FMP CapsuleFileName: \"%s\"\n", CapsuleFileName);
+ CapsuleFileNameSize = StrSize(CapsuleFileName);
+ CapsuleTarget = (CHAR16 *)((UINTN)CapsuleFileName + CapsuleFileNameSize);
+ Print(L" Capsule FMP CapsuleTarget: \"%s\"\n", CapsuleTarget);
}
}