From 8a32d3e4f5ddf41a38fc3c1446561aa3b8ffdc5e Mon Sep 17 00:00:00 2001 From: Konstantin Aladyshev Date: Thu, 31 Mar 2022 18:51:18 +0300 Subject: Add a formset arg to DisplayHIIByGuid Signed-off-by: Konstantin Aladyshev --- UefiLessonsPkg/DisplayHIIByGuid/DisplayHIIByGuid.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'UefiLessonsPkg/DisplayHIIByGuid') diff --git a/UefiLessonsPkg/DisplayHIIByGuid/DisplayHIIByGuid.c b/UefiLessonsPkg/DisplayHIIByGuid/DisplayHIIByGuid.c index 87e7efe..2bd715f 100644 --- a/UefiLessonsPkg/DisplayHIIByGuid/DisplayHIIByGuid.c +++ b/UefiLessonsPkg/DisplayHIIByGuid/DisplayHIIByGuid.c @@ -18,21 +18,29 @@ ShellAppMain ( IN CHAR16 **Argv ) { - if (Argc != 2) { + if ((Argc < 2) || (Argc > 3)) { Print(L"Usage:\n"); - Print(L" DisplayHIIByGuid \n"); + Print(L" DisplayHIIByGuid []\n"); return EFI_INVALID_PARAMETER; } - GUID Guid; - EFI_STATUS Status = StrToGuid(Argv[1], &Guid); + EFI_GUID PackageListGuid; + EFI_STATUS Status = StrToGuid(Argv[1], &PackageListGuid); if (Status != RETURN_SUCCESS) { - Print(L"Error! Can't convert input argument to GUID\n"); + Print(L"Error! Can't convert argument to GUID\n"); return EFI_INVALID_PARAMETER; } + EFI_GUID FormsetClassGuid = EFI_HII_PLATFORM_SETUP_FORMSET_GUID; + if (Argc == 3) { + Status = StrToGuid(Argv[2], &FormsetClassGuid); + if (Status != RETURN_SUCCESS) { + Print(L"Error! Can't convert argument to GUID\n"); + return EFI_INVALID_PARAMETER; + } + } - EFI_HII_HANDLE* HiiHandles = HiiGetHiiHandles(&Guid); + EFI_HII_HANDLE* HiiHandles = HiiGetHiiHandles(&PackageListGuid); EFI_HII_HANDLE* HiiHandle = HiiHandles; UINTN HandleCount=0; @@ -53,7 +61,7 @@ ShellAppMain ( FormBrowser2, HiiHandles, HandleCount, - NULL, + &FormsetClassGuid, 0, NULL, NULL -- cgit v1.2.3-18-g5258