mirror of https://github.com/acidanthera/audk.git
ShellPkg: Move mHandleParsingHiiHandle init out of the constructor
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chris Phillips <chrisp@hp.com> Signed-off-by: Eugene Cohen <eugene@hp.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15841 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
deb21fd0ea
commit
e7e0e42bac
|
@ -16,7 +16,7 @@
|
|||
#include "UefiHandleParsingLib.h"
|
||||
#include "IndustryStandard/Acpi10.h"
|
||||
|
||||
EFI_HANDLE mHandleParsingHiiHandle;
|
||||
EFI_HANDLE mHandleParsingHiiHandle = NULL;
|
||||
HANDLE_INDEX_LIST mHandleList = {{{NULL,NULL},0,0},0};
|
||||
GUID_INFO_BLOCK *GuidList;
|
||||
UINTN GuidListCount;
|
||||
|
@ -102,14 +102,25 @@ HandleParsingLibConstructor (
|
|||
GuidListCount = 0;
|
||||
GuidList = NULL;
|
||||
|
||||
mHandleParsingHiiHandle = HiiAddPackages (&gHandleParsingHiiGuid, gImageHandle, UefiHandleParsingLibStrings, NULL);
|
||||
if (mHandleParsingHiiHandle == NULL) {
|
||||
return (EFI_DEVICE_ERROR);
|
||||
}
|
||||
|
||||
//
|
||||
// Do nothing with mHandleParsingHiiHandle. Initialize HII as needed.
|
||||
//
|
||||
return (EFI_SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
Initialization function for HII packages.
|
||||
|
||||
**/
|
||||
VOID
|
||||
HandleParsingHiiInit (VOID)
|
||||
{
|
||||
if (mHandleParsingHiiHandle == NULL) {
|
||||
mHandleParsingHiiHandle = HiiAddPackages (&gHandleParsingHiiGuid, gImageHandle, UefiHandleParsingLibStrings, NULL);
|
||||
ASSERT (mHandleParsingHiiHandle != NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Destructor for the library. free any resources.
|
||||
|
||||
|
@ -166,6 +177,8 @@ LoadedImageProtocolDumpInformation(
|
|||
return (CatSPrint(NULL, L"LoadedImage"));
|
||||
}
|
||||
|
||||
HandleParsingHiiInit();
|
||||
|
||||
Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_LI_DUMP_MAIN), NULL);
|
||||
RetVal = AllocateZeroPool (PcdGet16 (PcdShellPrintBufferSize));
|
||||
if (Temp == NULL || RetVal == NULL) {
|
||||
|
@ -242,6 +255,8 @@ GraphicsOutputProtocolDumpInformation(
|
|||
return (CatSPrint(NULL, L"GraphicsOutput"));
|
||||
}
|
||||
|
||||
HandleParsingHiiInit();
|
||||
|
||||
Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_GOP_DUMP_MAIN), NULL);
|
||||
RetVal = AllocateZeroPool (PcdGet16 (PcdShellPrintBufferSize));
|
||||
if (Temp == NULL || RetVal == NULL) {
|
||||
|
@ -322,6 +337,8 @@ PciRootBridgeIoDumpInformation(
|
|||
return (CatSPrint(NULL, L"PciRootBridgeIo"));
|
||||
}
|
||||
|
||||
HandleParsingHiiInit();
|
||||
|
||||
Status = gBS->HandleProtocol(
|
||||
TheHandle,
|
||||
&gEfiPciRootBridgeIoProtocolGuid,
|
||||
|
@ -445,6 +462,8 @@ TxtOutProtocolDumpInformation(
|
|||
return (NULL);
|
||||
}
|
||||
|
||||
HandleParsingHiiInit();
|
||||
|
||||
RetVal = NULL;
|
||||
Size = 0;
|
||||
|
||||
|
@ -883,6 +902,8 @@ AddNewGuidNameMapping(
|
|||
CONST GUID_INFO_BLOCK *Temp;
|
||||
EFI_STRING_ID NameID;
|
||||
|
||||
HandleParsingHiiInit();
|
||||
|
||||
if (Guid == NULL || TheName == NULL){
|
||||
return (EFI_INVALID_PARAMETER);
|
||||
}
|
||||
|
@ -919,6 +940,8 @@ GetStringNameFromGuid(
|
|||
{
|
||||
CONST GUID_INFO_BLOCK *Id;
|
||||
|
||||
HandleParsingHiiInit();
|
||||
|
||||
Id = InternalShellGetNodeFromGuid(Guid);
|
||||
return (HiiGetString(mHandleParsingHiiHandle, Id==NULL?STRING_TOKEN(STR_UNKNOWN_DEVICE):Id->StringId, Lang));
|
||||
}
|
||||
|
@ -986,6 +1009,8 @@ GetGuidFromStringName(
|
|||
CHAR16 *String;
|
||||
UINTN LoopCount;
|
||||
|
||||
HandleParsingHiiInit();
|
||||
|
||||
ASSERT(Guid != NULL);
|
||||
if (Guid == NULL) {
|
||||
return (EFI_INVALID_PARAMETER);
|
||||
|
|
Loading…
Reference in New Issue