summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>2009-11-05 08:53:47 +0000
committerrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>2009-11-05 08:53:47 +0000
commit7992c0b02d4bb4d166b118c63a38f98b7933bd97 (patch)
treef9a23b6f4377ea58e2b8d99717de0ac6b9d496bd /MdeModulePkg
parent44770e59103d2d6d2212c5e9db8fe1371d4a177c (diff)
downloadedk2-7992c0b02d4bb4d166b118c63a38f98b7933bd97.zip
edk2-7992c0b02d4bb4d166b118c63a38f98b7933bd97.tar.gz
edk2-7992c0b02d4bb4d166b118c63a38f98b7933bd97.tar.bz2
Change the behavior of the HII Library function HiiGetHiiHandles() when the PackageListGuid parameter is not NULL. The original behavior is that if this parameter is not NULL at most 1 HII Handle is returned. Behavior after change is if this parameter is not NULL zero or more HII Handles associated with PackageListGuid are returned, because it is possible that there are multiple package lists with same package list GUID in the HII Database.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9393 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Include/Library/HiiLib.h9
-rw-r--r--MdeModulePkg/Library/UefiHiiLib/HiiLib.c33
2 files changed, 24 insertions, 18 deletions
diff --git a/MdeModulePkg/Include/Library/HiiLib.h b/MdeModulePkg/Include/Library/HiiLib.h
index 91b7e4e..9a04032 100644
--- a/MdeModulePkg/Include/Library/HiiLib.h
+++ b/MdeModulePkg/Include/Library/HiiLib.h
@@ -198,18 +198,19 @@ HiiGetPackageString (
;
/**
- Retrieves the array of all the HII Handles or the HII handle of a specific
- package list in the HII Database.
+ Retrieves the array of all the HII Handles or the HII handles of a specific
+ package list GUID in the HII Database.
This array is terminated with a NULL HII Handle.
This function allocates the returned array using AllocatePool().
The caller is responsible for freeing the array with FreePool().
@param[in] PackageListGuid An optional parameter that is used to request
- an HII Handle associated with a specific
+ HII Handles associated with a specific
Package List GUID. If this parameter is NULL,
then all the HII Handles in the HII Database
are returned. If this parameter is not NULL,
- then at most 1 HII Handle is returned.
+ then zero or more HII Handles associated with
+ PackageListGuid are returned.
@retval NULL No HII handles were found in the HII database
@retval NULL The array of HII Handles could not be retrieved
diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
index f87ab82..2a42cd7 100644
--- a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
+++ b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
@@ -272,18 +272,19 @@ HiiRemovePackages (
/**
- Retrieves the array of all the HII Handles or the HII handle of a specific
- package list in the HII Database.
+ Retrieves the array of all the HII Handles or the HII handles of a specific
+ package list GUID in the HII Database.
This array is terminated with a NULL HII Handle.
This function allocates the returned array using AllocatePool().
The caller is responsible for freeing the array with FreePool().
@param[in] PackageListGuid An optional parameter that is used to request
- an HII Handle that is associatd with a specific
- Package List GUID. If this parameter is NULL
+ HII Handles associated with a specific
+ Package List GUID. If this parameter is NULL,
then all the HII Handles in the HII Database
- are returned. If this parameter is not NULL
- then at most 1 HII Handle is returned.
+ are returned. If this parameter is not NULL,
+ then zero or more HII Handles associated with
+ PackageListGuid are returned.
@retval NULL No HII handles were found in the HII database
@retval NULL The array of HII Handles could not be retrieved
@@ -301,7 +302,8 @@ HiiGetHiiHandles (
EFI_HII_HANDLE TempHiiHandleBuffer;
EFI_HII_HANDLE *HiiHandleBuffer;
EFI_GUID Guid;
- UINTN Index;
+ UINTN Index1;
+ UINTN Index2;
//
// Retrieve the size required for the buffer of all HII handles.
@@ -364,17 +366,20 @@ HiiGetHiiHandles (
//
return HiiHandleBuffer;
} else {
- for (Index = 0; HiiHandleBuffer[Index] != NULL; Index++) {
- Status = InternalHiiExtractGuidFromHiiHandle (HiiHandleBuffer[Index], &Guid);
+ for (Index1 = 0, Index2 = 0; HiiHandleBuffer[Index1] != NULL; Index1++) {
+ Status = InternalHiiExtractGuidFromHiiHandle (HiiHandleBuffer[Index1], &Guid);
ASSERT_EFI_ERROR (Status);
if (CompareGuid (&Guid, PackageListGuid)) {
- HiiHandleBuffer[0] = HiiHandleBuffer[Index];
- HiiHandleBuffer[1] = NULL;
- return HiiHandleBuffer;
+ HiiHandleBuffer[Index2++] = HiiHandleBuffer[Index1];
}
}
- FreePool (HiiHandleBuffer);
- return NULL;
+ if (Index2 > 0) {
+ HiiHandleBuffer[Index2] = NULL;
+ return HiiHandleBuffer;
+ } else {
+ FreePool (HiiHandleBuffer);
+ return NULL;
+ }
}
}