]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Include/Library/HiiLib.h
MdeModulePkg/ResetSystemRuntimeDxe: Add platform filter and handler
[mirror_edk2.git] / MdeModulePkg / Include / Library / HiiLib.h
CommitLineData
4c76e9cc 1/** @file\r
2 Public include file for the HII Library\r
3\r
e8654a1a 4Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
64a80549 5This program and the accompanying materials are licensed and made available under \r
6the terms and conditions of the BSD License that accompanies this distribution. \r
7The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php. \r
4c76e9cc 9\r
64a80549 10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
4c76e9cc 12\r
13**/\r
14\r
15#ifndef __HII_LIB_H__\r
16#define __HII_LIB_H__\r
17\r
33ae1b2d 18////////////////////////////////////////////////////////\r
19////////////////////////////////////////////////////////\r
20// HiiLib Functions\r
21////////////////////////////////////////////////////////\r
22////////////////////////////////////////////////////////\r
4c76e9cc 23\r
24/**\r
cb7d01c0 25 Registers a list of packages in the HII Database and returns the HII Handle\r
26 associated with that registration. If an HII Handle has already been registered\r
aa2614b7 27 with the same PackageListGuid and DeviceHandle, then NULL is returned. If there\r
28 are not enough resources to perform the registration, then NULL is returned.\r
29 If an empty list of packages is passed in, then NULL is returned. If the size of\r
30 the list of package is 0, then NULL is returned.\r
cb7d01c0 31\r
e9b67286 32 The variable arguments are pointers that point to package headers defined \r
cb7d01c0 33 by UEFI VFR compiler and StringGather tool.\r
34\r
35 #pragma pack (push, 1)\r
36 typedef struct {\r
37 UINT32 BinaryLength;\r
38 EFI_HII_PACKAGE_HEADER PackageHeader;\r
39 } EDKII_AUTOGEN_PACKAGES_HEADER;\r
40 #pragma pack (pop)\r
41 \r
42 @param[in] PackageListGuid The GUID of the package list.\r
43 @param[in] DeviceHandle If not NULL, the Device Handle on which \r
44 an instance of DEVICE_PATH_PROTOCOL is installed.\r
45 This Device Handle uniquely defines the device that \r
46 the added packages are associated with.\r
47 @param[in] ... The variable argument list that contains pointers \r
48 to packages terminated by a NULL.\r
49\r
64a80549 50 @retval NULL An HII Handle has already been registered in the HII Database with\r
9c6595dc 51 the same PackageListGuid and DeviceHandle.\r
cb7d01c0 52 @retval NULL The HII Handle could not be created.\r
53 @retval NULL An empty list of packages was passed in.\r
54 @retval NULL All packages are empty.\r
55 @retval Other The HII Handle associated with the newly registered package list.\r
4c76e9cc 56\r
57**/\r
cb7d01c0 58EFI_HII_HANDLE\r
4c76e9cc 59EFIAPI\r
cb7d01c0 60HiiAddPackages (\r
61 IN CONST EFI_GUID *PackageListGuid,\r
62 IN EFI_HANDLE DeviceHandle OPTIONAL,\r
4c76e9cc 63 ...\r
b9982883
LG
64 )\r
65;\r
4c76e9cc 66\r
67/**\r
cb7d01c0 68 Removes a package list from the HII database.\r
4c76e9cc 69\r
e9b67286 70 If HiiHandle is NULL, then ASSERT().\r
71 If HiiHandle is not a valid EFI_HII_HANDLE in the HII database, then ASSERT().\r
4c76e9cc 72\r
cb7d01c0 73 @param[in] HiiHandle The handle that was previously registered in the HII database\r
4c76e9cc 74\r
75**/\r
76VOID\r
77EFIAPI\r
cb7d01c0 78HiiRemovePackages (\r
4c76e9cc 79 IN EFI_HII_HANDLE HiiHandle\r
b9982883
LG
80 )\r
81;\r
4c76e9cc 82\r
83/**\r
e9b67286 84 This function creates a new string in String Package or updates an existing \r
cb7d01c0 85 string in a String Package. If StringId is 0, then a new string is added to\r
86 a String Package. If StringId is not zero, then a string in String Package is\r
87 updated. If SupportedLanguages is NULL, then the string is added or updated\r
88 for all the languages that the String Package supports. If SupportedLanguages\r
89 is not NULL, then the string is added or updated for the set of languages \r
90 specified by SupportedLanguages.\r
91 \r
92 If HiiHandle is NULL, then ASSERT().\r
93 If String is NULL, then ASSERT().\r
94\r
95 @param[in] HiiHandle A handle that was previously registered in the \r
96 HII Database.\r
97 @param[in] StringId If zero, then a new string is created in the \r
98 String Package associated with HiiHandle. If \r
99 non-zero, then the string specified by StringId \r
e9b67286 100 is updated in the String Package associated \r
cb7d01c0 101 with HiiHandle. \r
102 @param[in] String A pointer to the Null-terminated Unicode string \r
103 to add or update in the String Package associated \r
104 with HiiHandle.\r
105 @param[in] SupportedLanguages A pointer to a Null-terminated ASCII string of \r
106 language codes. If this parameter is NULL, then \r
107 String is added or updated in the String Package \r
108 associated with HiiHandle for all the languages \r
109 that the String Package supports. If this \r
e9b67286 110 parameter is not NULL, then String is added \r
cb7d01c0 111 or updated in the String Package associated with \r
e9b67286 112 HiiHandle for the set of languages specified by \r
cb7d01c0 113 SupportedLanguages. The format of \r
114 SupportedLanguages must follow the language \r
e9b67286 115 format assumed in the HII Database.\r
cb7d01c0 116\r
117 @retval 0 The string could not be added or updated in the String Package.\r
118 @retval Other The EFI_STRING_ID of the newly added or updated string.\r
4c76e9cc 119\r
120**/\r
cb7d01c0 121EFI_STRING_ID\r
4c76e9cc 122EFIAPI\r
cb7d01c0 123HiiSetString (\r
124 IN EFI_HII_HANDLE HiiHandle,\r
125 IN EFI_STRING_ID StringId, OPTIONAL\r
126 IN CONST EFI_STRING String,\r
127 IN CONST CHAR8 *SupportedLanguages OPTIONAL\r
b9982883
LG
128 )\r
129;\r
4c76e9cc 130\r
131/**\r
cb7d01c0 132 Retrieves a string from a string package in a specific language. If the language\r
133 is not specified, then a string from a string package in the current platform \r
64a80549 134 language is retrieved. If the string cannot be retrieved using the specified \r
cb7d01c0 135 language or the current platform language, then the string is retrieved from \r
136 the string package in the first language the string package supports. The \r
137 returned string is allocated using AllocatePool(). The caller is responsible \r
138 for freeing the allocated buffer using FreePool().\r
139 \r
140 If HiiHandle is NULL, then ASSERT().\r
e9b67286 141 If StringId is 0, then ASSERT().\r
4c76e9cc 142\r
cb7d01c0 143 @param[in] HiiHandle A handle that was previously registered in the HII Database.\r
144 @param[in] StringId The identifier of the string to retrieved from the string \r
145 package associated with HiiHandle.\r
146 @param[in] Language The language of the string to retrieve. If this parameter \r
147 is NULL, then the current platform language is used. The \r
e9b67286 148 format of Language must follow the language format assumed in\r
cb7d01c0 149 the HII Database.\r
4c76e9cc 150\r
cb7d01c0 151 @retval NULL The string specified by StringId is not present in the string package.\r
152 @retval Other The string was returned.\r
4c76e9cc 153\r
154**/\r
cb7d01c0 155EFI_STRING\r
4c76e9cc 156EFIAPI\r
cb7d01c0 157HiiGetString (\r
158 IN EFI_HII_HANDLE HiiHandle,\r
159 IN EFI_STRING_ID StringId,\r
160 IN CONST CHAR8 *Language OPTIONAL\r
b9982883
LG
161 )\r
162;\r
4c76e9cc 163\r
164/**\r
e9b67286 165 Retrieves a string from a string package named by GUID, in the specified language. \r
cb7d01c0 166 If the language is not specified, then a string from a string package in the \r
64a80549 167 current platform language is retrieved. If the string cannot be retrieved \r
cb7d01c0 168 using the specified language or the current platform language, then the string \r
169 is retrieved from the string package in the first language the string package \r
170 supports. The returned string is allocated using AllocatePool(). The caller \r
171 is responsible for freeing the allocated buffer using FreePool().\r
172 \r
173 If PackageListGuid is NULL, then ASSERT().\r
e9b67286 174 If StringId is 0, then ASSERT().\r
cb7d01c0 175\r
176 @param[in] PackageListGuid The GUID of a package list that was previously \r
177 registered in the HII Database.\r
178 @param[in] StringId The identifier of the string to retrieved from the \r
179 string package associated with PackageListGuid.\r
180 @param[in] Language The language of the string to retrieve. If this \r
181 parameter is NULL, then the current platform \r
182 language is used. The format of Language must \r
e9b67286 183 follow the language format assumed in the HII Database.\r
cb7d01c0 184\r
185 @retval NULL The package list specified by PackageListGuid is not present in the\r
186 HII Database.\r
187 @retval NULL The string specified by StringId is not present in the string package.\r
188 @retval Other The string was returned.\r
4c76e9cc 189\r
190**/\r
cb7d01c0 191EFI_STRING\r
4c76e9cc 192EFIAPI\r
cb7d01c0 193HiiGetPackageString (\r
194 IN CONST EFI_GUID *PackageListGuid,\r
195 IN EFI_STRING_ID StringId,\r
196 IN CONST CHAR8 *Language OPTIONAL\r
b9982883
LG
197 )\r
198;\r
4c76e9cc 199\r
200/**\r
7992c0b0 201 Retrieves the array of all the HII Handles or the HII handles of a specific\r
202 package list GUID in the HII Database.\r
cb7d01c0 203 This array is terminated with a NULL HII Handle.\r
204 This function allocates the returned array using AllocatePool().\r
205 The caller is responsible for freeing the array with FreePool().\r
206\r
207 @param[in] PackageListGuid An optional parameter that is used to request \r
7992c0b0 208 HII Handles associated with a specific\r
e9b67286 209 Package List GUID. If this parameter is NULL,\r
cb7d01c0 210 then all the HII Handles in the HII Database\r
e9b67286 211 are returned. If this parameter is not NULL,\r
7992c0b0 212 then zero or more HII Handles associated with \r
213 PackageListGuid are returned.\r
cb7d01c0 214\r
215 @retval NULL No HII handles were found in the HII database\r
216 @retval NULL The array of HII Handles could not be retrieved\r
217 @retval Other A pointer to the NULL terminated array of HII Handles\r
4c76e9cc 218\r
219**/\r
cb7d01c0 220EFI_HII_HANDLE *\r
4c76e9cc 221EFIAPI\r
cb7d01c0 222HiiGetHiiHandles (\r
223 IN CONST EFI_GUID *PackageListGuid OPTIONAL\r
b9982883
LG
224 )\r
225;\r
4c76e9cc 226\r
8a458283
DB
227/**\r
228 This function allows a caller to extract the form set opcode form the Hii Handle.\r
229 The returned buffer is allocated using AllocatePool().The caller is responsible \r
230 for freeing the allocated buffer using FreePool().\r
231\r
232 @param Handle The HII handle.\r
86ac8fb2 233 @param Buffer On return, points to a pointer which point to the buffer that contain the formset opcode.\r
8a458283
DB
234 @param BufferSize On return, points to the length of the buffer.\r
235\r
236 @retval EFI_OUT_OF_RESOURCES No enough memory resource is allocated.\r
237 @retval EFI_NOT_FOUND Can't find the package data for the input Handle.\r
238 @retval EFI_INVALID_PARAMETER The input parameters are not correct.\r
86ac8fb2 239 @retval EFI_SUCCESS Get the formset opcode from the hii handle successfully.\r
8a458283
DB
240\r
241**/\r
242EFI_STATUS\r
243EFIAPI\r
244HiiGetFormSetFromHiiHandle(\r
245 IN EFI_HII_HANDLE Handle,\r
246 OUT EFI_IFR_FORM_SET **Buffer,\r
247 OUT UINTN *BufferSize\r
248 );\r
249\r
4c76e9cc 250/**\r
e9b67286 251 Retrieves a pointer to a Null-terminated ASCII string containing the list \r
cb7d01c0 252 of languages that an HII handle in the HII Database supports. The returned \r
253 string is allocated using AllocatePool(). The caller is responsible for freeing\r
254 the returned string using FreePool(). The format of the returned string follows\r
e9b67286 255 the language format assumed in the HII Database.\r
4c76e9cc 256 \r
cb7d01c0 257 If HiiHandle is NULL, then ASSERT().\r
4c76e9cc 258\r
cb7d01c0 259 @param[in] HiiHandle A handle that was previously registered in the HII Database.\r
4c76e9cc 260\r
cb7d01c0 261 @retval NULL HiiHandle is not registered in the HII database\r
86ac8fb2 262 @retval NULL There are not enough resources available to retrieve the supported\r
cb7d01c0 263 languages.\r
86ac8fb2 264 @retval NULL The list of supported languages could not be retrieved.\r
cb7d01c0 265 @retval Other A pointer to the Null-terminated ASCII string of supported languages.\r
4c76e9cc 266\r
267**/\r
cb7d01c0 268CHAR8 *\r
4c76e9cc 269EFIAPI\r
cb7d01c0 270HiiGetSupportedLanguages (\r
4c76e9cc 271 IN EFI_HII_HANDLE HiiHandle\r
b9982883
LG
272 )\r
273;\r
4c76e9cc 274\r
7e3bcccb
LG
275/**\r
276 Allocates and returns a Null-terminated Unicode <ConfigHdr> string using routing \r
277 information that includes a GUID, an optional Unicode string name, and a device\r
e9b67286 278 path. The string returned is allocated with AllocatePool(). The caller is \r
7e3bcccb
LG
279 responsible for freeing the allocated string with FreePool().\r
280 \r
281 The format of a <ConfigHdr> is as follows:\r
282\r
283 GUID=<HexCh>32&NAME=<Char>NameLength&PATH=<HexChar>DevicePathSize<Null>\r
284\r
64a80549 285 @param[in] Guid The pointer to an EFI_GUID that is the routing information\r
7e3bcccb 286 GUID. Each of the 16 bytes in Guid is converted to \r
86ac8fb2 287 a 2 Unicode character hexadecimal string. This is\r
7e3bcccb 288 an optional parameter that may be NULL.\r
64a80549 289 @param[in] Name The pointer to a Null-terminated Unicode string that is \r
7e3bcccb
LG
290 the routing information NAME. This is an optional \r
291 parameter that may be NULL. Each 16-bit Unicode \r
292 character in Name is converted to a 4 character Unicode \r
86ac8fb2 293 hexadecimal string.\r
64a80549 294 @param[in] DriverHandle The driver handle that supports a Device Path Protocol\r
7e3bcccb
LG
295 that is the routing information PATH. Each byte of\r
296 the Device Path associated with DriverHandle is converted\r
86ac8fb2 297 to a two (Unicode) character hexadecimal string.\r
7e3bcccb
LG
298\r
299 @retval NULL DriverHandle does not support the Device Path Protocol.\r
300 @retval NULL DriverHandle does not support the Device Path Protocol.\r
301 @retval Other A pointer to the Null-terminate Unicode <ConfigHdr> string\r
302\r
303**/\r
304EFI_STRING\r
305EFIAPI\r
306HiiConstructConfigHdr (\r
307 IN CONST EFI_GUID *Guid, OPTIONAL\r
308 IN CONST CHAR16 *Name, OPTIONAL\r
309 IN EFI_HANDLE DriverHandle\r
310 );\r
311\r
84f9a9ec 312/**\r
84f9a9ec 313 Reset the default value specified by DefaultId to the driver\r
e9b67286 314 configuration specified by the Request string. \r
76c24251
LG
315\r
316 NULL request string support depends on the ExportConfig interface of\r
84f9a9ec
LG
317 HiiConfigRouting protocol in UEFI specification.\r
318 \r
76c24251
LG
319 @param Request A null-terminated Unicode string in \r
320 <MultiConfigRequest> format. It can be NULL.\r
64a80549 321 If it is NULL, all configurations for the\r
76c24251
LG
322 entirety of the current HII database will be reset.\r
323 @param DefaultId Specifies the type of defaults to retrieve.\r
84f9a9ec 324 \r
86ac8fb2 325 @retval TRUE The default value was set successfully.\r
e9b67286 326 @retval FALSE The default value was not found.\r
84f9a9ec
LG
327**/\r
328BOOLEAN\r
329EFIAPI \r
330HiiSetToDefaults ( \r
e40b7d5d
LG
331 IN CONST EFI_STRING Request, OPTIONAL\r
332 IN UINT16 DefaultId\r
84f9a9ec
LG
333 );\r
334\r
335/**\r
e9b67286 336 Validate the current configuration by parsing the IFR opcode in HII form.\r
84f9a9ec 337\r
4e069e8b 338 NULL request string support depends on the ExportConfig interface of\r
e9b67286 339 HiiConfigRouting protocol in the UEFI specification.\r
84f9a9ec 340 \r
76c24251
LG
341 @param Request A null-terminated Unicode string in \r
342 <MultiConfigRequest> format. It can be NULL.\r
e9b67286 343 If it is NULL, all current configurations for the\r
76c24251 344 entirety of the current HII database will be validated.\r
84f9a9ec 345 \r
9035e118 346 @retval TRUE The current configuration is valid.\r
64a80549 347 @retval FALSE The current configuration is invalid.\r
84f9a9ec
LG
348**/\r
349BOOLEAN\r
350EFIAPI \r
351HiiValidateSettings (\r
e40b7d5d 352 IN CONST EFI_STRING Request OPTIONAL\r
84f9a9ec
LG
353 );\r
354\r
7e3bcccb
LG
355/**\r
356 Determines if the routing data specified by GUID and NAME match a <ConfigHdr>.\r
357\r
358 If ConfigHdr is NULL, then ASSERT().\r
359\r
360 @param[in] ConfigHdr Either <ConfigRequest> or <ConfigResp>.\r
64a80549 361 @param[in] Guid The GUID of the storage.\r
362 @param[in] Name The NAME of the storage.\r
7e3bcccb
LG
363\r
364 @retval TRUE Routing information matches <ConfigHdr>.\r
365 @retval FALSE Routing information does not match <ConfigHdr>.\r
366\r
367**/\r
368BOOLEAN\r
369EFIAPI\r
370HiiIsConfigHdrMatch (\r
371 IN CONST EFI_STRING ConfigHdr,\r
372 IN CONST EFI_GUID *Guid, OPTIONAL\r
373 IN CONST CHAR16 *Name OPTIONAL\r
374 );\r
375\r
376/**\r
e9b67286 377 Retrieves uncommitted data from the Form Browser and converts it to a binary\r
1d451ff9 378 buffer.\r
7e3bcccb 379\r
64a80549 380 @param[in] VariableGuid The pointer to an EFI_GUID structure. This is an optional \r
7e3bcccb 381 parameter that may be NULL.\r
64a80549 382 @param[in] VariableName The pointer to a Null-terminated Unicode string. This \r
84213069 383 is an optional parameter that may be NULL.\r
64a80549 384 @param[in] BufferSize The length in bytes of buffer to hold retrieved data. \r
385 @param[out] Buffer The buffer of data to be updated.\r
7e3bcccb 386\r
1d451ff9
LG
387 @retval FALSE The uncommitted data could not be retrieved.\r
388 @retval TRUE The uncommitted data was retrieved.\r
7e3bcccb
LG
389\r
390**/\r
1d451ff9 391BOOLEAN\r
7e3bcccb
LG
392EFIAPI\r
393HiiGetBrowserData (\r
394 IN CONST EFI_GUID *VariableGuid, OPTIONAL\r
395 IN CONST CHAR16 *VariableName, OPTIONAL\r
84213069
LG
396 IN UINTN BufferSize,\r
397 OUT UINT8 *Buffer\r
7e3bcccb
LG
398 );\r
399\r
400/**\r
401 Updates uncommitted data in the Form Browser.\r
402\r
403 If Buffer is NULL, then ASSERT().\r
404\r
64a80549 405 @param[in] VariableGuid The pointer to an EFI_GUID structure. This is an optional\r
7e3bcccb 406 parameter that may be NULL.\r
64a80549 407 @param[in] VariableName The pointer to a Null-terminated Unicode string. This\r
84213069 408 is an optional parameter that may be NULL.\r
64a80549 409 @param[in] BufferSize The length, in bytes, of Buffer.\r
410 @param[in] Buffer The buffer of data to commit.\r
7e3bcccb
LG
411 @param[in] RequestElement An optional field to specify which part of the\r
412 buffer data will be send back to Browser. If NULL,\r
413 the whole buffer of data will be committed to\r
414 Browser. \r
415 <RequestElement> ::= &OFFSET=<Number>&WIDTH=<Number>*\r
416\r
417 @retval FALSE The uncommitted data could not be updated.\r
418 @retval TRUE The uncommitted data was updated.\r
419\r
420**/\r
421BOOLEAN\r
422EFIAPI\r
423HiiSetBrowserData (\r
424 IN CONST EFI_GUID *VariableGuid, OPTIONAL\r
425 IN CONST CHAR16 *VariableName, OPTIONAL\r
426 IN UINTN BufferSize,\r
427 IN CONST UINT8 *Buffer,\r
428 IN CONST CHAR16 *RequestElement OPTIONAL\r
429 );\r
430\r
431/////////////////////////////////////////\r
432/////////////////////////////////////////\r
433/// IFR Functions\r
434/////////////////////////////////////////\r
435/////////////////////////////////////////\r
436\r
437/**\r
438 Returns a UINT64 value that contains bitfields for Hour, Minute, and Second.\r
439 The lower 8-bits of Hour are placed in bits 0..7. The lower 8-bits of Minute \r
440 are placed in bits 8..15, and the lower 8-bits of Second are placed in bits \r
64a80549 441 16..23. This format was selected because it can be easily translated to \r
7e3bcccb
LG
442 an EFI_HII_TIME structure in an EFI_IFR_TYPE_VALUE union.\r
443\r
444 @param Hour The hour value to be encoded.\r
e9b67286 445 @param Minute The minute value to be encoded.\r
7e3bcccb
LG
446 @param Second The second value to be encoded.\r
447\r
448 @return A 64-bit containing Hour, Minute, and Second.\r
449**/\r
450#define EFI_HII_TIME_UINT64(Hour, Minute, Second) \\r
451 (UINT64)((Hour & 0xff) | ((Minute & 0xff) << 8) | ((Second & 0xff) << 16))\r
452\r
453/**\r
84213069 454 Returns a UINT64 value that contains bit fields for Year, Month, and Day.\r
7e3bcccb
LG
455 The lower 16-bits of Year are placed in bits 0..15. The lower 8-bits of Month \r
456 are placed in bits 16..23, and the lower 8-bits of Day are placed in bits \r
64a80549 457 24..31. This format was selected because it can be easily translated to \r
7e3bcccb
LG
458 an EFI_HII_DATE structure in an EFI_IFR_TYPE_VALUE union.\r
459\r
460 @param Year The year value to be encoded.\r
461 @param Month The month value to be encoded.\r
462 @param Day The day value to be encoded.\r
463\r
464 @return A 64-bit containing Year, Month, and Day.\r
465**/\r
466#define EFI_HII_DATE_UINT64(Year, Month, Day) \\r
467 (UINT64)((Year & 0xffff) | ((Month & 0xff) << 16) | ((Day & 0xff) << 24))\r
468\r
469/**\r
470 Allocates and returns a new OpCode Handle. OpCode Handles must be freed with \r
471 HiiFreeOpCodeHandle().\r
472\r
473 @retval NULL There are not enough resources to allocate a new OpCode Handle.\r
474 @retval Other A new OpCode handle.\r
475\r
476**/\r
477VOID *\r
478EFIAPI\r
479HiiAllocateOpCodeHandle (\r
480 VOID\r
481 );\r
482\r
483/**\r
84213069 484 Frees an OpCode Handle that was previously allocated with HiiAllocateOpCodeHandle().\r
7e3bcccb
LG
485 When an OpCode Handle is freed, all of the opcodes associated with the OpCode\r
486 Handle are also freed.\r
487\r
488 If OpCodeHandle is NULL, then ASSERT().\r
489\r
64a80549 490 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
84213069 491\r
7e3bcccb
LG
492**/\r
493VOID\r
494EFIAPI\r
495HiiFreeOpCodeHandle (\r
496 VOID *OpCodeHandle\r
497 );\r
498\r
278663ab
LG
499/**\r
500 Append raw opcodes to an OpCodeHandle.\r
501\r
502 If OpCodeHandle is NULL, then ASSERT().\r
503 If RawBuffer is NULL, then ASSERT();\r
504\r
64a80549 505 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
506 @param[in] RawBuffer The buffer of opcodes to append.\r
278663ab
LG
507 @param[in] RawBufferSize The size, in bytes, of Buffer.\r
508\r
509 @retval NULL There is not enough space left in Buffer to add the opcode.\r
510 @retval Other A pointer to the appended opcodes.\r
511\r
512**/\r
513UINT8 *\r
514EFIAPI\r
515HiiCreateRawOpCodes (\r
516 IN VOID *OpCodeHandle,\r
517 IN UINT8 *RawBuffer,\r
518 IN UINTN RawBufferSize\r
519 );\r
520\r
7e3bcccb
LG
521/**\r
522 Create EFI_IFR_END_OP opcode.\r
523\r
524 If OpCodeHandle is NULL, then ASSERT().\r
525\r
526 @param[in] OpCodeHandle Handle to the buffer of opcodes.\r
527\r
528 @retval NULL There is not enough space left in Buffer to add the opcode.\r
529 @retval Other A pointer to the created opcode.\r
530\r
531**/\r
532UINT8 *\r
533EFIAPI\r
534HiiCreateEndOpCode (\r
535 IN VOID *OpCodeHandle\r
536 );\r
537\r
538/**\r
539 Create EFI_IFR_ONE_OF_OPTION_OP opcode.\r
540\r
541 If OpCodeHandle is NULL, then ASSERT().\r
542 If Type is invalid, then ASSERT().\r
543 If Flags is invalid, then ASSERT().\r
544\r
64a80549 545 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
546 @param[in] StringId StringId for the option.\r
547 @param[in] Flags The flags for the option.\r
548 @param[in] Type The type for the option.\r
549 @param[in] Value The value for the option.\r
7e3bcccb
LG
550\r
551 @retval NULL There is not enough space left in Buffer to add the opcode.\r
552 @retval Other A pointer to the created opcode.\r
553\r
554**/\r
555UINT8 *\r
556EFIAPI\r
557HiiCreateOneOfOptionOpCode (\r
558 IN VOID *OpCodeHandle,\r
559 IN UINT16 StringId,\r
560 IN UINT8 Flags,\r
561 IN UINT8 Type,\r
562 IN UINT64 Value\r
563 );\r
564\r
565/**\r
566 Create EFI_IFR_DEFAULT_OP opcode.\r
567\r
568 If OpCodeHandle is NULL, then ASSERT().\r
569 If Type is invalid, then ASSERT().\r
570\r
64a80549 571 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
572 @param[in] DefaultId The DefaultId for the default.\r
573 @param[in] Type The type for the default.\r
574 @param[in] Value The value for the default.\r
7e3bcccb
LG
575\r
576 @retval NULL There is not enough space left in Buffer to add the opcode.\r
577 @retval Other A pointer to the created opcode.\r
578\r
579**/\r
580UINT8 *\r
581EFIAPI\r
582HiiCreateDefaultOpCode (\r
583 IN VOID *OpCodeHandle,\r
584 IN UINT16 DefaultId,\r
585 IN UINT8 Type,\r
586 IN UINT64 Value\r
587 );\r
588\r
589/**\r
590 Create EFI_IFR_GUID opcode.\r
591\r
592 If OpCodeHandle is NULL, then ASSERT().\r
593 If Guid is NULL, then ASSERT().\r
594 If OpCodeSize < sizeof (EFI_IFR_GUID), then ASSERT().\r
595\r
64a80549 596 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
597 @param[in] Guid The pointer to EFI_GUID of this guided opcode.\r
598 @param[in] GuidOpCode The pointer to an EFI_IFR_GUID opcode. This is an \r
7e3bcccb
LG
599 optional parameter that may be NULL. If this\r
600 parameter is NULL, then the GUID extension \r
601 region of the created opcode is filled with zeros.\r
602 If this parameter is not NULL, then the GUID \r
603 extension region of GuidData will be copied to \r
604 the GUID extension region of the created opcode.\r
605 @param[in] OpCodeSize The size, in bytes, of created opcode. This value \r
606 must be >= sizeof(EFI_IFR_GUID).\r
607\r
608 @retval NULL There is not enough space left in Buffer to add the opcode.\r
609 @retval Other A pointer to the created opcode.\r
610\r
611**/\r
612UINT8 *\r
613EFIAPI\r
614HiiCreateGuidOpCode (\r
615 IN VOID *OpCodeHandle,\r
616 IN CONST EFI_GUID *Guid,\r
617 IN CONST VOID *GuidOpCode, OPTIONAL\r
618 IN UINTN OpCodeSize\r
619 );\r
620\r
621/**\r
622 Create EFI_IFR_ACTION_OP opcode.\r
623\r
624 If OpCodeHandle is NULL, then ASSERT().\r
625 If any reserved bits are set in QuestionFlags, then ASSERT().\r
626\r
64a80549 627 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
628 @param[in] QuestionId The Question ID.\r
629 @param[in] Prompt The String ID for Prompt.\r
630 @param[in] Help The String ID for Help.\r
631 @param[in] QuestionFlags The flags in the Question Header.\r
632 @param[in] QuestionConfig The String ID for the configuration.\r
7e3bcccb
LG
633\r
634 @retval NULL There is not enough space left in Buffer to add the opcode.\r
635 @retval Other A pointer to the created opcode.\r
636\r
637**/\r
638UINT8 *\r
639EFIAPI\r
640HiiCreateActionOpCode (\r
641 IN VOID *OpCodeHandle,\r
642 IN EFI_QUESTION_ID QuestionId,\r
643 IN EFI_STRING_ID Prompt,\r
644 IN EFI_STRING_ID Help,\r
645 IN UINT8 QuestionFlags,\r
646 IN EFI_STRING_ID QuestionConfig\r
647 );\r
648\r
649/**\r
650 Create EFI_IFR_SUBTITLE_OP opcode.\r
651\r
652 If OpCodeHandle is NULL, then ASSERT().\r
653 If any reserved bits are set in Flags, then ASSERT().\r
654 If Scope > 1, then ASSERT().\r
655\r
64a80549 656 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
657 @param[in] Prompt The string ID for Prompt.\r
658 @param[in] Help The string ID for Help.\r
659 @param[in] Flags The subtitle opcode flags.\r
84213069 660 @param[in] Scope 1 if this opcode is the beginning of a new scope.\r
7e3bcccb
LG
661 0 if this opcode is within the current scope.\r
662\r
663 @retval NULL There is not enough space left in Buffer to add the opcode.\r
664 @retval Other A pointer to the created opcode.\r
665\r
666**/\r
667UINT8 *\r
668EFIAPI\r
669HiiCreateSubTitleOpCode (\r
670 IN VOID *OpCodeHandle,\r
671 IN EFI_STRING_ID Prompt,\r
672 IN EFI_STRING_ID Help,\r
673 IN UINT8 Flags,\r
674 IN UINT8 Scope\r
675 );\r
676\r
677/**\r
678 Create EFI_IFR_REF_OP opcode.\r
679\r
680 If OpCodeHandle is NULL, then ASSERT().\r
681 If any reserved bits are set in QuestionFlags, then ASSERT().\r
682\r
64a80549 683 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
684 @param[in] FormId The Destination Form ID.\r
685 @param[in] Prompt The string ID for Prompt.\r
686 @param[in] Help The string ID for Help.\r
687 @param[in] QuestionFlags The flags in Question Header\r
688 @param[in] QuestionId Question ID.\r
7e3bcccb
LG
689\r
690 @retval NULL There is not enough space left in Buffer to add the opcode.\r
691 @retval Other A pointer to the created opcode.\r
692\r
693**/\r
694UINT8 *\r
695EFIAPI\r
696HiiCreateGotoOpCode (\r
697 IN VOID *OpCodeHandle,\r
698 IN EFI_FORM_ID FormId,\r
699 IN EFI_STRING_ID Prompt,\r
700 IN EFI_STRING_ID Help,\r
701 IN UINT8 QuestionFlags,\r
702 IN EFI_QUESTION_ID QuestionId\r
703 );\r
704\r
e8654a1a
LG
705/**\r
706 Create EFI_IFR_REF_OP, EFI_IFR_REF2_OP, EFI_IFR_REF3_OP and EFI_IFR_REF4_OP opcode.\r
707\r
708 When RefDevicePath is not zero, EFI_IFR_REF4 opcode will be created. \r
709 When RefDevicePath is zero and RefFormSetId is not NULL, EFI_IFR_REF3 opcode will be created.\r
710 When RefDevicePath is zero, RefFormSetId is NULL and RefQuestionId is not zero, EFI_IFR_REF2 opcode will be created.\r
711 When RefDevicePath is zero, RefFormSetId is NULL and RefQuestionId is zero, EFI_IFR_REF opcode will be created.\r
712\r
713 If OpCodeHandle is NULL, then ASSERT().\r
714 If any reserved bits are set in QuestionFlags, then ASSERT().\r
715\r
716 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
717 @param[in] RefFormId The Destination Form ID.\r
718 @param[in] Prompt The string ID for Prompt.\r
719 @param[in] Help The string ID for Help.\r
720 @param[in] QuestionFlags The flags in Question Header\r
721 @param[in] QuestionId Question ID.\r
722 @param[in] RefQuestionId The question on the form to which this link is referring. \r
723 If its value is zero, then the link refers to the top of the form.\r
724 @param[in] RefFormSetId The form set to which this link is referring. If its value is NULL, and RefDevicePath is \r
725 zero, then the link is to the current form set.\r
726 @param[in] RefDevicePath The string identifier that specifies the string containing the text representation of \r
727 the device path to which the form set containing the form specified by FormId.\r
728 If its value is zero, then the link refers to the current page.\r
729\r
730 @retval NULL There is not enough space left in Buffer to add the opcode.\r
731 @retval Other A pointer to the created opcode.\r
732\r
733**/\r
734UINT8 *\r
735EFIAPI\r
736HiiCreateGotoExOpCode (\r
737 IN VOID *OpCodeHandle,\r
738 IN EFI_FORM_ID RefFormId,\r
739 IN EFI_STRING_ID Prompt,\r
740 IN EFI_STRING_ID Help,\r
741 IN UINT8 QuestionFlags,\r
742 IN EFI_QUESTION_ID QuestionId,\r
743 IN EFI_QUESTION_ID RefQuestionId,\r
744 IN EFI_GUID *RefFormSetId, OPTIONAL\r
745 IN EFI_STRING_ID RefDevicePath\r
746 );\r
747\r
7e3bcccb
LG
748/**\r
749 Create EFI_IFR_CHECKBOX_OP opcode.\r
750\r
751 If OpCodeHandle is NULL, then ASSERT().\r
752 If any reserved bits are set in QuestionFlags, then ASSERT().\r
753 If any reserved bits are set in CheckBoxFlags, then ASSERT().\r
754\r
64a80549 755 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
756 @param[in] QuestionId The question ID.\r
757 @param[in] VarStoreId The storage ID.\r
09acdc0b
ED
758 @param[in] VarOffset Offset in Storage or String ID of the name (VarName)\r
759 for this name/value pair.\r
64a80549 760 @param[in] Prompt The string ID for Prompt.\r
761 @param[in] Help The string ID for Help.\r
762 @param[in] QuestionFlags The flags in Question Header.\r
763 @param[in] CheckBoxFlags The flags for checkbox opcode.\r
764 @param[in] DefaultsOpCodeHandle The handle for a buffer of DEFAULT opcodes. This\r
7e3bcccb
LG
765 is an optional parameter that may be NULL.\r
766\r
767 @retval NULL There is not enough space left in Buffer to add the opcode.\r
768 @retval Other A pointer to the created opcode.\r
769\r
770**/\r
771UINT8 *\r
772EFIAPI\r
773HiiCreateCheckBoxOpCode (\r
774 IN VOID *OpCodeHandle,\r
775 IN EFI_QUESTION_ID QuestionId,\r
776 IN EFI_VARSTORE_ID VarStoreId,\r
777 IN UINT16 VarOffset,\r
778 IN EFI_STRING_ID Prompt,\r
779 IN EFI_STRING_ID Help,\r
780 IN UINT8 QuestionFlags,\r
781 IN UINT8 CheckBoxFlags,\r
782 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
783 );\r
784\r
785/**\r
786 Create EFI_IFR_NUMERIC_OP opcode.\r
787\r
788 If OpCodeHandle is NULL, then ASSERT().\r
789 If any reserved bits are set in QuestionFlags, then ASSERT().\r
790 If any reserved bits are set in NumericFlags, then ASSERT().\r
791\r
64a80549 792 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
793 @param[in] QuestionId The question ID.\r
794 @param[in] VarStoreId The storage ID.\r
09acdc0b
ED
795 @param[in] VarOffset Offset in Storage or String ID of the name (VarName)\r
796 for this name/value pair.\r
64a80549 797 @param[in] Prompt The string ID for Prompt.\r
798 @param[in] Help The string ID for Help.\r
799 @param[in] QuestionFlags The flags in Question Header.\r
800 @param[in] NumericFlags The flags for a numeric opcode.\r
801 @param[in] Minimum The numeric minimum value.\r
802 @param[in] Maximum The numeric maximum value.\r
803 @param[in] Step The numeric step for edit.\r
804 @param[in] DefaultsOpCodeHandle The handle for a buffer of DEFAULT opcodes. This\r
7e3bcccb
LG
805 is an optional parameter that may be NULL.\r
806\r
807 @retval NULL There is not enough space left in Buffer to add the opcode.\r
808 @retval Other A pointer to the created opcode.\r
809\r
810**/\r
811UINT8 *\r
812EFIAPI\r
813HiiCreateNumericOpCode (\r
814 IN VOID *OpCodeHandle,\r
815 IN EFI_QUESTION_ID QuestionId,\r
816 IN EFI_VARSTORE_ID VarStoreId,\r
817 IN UINT16 VarOffset,\r
818 IN EFI_STRING_ID Prompt,\r
819 IN EFI_STRING_ID Help,\r
820 IN UINT8 QuestionFlags,\r
821 IN UINT8 NumericFlags,\r
822 IN UINT64 Minimum,\r
823 IN UINT64 Maximum,\r
824 IN UINT64 Step,\r
825 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
826 );\r
827\r
828/**\r
829 Create EFI_IFR_STRING_OP opcode.\r
830\r
831 If OpCodeHandle is NULL, then ASSERT().\r
832 If any reserved bits are set in QuestionFlags, then ASSERT().\r
833 If any reserved bits are set in StringFlags, then ASSERT().\r
834\r
64a80549 835 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
836 @param[in] QuestionId The question ID.\r
837 @param[in] VarStoreId The storage ID.\r
09acdc0b
ED
838 @param[in] VarOffset Offset in Storage or String ID of the name (VarName)\r
839 for this name/value pair.\r
64a80549 840 @param[in] Prompt The string ID for Prompt.\r
841 @param[in] Help The string ID for Help.\r
842 @param[in] QuestionFlags The flags in Question Header.\r
843 @param[in] StringFlags The flags for a string opcode.\r
844 @param[in] MinSize The string minimum length.\r
845 @param[in] MaxSize The string maximum length.\r
846 @param[in] DefaultsOpCodeHandle The handle for a buffer of DEFAULT opcodes. This\r
7e3bcccb
LG
847 is an optional parameter that may be NULL.\r
848\r
849 @retval NULL There is not enough space left in Buffer to add the opcode.\r
850 @retval Other A pointer to the created opcode.\r
851\r
852**/\r
853UINT8 *\r
854EFIAPI\r
855HiiCreateStringOpCode (\r
856 IN VOID *OpCodeHandle,\r
857 IN EFI_QUESTION_ID QuestionId,\r
858 IN EFI_VARSTORE_ID VarStoreId,\r
859 IN UINT16 VarOffset,\r
860 IN EFI_STRING_ID Prompt,\r
861 IN EFI_STRING_ID Help,\r
862 IN UINT8 QuestionFlags,\r
863 IN UINT8 StringFlags,\r
864 IN UINT8 MinSize,\r
865 IN UINT8 MaxSize,\r
866 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
867 );\r
868\r
869/**\r
870 Create EFI_IFR_ONE_OF_OP opcode.\r
871\r
872 If OpCodeHandle is NULL, then ASSERT().\r
873 If any reserved bits are set in QuestionFlags, then ASSERT().\r
874 If any reserved bits are set in OneOfFlags, then ASSERT().\r
875\r
64a80549 876 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
877 @param[in] QuestionId The question ID.\r
878 @param[in] VarStoreId The storage ID.\r
09acdc0b
ED
879 @param[in] VarOffset Offset in Storage or String ID of the name (VarName)\r
880 for this name/value pair.\r
64a80549 881 @param[in] Prompt The string ID for Prompt.\r
882 @param[in] Help The string ID for Help.\r
883 @param[in] QuestionFlags The flags in Question Header.\r
884 @param[in] OneOfFlags The flags for a oneof opcode.\r
885 @param[in] OptionsOpCodeHandle The handle for a buffer of ONE_OF_OPTION opcodes.\r
886 @param[in] DefaultsOpCodeHandle The handle for a buffer of DEFAULT opcodes. This\r
7e3bcccb
LG
887 is an optional parameter that may be NULL.\r
888\r
889 @retval NULL There is not enough space left in Buffer to add the opcode.\r
890 @retval Other A pointer to the created opcode.\r
891\r
892**/\r
893UINT8 *\r
894EFIAPI\r
895HiiCreateOneOfOpCode (\r
896 IN VOID *OpCodeHandle,\r
897 IN EFI_QUESTION_ID QuestionId,\r
898 IN EFI_VARSTORE_ID VarStoreId,\r
899 IN UINT16 VarOffset,\r
900 IN EFI_STRING_ID Prompt,\r
901 IN EFI_STRING_ID Help,\r
902 IN UINT8 QuestionFlags,\r
903 IN UINT8 OneOfFlags,\r
904 IN VOID *OptionsOpCodeHandle,\r
905 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
906 );\r
907\r
908/**\r
909 Create EFI_IFR_ORDERED_LIST_OP opcode.\r
910\r
911 If OpCodeHandle is NULL, then ASSERT().\r
912 If any reserved bits are set in QuestionFlags, then ASSERT().\r
913 If any reserved bits are set in OrderedListFlags, then ASSERT().\r
914\r
64a80549 915 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
916 @param[in] QuestionId The question ID.\r
917 @param[in] VarStoreId The storage ID.\r
09acdc0b
ED
918 @param[in] VarOffset Offset in Storage or String ID of the name (VarName)\r
919 for this name/value pair.\r
64a80549 920 @param[in] Prompt The string ID for Prompt.\r
921 @param[in] Help The string ID for Help.\r
922 @param[in] QuestionFlags The flags in Question Header.\r
923 @param[in] OrderedListFlags The flags for an ordered list opcode.\r
924 @param[in] DataType The type for option value.\r
7e3bcccb 925 @param[in] MaxContainers Maximum count for options in this ordered list\r
64a80549 926 @param[in] OptionsOpCodeHandle The handle for a buffer of ONE_OF_OPTION opcodes.\r
7e3bcccb
LG
927 @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This\r
928 is an optional parameter that may be NULL.\r
929\r
930 @retval NULL There is not enough space left in Buffer to add the opcode.\r
931 @retval Other A pointer to the created opcode.\r
932\r
933**/\r
934UINT8 *\r
935EFIAPI\r
936HiiCreateOrderedListOpCode (\r
937 IN VOID *OpCodeHandle,\r
938 IN EFI_QUESTION_ID QuestionId,\r
939 IN EFI_VARSTORE_ID VarStoreId,\r
940 IN UINT16 VarOffset,\r
941 IN EFI_STRING_ID Prompt,\r
942 IN EFI_STRING_ID Help,\r
943 IN UINT8 QuestionFlags,\r
944 IN UINT8 OrderedListFlags,\r
945 IN UINT8 DataType,\r
946 IN UINT8 MaxContainers,\r
947 IN VOID *OptionsOpCodeHandle,\r
948 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
949 );\r
950\r
e22812c7
LG
951/**\r
952 Create EFI_IFR_TEXT_OP opcode.\r
953\r
954 If OpCodeHandle is NULL, then ASSERT().\r
955\r
956 @param[in] OpCodeHandle Handle to the buffer of opcodes.\r
957 @param[in] Prompt String ID for Prompt.\r
958 @param[in] Help String ID for Help.\r
959 @param[in] TextTwo String ID for TextTwo.\r
960\r
961 @retval NULL There is not enough space left in Buffer to add the opcode.\r
962 @retval Other A pointer to the created opcode.\r
963\r
964**/\r
965UINT8 *\r
966EFIAPI\r
967HiiCreateTextOpCode (\r
968 IN VOID *OpCodeHandle,\r
969 IN EFI_STRING_ID Prompt,\r
970 IN EFI_STRING_ID Help,\r
971 IN EFI_STRING_ID TextTwo\r
972 );\r
973\r
974/**\r
975 Create EFI_IFR_DATE_OP opcode.\r
976\r
977 If OpCodeHandle is NULL, then ASSERT().\r
978 If any reserved bits are set in QuestionFlags, then ASSERT().\r
979 If any reserved bits are set in DateFlags, then ASSERT().\r
980\r
981 @param[in] OpCodeHandle Handle to the buffer of opcodes.\r
982 @param[in] QuestionId Question ID\r
983 @param[in] VarStoreId Storage ID, optional. If DateFlags is not\r
984 QF_DATE_STORAGE_NORMAL, this parameter is ignored.\r
09acdc0b
ED
985 @param[in] VarOffset Offset in Storage or String ID of the name (VarName)\r
986 for this name/value pair, optional. If DateFlags is not\r
e22812c7
LG
987 QF_DATE_STORAGE_NORMAL, this parameter is ignored.\r
988 @param[in] Prompt String ID for Prompt\r
989 @param[in] Help String ID for Help\r
990 @param[in] QuestionFlags Flags in Question Header\r
991 @param[in] DateFlags Flags for date opcode\r
992 @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This\r
993 is an optional parameter that may be NULL.\r
994\r
995 @retval NULL There is not enough space left in Buffer to add the opcode.\r
996 @retval Other A pointer to the created opcode.\r
997\r
998**/\r
999UINT8 *\r
1000EFIAPI\r
1001HiiCreateDateOpCode (\r
1002 IN VOID *OpCodeHandle,\r
1003 IN EFI_QUESTION_ID QuestionId,\r
1004 IN EFI_VARSTORE_ID VarStoreId, OPTIONAL\r
1005 IN UINT16 VarOffset, OPTIONAL\r
1006 IN EFI_STRING_ID Prompt,\r
1007 IN EFI_STRING_ID Help,\r
1008 IN UINT8 QuestionFlags,\r
1009 IN UINT8 DateFlags,\r
1010 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
1011 );\r
1012\r
1013/**\r
1014 Create EFI_IFR_TIME_OP opcode.\r
1015\r
1016 If OpCodeHandle is NULL, then ASSERT().\r
1017 If any reserved bits are set in QuestionFlags, then ASSERT().\r
1018 If any reserved bits are set in TimeFlags, then ASSERT().\r
1019\r
1020 @param[in] OpCodeHandle Handle to the buffer of opcodes.\r
1021 @param[in] QuestionId Question ID\r
1022 @param[in] VarStoreId Storage ID, optional. If TimeFlags is not\r
1023 QF_TIME_STORAGE_NORMAL, this parameter is ignored.\r
09acdc0b
ED
1024 @param[in] VarOffset Offset in Storage or String ID of the name (VarName)\r
1025 for this name/value pair, optional. If TimeFlags is not\r
e22812c7
LG
1026 QF_TIME_STORAGE_NORMAL, this parameter is ignored.\r
1027 @param[in] Prompt String ID for Prompt\r
1028 @param[in] Help String ID for Help\r
1029 @param[in] QuestionFlags Flags in Question Header\r
1030 @param[in] TimeFlags Flags for time opcode\r
1031 @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This\r
1032 is an optional parameter that may be NULL.\r
1033\r
1034 @retval NULL There is not enough space left in Buffer to add the opcode.\r
1035 @retval Other A pointer to the created opcode.\r
1036\r
1037**/\r
1038UINT8 *\r
1039EFIAPI\r
1040HiiCreateTimeOpCode (\r
1041 IN VOID *OpCodeHandle,\r
1042 IN EFI_QUESTION_ID QuestionId,\r
1043 IN EFI_VARSTORE_ID VarStoreId, OPTIONAL\r
1044 IN UINT16 VarOffset, OPTIONAL\r
1045 IN EFI_STRING_ID Prompt,\r
1046 IN EFI_STRING_ID Help,\r
1047 IN UINT8 QuestionFlags,\r
1048 IN UINT8 TimeFlags,\r
1049 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
1050 );\r
1051\r
7e3bcccb
LG
1052/**\r
1053 This function updates a form that has previously been registered with the HII \r
1054 Database. This function will perform at most one update operation.\r
1055 \r
1056 The form to update is specified by Handle, FormSetGuid, and FormId. Binary \r
1057 comparisons of IFR opcodes are performed from the beginning of the form being \r
1058 updated until an IFR opcode is found that exactly matches the first IFR opcode \r
84213069 1059 specified by StartOpCodeHandle. The following rules are used to determine if\r
e9b67286 1060 an insert, replace, or delete operation is performed:\r
7e3bcccb
LG
1061 \r
1062 1) If no matches are found, then NULL is returned. \r
1063 2) If a match is found, and EndOpCodeHandle is NULL, then all of the IFR opcodes\r
84213069
LG
1064 from StartOpCodeHandle except the first opcode are inserted immediately after \r
1065 the matching IFR opcode in the form to be updated.\r
7e3bcccb 1066 3) If a match is found, and EndOpCodeHandle is not NULL, then a search is made \r
e9b67286 1067 from the matching IFR opcode until an IFR opcode exactly matches the first \r
7e3bcccb
LG
1068 IFR opcode specified by EndOpCodeHandle. If no match is found for the first\r
1069 IFR opcode specified by EndOpCodeHandle, then NULL is returned. If a match\r
1070 is found, then all of the IFR opcodes between the start match and the end \r
1071 match are deleted from the form being updated and all of the IFR opcodes\r
84213069 1072 from StartOpCodeHandle except the first opcode are inserted immediately after \r
7e3bcccb 1073 the matching start IFR opcode. If StartOpCcodeHandle only contains one\r
84213069 1074 IFR instruction, then the result of this operation will delete all of the IFR\r
7e3bcccb
LG
1075 opcodes between the start end matches.\r
1076\r
1077 If HiiHandle is NULL, then ASSERT().\r
1078 If StartOpCodeHandle is NULL, then ASSERT().\r
1079\r
1080 @param[in] HiiHandle The HII Handle of the form to update.\r
1081 @param[in] FormSetGuid The Formset GUID of the form to update. This\r
1082 is an optional parameter that may be NULL.\r
1083 If it is NULL, all FormSet will be updated.\r
1084 @param[in] FormId The ID of the form to update.\r
1085 @param[in] StartOpCodeHandle An OpCode Handle that contains the set of IFR \r
1086 opcodes to be inserted or replaced in the form.\r
1087 The first IFR instruction in StartOpCodeHandle \r
1088 is used to find matching IFR opcode in the \r
1089 form. \r
1090 @param[in] EndOpCodeHandle An OpCcode Handle that contains the IFR opcode\r
1091 that marks the end of a replace operation in\r
1092 the form. This is an optional parameter that\r
e9b67286 1093 may be NULL. If it is NULL, then the IFR\r
7e3bcccb
LG
1094 opcodes specified by StartOpCodeHandle are \r
1095 inserted into the form.\r
1096 \r
e9b67286 1097 @retval EFI_OUT_OF_RESOURCES Not enough memory resources are allocated.\r
1098 @retval EFI_NOT_FOUND The following cases will return EFI_NOT_FOUND:\r
7e3bcccb
LG
1099 1) The form specified by HiiHandle, FormSetGuid, \r
1100 and FormId could not be found in the HII Database.\r
1101 2) No IFR opcodes in the target form match the first\r
1102 IFR opcode in StartOpCodeHandle.\r
1103 3) EndOpCOde is not NULL, and no IFR opcodes in the \r
1104 target form following a matching start opcode match \r
1105 the first IFR opcode in EndOpCodeHandle.\r
1106 @retval EFI_SUCCESS The matched form is updated by StartOpcode.\r
1107\r
1108**/\r
1109EFI_STATUS\r
1110EFIAPI\r
1111HiiUpdateForm (\r
1112 IN EFI_HII_HANDLE HiiHandle,\r
1113 IN EFI_GUID *FormSetGuid, OPTIONAL\r
1114 IN EFI_FORM_ID FormId,\r
84213069
LG
1115 IN VOID *StartOpCodeHandle,\r
1116 IN VOID *EndOpCodeHandle OPTIONAL\r
7e3bcccb
LG
1117 );\r
1118\r
4c76e9cc 1119#endif\r