Main file for DmpStore shell Debug1 function.\r
\r
(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>\r
- Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2005 - 2017, 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
/**\r
Convert binary to hex format string.\r
\r
- @param[in] BufferSize The size in bytes of the binary data.\r
@param[in] Buffer The binary data.\r
+ @param[in] BufferSize The size in bytes of the binary data.\r
@param[in, out] HexString Hex format string.\r
@param[in] HexStringSize The size in bytes of the string.\r
\r
//\r
// Crc32\r
//\r
- gBS->CalculateCrc32 (Buffer, (UINTN) (Ptr - Buffer), (UINT32 *) Ptr);\r
+ gBS->CalculateCrc32 (Buffer, (UINTN) Ptr - (UINTN) Buffer, (UINT32 *) Ptr);\r
\r
Status = ShellWriteFile (FileHandle, &BufferSize, Buffer);\r
FreePool (Buffer);\r
UINTN NameSize;\r
CHAR16 *AttrString;\r
CHAR16 *HexString;\r
+ EFI_STATUS SetStatus;\r
+ CONST CHAR16 *GuidName;\r
\r
if (ShellGetExecutionBreakFlag()) {\r
return (SHELL_ABORTED);\r
StrnCatGrow(&FoundVarName, &NameSize, PrevName, 0);\r
} else {\r
FoundVarName = AllocateZeroPool(sizeof(CHAR16));\r
+ NameSize = sizeof(CHAR16);\r
}\r
\r
Status = gRT->GetNextVariableName (&NameSize, FoundVarName, &FoundVarGuid);\r
Status = EFI_OUT_OF_RESOURCES;\r
}\r
} else {\r
- ShellPrintHiiEx (\r
- -1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_HEADER_LINE), gShellDebug1HiiHandle,\r
- AttrString, &FoundVarGuid, FoundVarName, DataSize\r
- );\r
+ Status = gEfiShellProtocol->GetGuidName(&FoundVarGuid, &GuidName);\r
+ if (EFI_ERROR (Status)) {\r
+ ShellPrintHiiEx (\r
+ -1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_HEADER_LINE), gShellDebug1HiiHandle,\r
+ AttrString, &FoundVarGuid, FoundVarName, DataSize\r
+ );\r
+ } else {\r
+ ShellPrintHiiEx (\r
+ -1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_HEADER_LINE2), gShellDebug1HiiHandle,\r
+ AttrString, GuidName, FoundVarName, DataSize\r
+ );\r
+ }\r
DumpHex (2, 0, DataSize, DataBuffer);\r
}\r
SHELL_FREE_NON_NULL (AttrString);\r
//\r
// We only need name to delete it...\r
//\r
- EFI_STATUS SetStatus = gRT->SetVariable (FoundVarName, &FoundVarGuid, Atts, 0, NULL);\r
+ SetStatus = gRT->SetVariable (FoundVarName, &FoundVarGuid, Atts, 0, NULL);\r
if (StandardFormatOutput) {\r
if (SetStatus == EFI_SUCCESS) {\r
ShellPrintHiiEx (\r
)\r
{\r
EFI_STATUS Status;\r
+ RETURN_STATUS RStatus;\r
LIST_ENTRY *Package;\r
CHAR16 *ProblemParam;\r
SHELL_STATUS ShellStatus;\r
if (!ShellCommandLineGetFlag(Package, L"-all")) {\r
GuidStr = ShellCommandLineGetValue(Package, L"-guid");\r
if (GuidStr != NULL) {\r
- Status = ConvertStringToGuid(GuidStr, &GuidData);\r
- if (EFI_ERROR(Status)) {\r
+ RStatus = StrToGuid (GuidStr, &GuidData);\r
+ if (RETURN_ERROR (RStatus) || (GuidStr[GUID_STRING_LENGTH] != L'\0')) {\r
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmpstore", GuidStr); \r
ShellStatus = SHELL_INVALID_PARAMETER;\r
}\r