3 This file contains utility functions by HII Thunk Modules.
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.
16 #ifndef _HII_THUNK_UTILITY_H
17 #define _HII_THUNK_UTILITY_H
21 This function returns a list of the package handles of the
22 specified type that are currently active in the HII database. The
23 pseudo-type EFI_HII_PACKAGE_TYPE_ALL will cause all package
26 If HandleBufferLength is NULL, then ASSERT.
27 If HandleBuffer is NULL, the ASSERT.
28 If PackageType is EFI_HII_PACKAGE_TYPE_GUID and PackageGuid is
30 If PackageType is not EFI_HII_PACKAGE_TYPE_GUID and PackageGuid is not
34 @param PackageType Specifies the package type of the packages
35 to list or EFI_HII_PACKAGE_TYPE_ALL for
36 all packages to be listed.
38 @param PackageGuid If PackageType is
39 EFI_HII_PACKAGE_TYPE_GUID, then this is
40 the pointer to the GUID which must match
42 EFI_HII_PACKAGE_GUID_HEADER. Otherwise, it
45 @param HandleBufferLength On output, the length of the handle buffer
46 that is required for the handles found.
48 @param HandleBuffer On output, an array of EFI_HII_HANDLE instances returned.
49 The caller is responcible to free this pointer allocated.
51 @retval EFI_SUCCESS The matching handles are outputed successfully.
52 HandleBufferLength is updated with the actual length.
53 @retval EFI_OUT_OF_RESOURCES Not enough resource to complete the operation.
54 @retval EFI_NOT_FOUND No matching handle could not be found in database.
60 IN CONST EFI_GUID
*PackageGuid
,
61 IN OUT UINTN
*HandleBufferLength
,
62 OUT EFI_HII_HANDLE
**HandleBuffer
67 Exports the contents of one or all package lists in the HII database into a buffer.
69 If Handle is not NULL and not a valid EFI_HII_HANDLE registered in the database,
71 If PackageListHeader is NULL, then ASSERT.
72 If PackageListSize is NULL, then ASSERT.
74 @param Handle The HII Handle.
75 @param PackageListHeader A pointer to a buffer that will contain the results of
77 @param PackageListSize On output, the length of the buffer that is required for the exported data.
79 @retval EFI_SUCCESS Package exported.
81 @retval EFI_OUT_OF_RESOURCES Not enought memory to complete the operations.
87 IN EFI_HII_HANDLE Handle
,
88 OUT EFI_HII_PACKAGE_LIST_HEADER
**PackageListHeader
,
89 OUT UINTN
*PackageListSize
94 Extract Hii package list GUID for given HII handle.
96 If HiiHandle could not be found in the HII database, then ASSERT.
97 If Guid is NULL, then ASSERT.
99 @param Handle Hii handle
100 @param Guid Package list GUID
102 @retval EFI_SUCCESS Successfully extract GUID from Hii database.
107 ExtractGuidFromHiiHandle (
108 IN EFI_HII_HANDLE Handle
,
114 Find the UefiHiiHandle based on a Framework HII Handle returned by
115 the HII Thunk to Framework HII code.
117 @param Private The pointer to the private data of Hii Thunk.
118 @param FwHiiHandle Framework HII Handle returned by the HII Thunk to Framework HII code.
120 @retval NULL If Framework HII Handle passed in does not have matching UEFI HII handle.
121 @retval !NULL If the match is found.
125 FwHiiHandleToUefiHiiHandle (
126 IN CONST HII_THUNK_PRIVATE_DATA
*Private
,
127 IN FRAMEWORK_EFI_HII_HANDLE FwHiiHandle
131 FwHiiHandleToThunkContext (
132 IN CONST HII_THUNK_PRIVATE_DATA
*Private
,
133 IN FRAMEWORK_EFI_HII_HANDLE FwHiiHandle
137 UefiHiiHandleToThunkContext (
138 IN CONST HII_THUNK_PRIVATE_DATA
*Private
,
139 IN EFI_HII_HANDLE UefiHiiHandle
143 TagGuidToIfrPackThunkContext (
144 IN CONST HII_THUNK_PRIVATE_DATA
*Private
,
145 IN CONST EFI_GUID
*Guid
149 CreateThunkContextForUefiHiiHandle (
150 IN EFI_HII_HANDLE UefiHiiHandle
154 DestroyThunkContextForUefiHiiHandle (
155 IN HII_THUNK_PRIVATE_DATA
*Private
,
156 IN EFI_HII_HANDLE UefiHiiHandle
160 GetPackageCountByType (
161 IN CONST EFI_HII_PACKAGE_LIST_HEADER
*PackageListHeader
,
166 CreateQuestionIdMap (
167 IN OUT HII_THUNK_CONTEXT
*ThunkContext
171 GetAttributesOfFirstFormSet (
172 IN OUT HII_THUNK_CONTEXT
*ThunkContext
176 GetMapEntryListHead (
177 IN CONST HII_THUNK_CONTEXT
*ThunkContext
,
183 IN HII_THUNK_PRIVATE_DATA
*Private
,
184 IN UINTN StringPackageCount
,
185 IN UINTN IfrPackageCount
189 DestroyThunkContext (
190 IN HII_THUNK_CONTEXT
*ThunkContext
194 DestoryOneOfOptionMap (
195 IN LIST_ENTRY
*OneOfOptionMapListHead
200 IN EFI_HII_PACKAGE_HEADER
*Package
,
201 OUT EFI_GUID
*FormSetGuid
205 EFI_HII_PACKAGE_HEADER
*
207 IN CONST EFI_HII_PACKAGES
*Packages
211 FORM_BROWSER_FORMSET
*
213 IN EFI_HII_HANDLE UefiHiiHandle