BDS code calls Hii->FindHandles() with hardcoded length.

New code provides function BdsLibGetHiiHandles() in generic BDS library, which detects actual necessary memory, allocates memory, and finds handles as output.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2216 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
xli24
2007-01-11 06:37:39 +00:00
parent c271c1326b
commit 0e7bfce8d0
10 changed files with 158 additions and 24 deletions

View File

@@ -201,6 +201,7 @@ Returns:
IfrOptionList = NULL;
VideoOption = NULL;
HiiHandles = NULL;
HandleBufferLength = 0;
//
@@ -268,8 +269,11 @@ Returns:
CreateSubTitleOpCode (STR_EMPTY_STRING, &UpdateData->Data);
Hii->UpdateForm (Hii, FPCallbackInfo.DevMgrHiiHandle, (EFI_FORM_LABEL) Count, TRUE, UpdateData);
HiiHandles = AllocateZeroPool (HandleBufferLength);
Hii->FindHandles (Hii, &HandleBufferLength, HiiHandles);
//
// Get all the Hii handles
//
Status = BdsLibGetHiiHandles (Hii, &HandleBufferLength, &HiiHandles);
ASSERT_EFI_ERROR (Status);
for (Index = 1, BufferSize = 0; Index < HandleBufferLength; Index++) {
//
@@ -487,6 +491,7 @@ Returns:
}
gBS->FreePool (UpdateData);
gBS->FreePool (HiiHandles);
return Status;
}