3 This file contains the keyboard processing code to the HII database.
5 Copyright (c) 2006 - 2008, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #include "HiiDatabase.h"
18 #include "HiiHandle.h"
19 #include <Library/DebugLib.h>
21 CONST EFI_GUID gZeroGuid
= {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}};
22 CONST CHAR16 FrameworkReservedVarstoreName
[] = FRAMEWORK_RESERVED_VARSTORE_NAME
;
26 This function returns a list of the package handles of the
27 specified type that are currently active in the HII database. The
28 pseudo-type EFI_HII_PACKAGE_TYPE_ALL will cause all package
31 If HandleBufferLength is NULL, then ASSERT.
32 If HandleBuffer is NULL, the ASSERT.
33 If PackageType is EFI_HII_PACKAGE_TYPE_GUID and PackageGuid is
35 If PackageType is not EFI_HII_PACKAGE_TYPE_GUID and PackageGuid is not
39 @param PackageType Specifies the package type of the packages
40 to list or EFI_HII_PACKAGE_TYPE_ALL for
41 all packages to be listed.
43 @param PackageGuid If PackageType is
44 EFI_HII_PACKAGE_TYPE_GUID, then this is
45 the pointer to the GUID which must match
47 EFI_HII_PACKAGE_GUID_HEADER. Otherwise, it
50 @param HandleBufferLength On output, the length of the handle buffer
51 that is required for the handles found.
53 @param HandleBuffer On output, an array of EFI_HII_HANDLE instances returned.
54 The caller is responcible to free this pointer allocated.
56 @retval EFI_SUCCESS The matching handles are outputed successfully.
57 HandleBufferLength is updated with the actual length.
58 @retval EFI_OUT_OF_RESOURCES Not enough resource to complete the operation.
59 @retval EFI_NOT_FOUND No matching handle could not be found in database.
65 IN CONST EFI_GUID
*PackageGuid
,
66 IN OUT UINTN
*HandleBufferLength
,
67 OUT EFI_HII_HANDLE
**HandleBuffer
72 ASSERT (HandleBufferLength
!= NULL
);
73 ASSERT (HandleBuffer
!= NULL
);
75 *HandleBufferLength
= 0;
78 if (PackageType
== EFI_HII_PACKAGE_TYPE_GUID
) {
79 ASSERT (PackageGuid
!= NULL
);
81 ASSERT (PackageGuid
== NULL
);
84 Status
= mHiiDatabase
->ListPackageLists (
91 if (EFI_ERROR (Status
) && (Status
!= EFI_BUFFER_TOO_SMALL
)) {
93 // No packages is registered to UEFI HII Database, just return.
99 *HandleBuffer
= AllocateZeroPool (*HandleBufferLength
);
101 if (*HandleBuffer
== NULL
) {
102 return EFI_OUT_OF_RESOURCES
;
105 return mHiiDatabase
->ListPackageLists (
116 Exports the contents of one or all package lists in the HII database into a buffer.
118 If Handle is not NULL and not a valid EFI_HII_HANDLE registered in the database,
120 If PackageListHeader is NULL, then ASSERT.
121 If PackageListSize is NULL, then ASSERT.
123 @param Handle The HII Handle.
124 @param PackageListHeader A pointer to a buffer that will contain the results of
126 @param PackageListSize On output, the length of the buffer that is required for the exported data.
128 @retval EFI_SUCCESS Package exported.
130 @retval EFI_OUT_OF_RESOURCES Not enought memory to complete the operations.
136 IN EFI_HII_HANDLE Handle
,
137 OUT EFI_HII_PACKAGE_LIST_HEADER
**PackageListHeader
,
138 OUT UINTN
*PackageListSize
143 EFI_HII_PACKAGE_LIST_HEADER
*PackageListHdr
;
145 ASSERT (PackageListSize
!= NULL
);
146 ASSERT (PackageListHeader
!= NULL
);
149 PackageListHdr
= NULL
;
150 Status
= mHiiDatabase
->ExportPackageLists (
156 ASSERT_EFI_ERROR (Status
!= EFI_BUFFER_TOO_SMALL
);
158 if (Status
== EFI_BUFFER_TOO_SMALL
) {
159 PackageListHdr
= AllocateZeroPool (Size
);
161 if (PackageListHeader
== NULL
) {
162 return EFI_OUT_OF_RESOURCES
;
164 Status
= mHiiDatabase
->ExportPackageLists (
173 if (!EFI_ERROR (Status
)) {
174 *PackageListHeader
= PackageListHdr
;
175 *PackageListSize
= Size
;
177 FreePool (PackageListHdr
);
184 Extract Hii package list GUID for given HII handle.
186 If HiiHandle could not be found in the HII database, then ASSERT.
187 If Guid is NULL, then ASSERT.
189 @param Handle Hii handle
190 @param Guid Package list GUID
192 @retval EFI_SUCCESS Successfully extract GUID from Hii database.
197 ExtractGuidFromHiiHandle (
198 IN EFI_HII_HANDLE Handle
,
204 EFI_HII_PACKAGE_LIST_HEADER
*HiiPackageList
;
206 ASSERT (Guid
!= NULL
);
207 ASSERT (Handle
!= NULL
);
210 // Get HII PackageList
213 HiiPackageList
= NULL
;
215 Status
= mHiiDatabase
->ExportPackageLists (mHiiDatabase
, Handle
, &BufferSize
, HiiPackageList
);
216 ASSERT (Status
!= EFI_NOT_FOUND
);
218 if (Status
== EFI_BUFFER_TOO_SMALL
) {
219 HiiPackageList
= AllocatePool (BufferSize
);
220 ASSERT (HiiPackageList
!= NULL
);
222 Status
= mHiiDatabase
->ExportPackageLists (mHiiDatabase
, Handle
, &BufferSize
, HiiPackageList
);
224 if (EFI_ERROR (Status
)) {
225 FreePool (HiiPackageList
);
232 CopyGuid (Guid
, &HiiPackageList
->PackageListGuid
);
234 FreePool (HiiPackageList
);
240 Find the corressponding UEFI HII Handle from a Framework HII Handle given.
242 @param Private The HII Thunk Module Private context.
243 @param FwHiiHandle The Framemwork HII Handle.
245 @return NULL If Framework HII Handle is invalid.
246 @return The corresponding UEFI HII Handle.
249 FwHiiHandleToUefiHiiHandle (
250 IN CONST HII_THUNK_PRIVATE_DATA
*Private
,
251 IN FRAMEWORK_EFI_HII_HANDLE FwHiiHandle
254 HII_THUNK_CONTEXT
*ThunkContext
;
256 ASSERT (FwHiiHandle
!= (FRAMEWORK_EFI_HII_HANDLE
) 0);
257 ASSERT (Private
!= NULL
);
259 ThunkContext
= FwHiiHandleToThunkContext (Private
, FwHiiHandle
);
261 if (ThunkContext
!= NULL
) {
262 return ThunkContext
->UefiHiiHandle
;
265 return (EFI_HII_HANDLE
) NULL
;
270 Find the corressponding HII Thunk Context from a Framework HII Handle given.
272 @param Private The HII Thunk Module Private context.
273 @param FwHiiHandle The Framemwork HII Handle.
275 @return NULL If Framework HII Handle is invalid.
276 @return The corresponding HII Thunk Context.
279 FwHiiHandleToThunkContext (
280 IN CONST HII_THUNK_PRIVATE_DATA
*Private
,
281 IN FRAMEWORK_EFI_HII_HANDLE FwHiiHandle
285 HII_THUNK_CONTEXT
*ThunkContext
;
288 Link
= GetFirstNode (&Private
->ThunkContextListHead
);
290 while (!IsNull (&Private
->ThunkContextListHead
, Link
)) {
291 ThunkContext
= HII_THUNK_CONTEXT_FROM_LINK (Link
);
293 if (FwHiiHandle
== ThunkContext
->FwHiiHandle
) {
297 Link
= GetNextNode (&Private
->ThunkContextListHead
, Link
);
304 Find the corressponding HII Thunk Context from a UEFI HII Handle given.
306 @param Private The HII Thunk Module Private context.
307 @param UEFIHiiHandle The UEFI HII Handle.
309 @return NULL If UEFI HII Handle is invalid.
310 @return The corresponding HII Thunk Context.
313 UefiHiiHandleToThunkContext (
314 IN CONST HII_THUNK_PRIVATE_DATA
*Private
,
315 IN EFI_HII_HANDLE UefiHiiHandle
319 HII_THUNK_CONTEXT
*ThunkContext
;
321 Link
= GetFirstNode (&Private
->ThunkContextListHead
);
323 while (!IsNull (&Private
->ThunkContextListHead
, Link
)) {
324 ThunkContext
= HII_THUNK_CONTEXT_FROM_LINK (Link
);
326 if (UefiHiiHandle
== ThunkContext
->UefiHiiHandle
) {
329 Link
= GetNextNode (&Private
->ThunkContextListHead
, Link
);
336 Find the corressponding HII Thunk Context from a Tag GUID.
338 @param Private The HII Thunk Module Private context.
339 @param Guid The Tag GUID.
341 @return NULL No HII Thunk Context matched the Tag GUID.
342 @return The corresponding HII Thunk Context.
345 TagGuidToIfrPackThunkContext (
346 IN CONST HII_THUNK_PRIVATE_DATA
*Private
,
347 IN CONST EFI_GUID
*Guid
351 HII_THUNK_CONTEXT
*ThunkContext
;
353 Link
= GetFirstNode (&Private
->ThunkContextListHead
);
355 while (!IsNull (&Private
->ThunkContextListHead
, Link
)) {
356 ThunkContext
= HII_THUNK_CONTEXT_FROM_LINK (Link
);
358 if (CompareGuid (Guid
, &ThunkContext
->TagGuid
) && (ThunkContext
->IfrPackageCount
!= 0)) {
362 Link
= GetNextNode (&Private
->ThunkContextListHead
, Link
);
370 Clean up the HII Thunk Context for a UEFI HII Handle.
372 @param Private The HII Thunk Module Private context.
373 @param UEFIHiiHandle The UEFI HII Handle.
377 DestroyThunkContextForUefiHiiHandle (
378 IN HII_THUNK_PRIVATE_DATA
*Private
,
379 IN EFI_HII_HANDLE UefiHiiHandle
382 HII_THUNK_CONTEXT
*ThunkContext
;
384 ThunkContext
= UefiHiiHandleToThunkContext (Private
, UefiHiiHandle
);
385 ASSERT (ThunkContext
!= NULL
);
387 DestroyThunkContext (ThunkContext
);
392 This function create a HII_THUNK_CONTEXT for a package list registered
393 by a module calling EFI_HII_DATABASE_PROTOCOL.NewPackageList. It records
394 the PackageListGuid in EFI_HII_PACKAGE_LIST_HEADER in the TagGuid in
395 HII_THUNK_CONTEXT created. This TagGuid will be used as a key to s
399 CreateThunkContextForUefiHiiHandle (
400 IN EFI_HII_HANDLE UefiHiiHandle
404 EFI_GUID PackageGuid
;
405 HII_THUNK_CONTEXT
*ThunkContext
;
407 ThunkContext
= AllocateZeroPool (sizeof (*ThunkContext
));
408 ASSERT (ThunkContext
!= NULL
);
410 ThunkContext
->Signature
= HII_THUNK_CONTEXT_SIGNATURE
;
412 Status
= AllocateHiiHandle (&ThunkContext
->FwHiiHandle
);
413 if (EFI_ERROR (Status
)) {
417 ThunkContext
->UefiHiiHandle
= UefiHiiHandle
;
419 Status
= ExtractGuidFromHiiHandle (UefiHiiHandle
, &PackageGuid
);
420 ASSERT_EFI_ERROR (Status
);
422 CopyGuid(&ThunkContext
->TagGuid
, &PackageGuid
);
429 Get the number of HII Package for a Package type.
431 @param PackageListHeader The Package List.
432 @param PackageType The Package Type.
434 @return The number of Package for given type.
437 GetPackageCountByType (
438 IN CONST EFI_HII_PACKAGE_LIST_HEADER
*PackageListHeader
,
443 EFI_HII_PACKAGE_HEADER
*PackageHeader
;
445 PackageHeader
= (EFI_HII_PACKAGE_HEADER
*) ((UINT8
*) PackageListHeader
+ sizeof (EFI_HII_PACKAGE_LIST_HEADER
));
448 while (PackageHeader
->Type
!= EFI_HII_PACKAGE_END
) {
449 if (PackageHeader
->Type
== PackageType
) {
452 PackageHeader
= (EFI_HII_PACKAGE_HEADER
*) ((UINT8
*) PackageHeader
+ PackageHeader
->Length
);
460 Get the Form Package from a Framework Package List.
462 @param Packages Framework Package List.
464 @return The Form Package Header found.
466 EFI_HII_PACKAGE_HEADER
*
468 IN CONST EFI_HII_PACKAGES
*Packages
472 TIANO_AUTOGEN_PACKAGES_HEADER
**TianoAutogenPackageHdrArray
;
474 ASSERT (Packages
!= NULL
);
476 TianoAutogenPackageHdrArray
= (TIANO_AUTOGEN_PACKAGES_HEADER
**) (((UINT8
*) &Packages
->GuidId
) + sizeof (Packages
->GuidId
));
478 for (Index
= 0; Index
< Packages
->NumberOfPackages
; Index
++) {
480 // The current UEFI HII build tool generate a binary in the format defined by
481 // TIANO_AUTOGEN_PACKAGES_HEADER. We assume that all packages generated in
482 // this binary is with same package type. So the returned IfrPackageCount and StringPackageCount
483 // may not be the exact number of valid package number in the binary generated
484 // by HII Build tool.
486 switch (TianoAutogenPackageHdrArray
[Index
]->FrameworkPackageHeader
.Type
) {
488 return &TianoAutogenPackageHdrArray
[Index
]->PackageHeader
;
507 ASSERT if no FormSet Opcode is found.
509 @param Packages Form Framework Package.
510 @param FormSetGuid Return the FormSet Guid.
515 IN EFI_HII_PACKAGE_HEADER
*Package
,
516 OUT EFI_GUID
*FormSetGuid
520 EFI_IFR_OP_HEADER
*OpCode
;
521 EFI_IFR_FORM_SET
*FormSet
;
523 Offset
= sizeof (EFI_HII_PACKAGE_HEADER
);
524 while (Offset
< Package
->Length
) {
525 OpCode
= (EFI_IFR_OP_HEADER
*)((UINT8
*) Package
+ Offset
);
527 switch (OpCode
->OpCode
) {
528 case EFI_IFR_FORM_SET_OP
:
529 FormSet
= (EFI_IFR_FORM_SET
*) OpCode
;
530 CopyGuid (FormSetGuid
, (EFI_GUID
*)(VOID
*)&FormSet
->Guid
);
537 Offset
+= OpCode
->Length
;
541 // A proper IFR must have a formset opcode.
548 Creat a Thunk Context.
550 ASSERT if no FormSet Opcode is found.
552 @param Private The HII Thunk Private Context.
553 @param StringPackageCount The String package count.
554 @param FormSetGuid The IFR Package count.
556 @return A newly created Thunk Context.
557 @retval NULL No resource to create a new Thunk Context.
561 IN HII_THUNK_PRIVATE_DATA
*Private
,
562 IN UINTN StringPackageCount
,
563 IN UINTN IfrPackageCount
567 HII_THUNK_CONTEXT
*ThunkContext
;
569 ThunkContext
= AllocateZeroPool (sizeof (HII_THUNK_CONTEXT
));
570 ASSERT (ThunkContext
!= NULL
);
572 ThunkContext
->Signature
= HII_THUNK_CONTEXT_SIGNATURE
;
573 ThunkContext
->IfrPackageCount
= IfrPackageCount
;
574 ThunkContext
->StringPackageCount
= StringPackageCount
;
575 Status
= AllocateHiiHandle (&ThunkContext
->FwHiiHandle
);
576 if (EFI_ERROR (Status
)) {
585 Destroy the Thunk Context and free up all resource.
587 @param ThunkContext The HII Thunk Private Context to be freed.
591 DestroyThunkContext (
592 IN HII_THUNK_CONTEXT
*ThunkContext
595 ASSERT (ThunkContext
!= NULL
);
597 FreeHiiHandle (ThunkContext
->FwHiiHandle
);
599 RemoveEntryList (&ThunkContext
->Link
);
601 if (ThunkContext
->FormSet
!= NULL
) {
602 DestroyFormSet (ThunkContext
->FormSet
);
605 FreePool (ThunkContext
);
609 Get the FormSet's Default Varstore ID based on the rule (Descending Priority):
611 1) If VarStore ID of FRAMEWORK_RESERVED_VARSTORE_ID (0x01) is found, Var Store ID is used.
612 2) If VarStore ID of FRAMEWORK_RESERVED_VARSTORE_ID is not found, First Var Store ID is used
613 as the default Var Store ID.
615 @param FormSet The Form Set. The Default Varstore ID is updated if found.
619 GetFormsetDefaultVarstoreId (
620 IN OUT FORM_BROWSER_FORMSET
* FormSet
623 LIST_ENTRY
*StorageList
;
624 FORMSET_STORAGE
*Storage
;
625 FORMSET_STORAGE
*DefaultStorage
;
628 // VarStoreId 0 is invalid in UEFI IFR.
630 DefaultStorage
= NULL
;
631 FormSet
->DefaultVarStoreId
= 0;
632 StorageList
= GetFirstNode (&FormSet
->StorageListHead
);
634 while (!IsNull (&FormSet
->StorageListHead
, StorageList
)) {
635 Storage
= FORMSET_STORAGE_FROM_LINK (StorageList
);
637 DEBUG ((EFI_D_INFO
, "FormSet %g: Found Varstore ID %x Name %s Size 0x%x\n", &FormSet
->Guid
, Storage
->VarStoreId
, Storage
->Name
, Storage
->Size
));
639 if (Storage
->VarStoreId
== FRAMEWORK_RESERVED_VARSTORE_ID
) {
641 // 1) If VarStore ID of FRAMEWORK_RESERVED_VARSTORE_ID (0x01) is found, Var Store ID is used.
643 FormSet
->DefaultVarStoreId
= FRAMEWORK_RESERVED_VARSTORE_ID
;
644 DefaultStorage
= Storage
;
648 StorageList
= GetNextNode (&FormSet
->StorageListHead
, StorageList
);
651 if (FormSet
->DefaultVarStoreId
!= FRAMEWORK_RESERVED_VARSTORE_ID
) {
654 // 2) If VarStore ID of FRAMEWORK_RESERVED_VARSTORE_ID is not found, First Var Store ID is used
655 // as the default Var Store ID.
657 StorageList
= GetFirstNode (&FormSet
->StorageListHead
);
658 if (!IsNull (&FormSet
->StorageListHead
, StorageList
)) {
659 Storage
= FORMSET_STORAGE_FROM_LINK (StorageList
);
660 FormSet
->DefaultVarStoreId
= Storage
->VarStoreId
;
661 DefaultStorage
= Storage
;
666 if (FormSet
->DefaultVarStoreId
== 0) {
667 DEBUG ((EFI_D_INFO
, "FormSet %g: No Varstore Found\n", &FormSet
->Guid
));
674 Fetch the Ifr binary data of a FormSet.
676 @param Handle PackageList Handle
677 @param FormSetGuid GUID of a formset. If not specified (NULL or zero
678 GUID), take the first FormSet found in package
680 @param BinaryLength The length of the FormSet IFR binary.
681 @param BinaryData The buffer designed to receive the FormSet.
683 @retval EFI_SUCCESS Buffer filled with the requested FormSet.
684 BufferLength was updated.
685 @retval EFI_INVALID_PARAMETER The handle is unknown.
686 @retval EFI_NOT_FOUND A form or FormSet on the requested handle cannot
687 be found with the requested FormId.
692 IN EFI_HII_HANDLE Handle
,
693 IN OUT EFI_GUID
*FormSetGuid
,
694 OUT UINTN
*BinaryLength
,
695 OUT UINT8
**BinaryData
699 EFI_HII_PACKAGE_LIST_HEADER
*HiiPackageList
;
705 BOOLEAN ReturnDefault
;
706 UINT32 PackageListLength
;
707 EFI_HII_PACKAGE_HEADER PackageHeader
;
711 ZeroMem (&PackageHeader
, sizeof (EFI_HII_PACKAGE_HEADER
));;
714 // if FormSetGuid is NULL or zero GUID, return first FormSet in the package list
716 if (FormSetGuid
== NULL
|| CompareGuid (FormSetGuid
, &gZeroGuid
)) {
717 ReturnDefault
= TRUE
;
719 ReturnDefault
= FALSE
;
723 // Get HII PackageList
726 HiiPackageList
= NULL
;
727 Status
= mHiiDatabase
->ExportPackageLists (mHiiDatabase
, Handle
, &BufferSize
, HiiPackageList
);
728 if (Status
== EFI_BUFFER_TOO_SMALL
) {
729 HiiPackageList
= AllocatePool (BufferSize
);
730 ASSERT (HiiPackageList
!= NULL
);
732 Status
= mHiiDatabase
->ExportPackageLists (mHiiDatabase
, Handle
, &BufferSize
, HiiPackageList
);
734 if (EFI_ERROR (Status
)) {
739 // Get Form package from this HII package List
741 Offset
= sizeof (EFI_HII_PACKAGE_LIST_HEADER
);
743 CopyMem (&PackageListLength
, &HiiPackageList
->PackageLength
, sizeof (UINT32
));
745 while (Offset
< PackageListLength
) {
746 Package
= ((UINT8
*) HiiPackageList
) + Offset
;
747 CopyMem (&PackageHeader
, Package
, sizeof (EFI_HII_PACKAGE_HEADER
));
749 if (PackageHeader
.Type
== EFI_HII_PACKAGE_FORMS
) {
751 // Search FormSet in this Form Package
753 Offset2
= sizeof (EFI_HII_PACKAGE_HEADER
);
754 while (Offset2
< PackageHeader
.Length
) {
755 OpCodeData
= Package
+ Offset2
;
757 if (((EFI_IFR_OP_HEADER
*) OpCodeData
)->OpCode
== EFI_IFR_FORM_SET_OP
) {
759 // Check whether return default FormSet
766 // FormSet GUID is specified, check it
768 if (CompareGuid (FormSetGuid
, (EFI_GUID
*)(OpCodeData
+ sizeof (EFI_IFR_OP_HEADER
)))) {
773 Offset2
+= ((EFI_IFR_OP_HEADER
*) OpCodeData
)->Length
;
776 if (Offset2
< PackageHeader
.Length
) {
778 // Target formset found
784 Offset
+= PackageHeader
.Length
;
787 if (Offset
>= PackageListLength
) {
789 // Form package not found in this Package List
791 gBS
->FreePool (HiiPackageList
);
792 return EFI_NOT_FOUND
;
795 if (ReturnDefault
&& FormSetGuid
!= NULL
) {
797 // Return the default FormSet GUID
799 CopyMem (FormSetGuid
, &((EFI_IFR_FORM_SET
*) OpCodeData
)->Guid
, sizeof (EFI_GUID
));
803 // To determine the length of a whole FormSet IFR binary, one have to parse all the Opcodes
804 // in this FormSet; So, here just simply copy the data from start of a FormSet to the end
805 // of the Form Package.
807 *BinaryLength
= PackageHeader
.Length
- Offset2
;
808 *BinaryData
= AllocateCopyPool (*BinaryLength
, OpCodeData
);
810 gBS
->FreePool (HiiPackageList
);
812 if (*BinaryData
== NULL
) {
813 return EFI_OUT_OF_RESOURCES
;
820 Initialize the internal data structure of a FormSet.
822 @param Handle PackageList Handle
823 @param FormSetGuid GUID of a formset. If not specified (NULL or zero
824 GUID), take the first FormSet found in package
826 @param FormSet FormSet data structure.
828 @retval EFI_SUCCESS The function completed successfully.
829 @retval EFI_NOT_FOUND The specified FormSet could not be found.
834 IN EFI_HII_HANDLE Handle
,
835 IN OUT EFI_GUID
*FormSetGuid
,
836 OUT FORM_BROWSER_FORMSET
*FormSet
841 Status
= GetIfrBinaryData (Handle
, FormSetGuid
, &FormSet
->IfrBinaryLength
, &FormSet
->IfrBinaryData
);
842 if (EFI_ERROR (Status
)) {
846 FormSet
->HiiHandle
= Handle
;
847 CopyMem (&FormSet
->Guid
, FormSetGuid
, sizeof (EFI_GUID
));
850 // Parse the IFR binary OpCodes
852 Status
= ParseOpCodes (FormSet
);
853 if (EFI_ERROR (Status
)) {
857 GetFormsetDefaultVarstoreId (FormSet
);
862 Parse the Form Package and build a FORM_BROWSER_FORMSET structure.
864 @param UefiHiiHandle PackageList Handle
866 @return A pointer to FORM_BROWSER_FORMSET.
869 FORM_BROWSER_FORMSET
*
871 IN EFI_HII_HANDLE UefiHiiHandle
874 FORM_BROWSER_FORMSET
*FormSet
;
875 EFI_GUID FormSetGuid
;
878 FormSet
= AllocateZeroPool (sizeof (FORM_BROWSER_FORMSET
));
879 ASSERT (FormSet
!= NULL
);
881 CopyGuid (&FormSetGuid
, &gZeroGuid
);
882 Status
= InitializeFormSet (UefiHiiHandle
, &FormSetGuid
, FormSet
);
883 if (EFI_ERROR (Status
)) {