/** @file\r
Main file for DmpStore shell Debug1 function.\r
-\r
+ \r
+ (C) Copyright 2013-2014, Hewlett-Packard Development Company, L.P.\r
Copyright (c) 2005 - 2014, 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
StrnCatGrow (&RetString, &BufLen, L"+NV", 0);\r
}\r
if ((Atts & EFI_VARIABLE_RUNTIME_ACCESS) != 0) {\r
- StrnCatGrow (&RetString, &BufLen, L"+RS+BS", 0);\r
+ StrnCatGrow (&RetString, &BufLen, L"+RT+BS", 0);\r
} else if ((Atts & EFI_VARIABLE_BOOTSERVICE_ACCESS) != 0) {\r
StrnCatGrow (&RetString, &BufLen, L"+BS", 0);\r
}\r
FreePool (Buffer);\r
\r
if (!EFI_ERROR (Status) && \r
- (BufferSize != sizeof (NameSize) + sizeof (DataSize) + sizeof (*Guid) + sizeof (Attributes) + NameSize + DataSize)\r
+ (BufferSize != sizeof (NameSize) + sizeof (DataSize) + sizeof (*Guid) + sizeof (Attributes) + NameSize + DataSize + sizeof (UINT32))\r
) {\r
Status = EFI_DEVICE_ERROR;\r
}\r
FoundVarName = AllocateZeroPool (NameSize);\r
if (FoundVarName != NULL) {\r
if (PrevName != NULL) {\r
- StrCpy(FoundVarName, PrevName);\r
+ StrnCpy(FoundVarName, PrevName, NameSize/sizeof(CHAR16)-1);\r
}\r
\r
Status = gRT->GetNextVariableName (&NameSize, FoundVarName, &FoundVarGuid);\r
//\r
ShellStatus = CascadeProcessVariables(Name, Guid, Type, FileHandle, FoundVarName, FoundVarGuid, FoundOne);\r
\r
+ if (ShellGetExecutionBreakFlag() || (ShellStatus == SHELL_ABORTED)) {\r
+ SHELL_FREE_NON_NULL(FoundVarName);\r
+ return (SHELL_ABORTED);\r
+ }\r
+\r
//\r
// No matter what happened we process our own variable\r
// Only continue if Guid and VariableName are each either NULL or a match\r
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"-l or -s", L"-d");\r
ShellStatus = SHELL_INVALID_PARAMETER;\r
} else {\r
+ //\r
+ // Determine the GUID to search for based on -all and -guid parameters\r
+ //\r
if (!ShellCommandLineGetFlag(Package, L"-all")) {\r
GuidStr = ShellCommandLineGetValue(Package, L"-guid");\r
if (GuidStr != NULL) {\r
} else {\r
Guid = &gEfiGlobalVariableGuid;\r
}\r
- Name = ShellCommandLineGetRawValue(Package, 1);\r
} else {\r
- Name = NULL;\r
Guid = NULL;\r
}\r
+\r
+ //\r
+ // Get the Name of the variable to find\r
+ //\r
+ Name = ShellCommandLineGetRawValue(Package, 1);\r
+\r
if (ShellStatus == SHELL_SUCCESS) {\r
if (ShellCommandLineGetFlag(Package, L"-s")) {\r
Type = DmpStoreSave;\r