ShellPkg/HandleParsingLib: Open LoadedImageProtocol first

This patch changes the order of operations to make sure we can open the
LoadedImageProtocol before getting the format string. This should not
affect functionality, and makes the next patch easier to review.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Westfahl <jeff.westfahl@ni.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
This commit is contained in:
Jeff Westfahl 2017-05-05 05:53:03 +08:00 committed by Ruiyu Ni
parent c15323ae2e
commit bbb212afa0
1 changed files with 7 additions and 8 deletions

View File

@ -177,13 +177,6 @@ LoadedImageProtocolDumpInformation(
return (CatSPrint(NULL, L"LoadedImage")); return (CatSPrint(NULL, L"LoadedImage"));
} }
HandleParsingHiiInit();
Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_LI_DUMP_MAIN), NULL);
if (Temp == NULL) {
return NULL;
}
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
TheHandle, TheHandle,
&gEfiLoadedImageProtocolGuid, &gEfiLoadedImageProtocolGuid,
@ -194,7 +187,13 @@ LoadedImageProtocolDumpInformation(
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
SHELL_FREE_NON_NULL (Temp); return NULL;
}
HandleParsingHiiInit();
Temp = HiiGetString(mHandleParsingHiiHandle, STRING_TOKEN(STR_LI_DUMP_MAIN), NULL);
if (Temp == NULL) {
return NULL; return NULL;
} }