2 Copyright (c) 2004 - 2008, Intel Corporation
3 All rights reserved. This program and the accompanying materials
4 are licensed and made available under the terms and conditions of the BSD License
5 which accompanies this distribution. The full text of the license may be found at
6 http://opensource.org/licenses/bsd-license.php
8 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
9 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 This is an example of how a driver might export data to the HII protocol to be
17 later utilized by the Setup Protocol
23 #include "DriverSample.h"
25 #define DISPLAY_ONLY_MY_ITEM 0x0002
27 EFI_GUID mFormSetGuid
= FORMSET_GUID
;
28 EFI_GUID mInventoryGuid
= INVENTORY_GUID
;
30 CHAR16 VariableName
[] = L
"MyIfrNVData";
44 Buffer
= AllocateZeroPool (MaxSize
);
45 ASSERT (Buffer
!= NULL
);
47 for (Index
= 0; Key
[Index
] != 0; Index
++) {
48 for (Loop
= 0; Loop
< (UINT8
) (MaxSize
/ 2); Loop
++) {
49 Buffer
[Loop
] = (CHAR16
) (Password
[Loop
] ^ Key
[Index
]);
53 CopyMem (Password
, Buffer
, MaxSize
);
55 gBS
->FreePool (Buffer
);
61 DRIVER_SAMPLE_PRIVATE_DATA
*PrivateData
,
62 EFI_STRING_ID StringId
69 CHAR16
*EncodedPassword
;
73 // Get encoded password first
75 BufferSize
= sizeof (DRIVER_SAMPLE_CONFIGURATION
);
76 Status
= gRT
->GetVariable (
81 &PrivateData
->Configuration
83 if (EFI_ERROR (Status
)) {
85 // Old password not exist, prompt for new password
92 // Check whether we have any old password set
94 for (Index
= 0; Index
< 20; Index
++) {
95 if (PrivateData
->Configuration
.WhatIsThePassword2
[Index
] != 0) {
102 // Old password not exist, return EFI_SUCCESS to prompt for new password
108 // Get user input password
110 BufferSize
= 21 * sizeof (CHAR16
);
111 Password
= AllocateZeroPool (BufferSize
);
112 ASSERT (Password
!= NULL
);
114 Status
= HiiLibGetString (PrivateData
->HiiHandle
[0], StringId
, Password
, &BufferSize
);
115 if (EFI_ERROR (Status
)) {
116 gBS
->FreePool (Password
);
121 // Validate old password
123 EncodedPassword
= AllocateCopyPool (21 * sizeof (CHAR16
), Password
);
124 ASSERT (EncodedPassword
!= NULL
);
125 EncodePassword (EncodedPassword
, 20 * sizeof (CHAR16
));
126 if (CompareMem (EncodedPassword
, PrivateData
->Configuration
.WhatIsThePassword2
, 20 * sizeof (CHAR16
)) != 0) {
128 // Old password mismatch, return EFI_NOT_READY to prompt for error message
130 Status
= EFI_NOT_READY
;
132 Status
= EFI_SUCCESS
;
135 gBS
->FreePool (Password
);
136 gBS
->FreePool (EncodedPassword
);
143 DRIVER_SAMPLE_PRIVATE_DATA
*PrivateData
,
144 EFI_STRING_ID StringId
150 DRIVER_SAMPLE_CONFIGURATION
*Configuration
;
153 // Get Buffer Storage data from EFI variable
155 BufferSize
= sizeof (DRIVER_SAMPLE_CONFIGURATION
);
156 Status
= gRT
->GetVariable (
161 &PrivateData
->Configuration
163 if (EFI_ERROR (Status
)) {
168 // Get user input password
170 Password
= &PrivateData
->Configuration
.WhatIsThePassword2
[0];
171 ZeroMem (Password
, 20 * sizeof (CHAR16
));
172 Status
= HiiLibGetString (PrivateData
->HiiHandle
[0], StringId
, Password
, &BufferSize
);
173 if (EFI_ERROR (Status
)) {
178 // Retrive uncommitted data from Browser
180 BufferSize
= sizeof (DRIVER_SAMPLE_CONFIGURATION
);
181 Configuration
= AllocateZeroPool (sizeof (DRIVER_SAMPLE_PRIVATE_DATA
));
182 ASSERT (Configuration
!= NULL
);
183 Status
= GetBrowserData (&mFormSetGuid
, VariableName
, &BufferSize
, (UINT8
*) Configuration
);
184 if (!EFI_ERROR (Status
)) {
186 // Update password's clear text in the screen
188 CopyMem (Configuration
->PasswordClearText
, Password
, 20 * sizeof (CHAR16
));
191 // Update uncommitted data of Browser
193 BufferSize
= sizeof (DRIVER_SAMPLE_CONFIGURATION
);
194 Status
= SetBrowserData (
198 (UINT8
*) Configuration
,
202 gBS
->FreePool (Configuration
);
207 EncodePassword (Password
, 20 * sizeof (CHAR16
));
208 Status
= gRT
->SetVariable(
211 EFI_VARIABLE_NON_VOLATILE
| EFI_VARIABLE_BOOTSERVICE_ACCESS
,
212 sizeof (DRIVER_SAMPLE_CONFIGURATION
),
213 &PrivateData
->Configuration
220 This function allows a caller to extract the current configuration for one
221 or more named elements from the target driver.
223 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
224 @param Request A null-terminated Unicode string in
225 <ConfigRequest> format.
226 @param Progress On return, points to a character in the Request
227 string. Points to the string's null terminator if
228 request was successful. Points to the most recent
229 '&' before the first failing name/value pair (or
230 the beginning of the string if the failure is in
231 the first name/value pair) if the request was not
233 @param Results A null-terminated Unicode string in
234 <ConfigAltResp> format which has all values filled
235 in for the names in the Request string. String to
236 be allocated by the called function.
238 @retval EFI_SUCCESS The Results is filled with the requested values.
239 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.
240 @retval EFI_INVALID_PARAMETER Request is NULL, illegal syntax, or unknown name.
241 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this
248 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
*This
,
249 IN CONST EFI_STRING Request
,
250 OUT EFI_STRING
*Progress
,
251 OUT EFI_STRING
*Results
256 DRIVER_SAMPLE_PRIVATE_DATA
*PrivateData
;
257 EFI_HII_CONFIG_ROUTING_PROTOCOL
*HiiConfigRouting
;
259 PrivateData
= DRIVER_SAMPLE_PRIVATE_FROM_THIS (This
);
260 HiiConfigRouting
= PrivateData
->HiiConfigRouting
;
264 // Get Buffer Storage data from EFI variable
266 BufferSize
= sizeof (DRIVER_SAMPLE_CONFIGURATION
);
267 Status
= gRT
->GetVariable (
272 &PrivateData
->Configuration
274 if (EFI_ERROR (Status
)) {
278 if (Request
== NULL
) {
280 // Request is set to NULL, return all configurable elements together with ALTCFG
282 Status
= ConstructConfigAltResp (
288 PrivateData
->DriverHandle
[0],
289 &PrivateData
->Configuration
,
291 VfrMyIfrNVDataBlockName
,
293 STRING_TOKEN (STR_STANDARD_DEFAULT_PROMPT
),
294 VfrMyIfrNVDataDefault0000
,
295 STRING_TOKEN (STR_MANUFACTURE_DEFAULT_PROMPT
),
296 VfrMyIfrNVDataDefault0001
303 // Check routing data in <ConfigHdr>.
304 // Note: if only one Storage is used, then this checking could be skipped.
306 if (!IsConfigHdrMatch (Request
, &mFormSetGuid
, VariableName
)) {
308 return EFI_NOT_FOUND
;
312 // Convert buffer data to <ConfigResp> by helper function BlockToConfig()
314 Status
= HiiConfigRouting
->BlockToConfig (
317 (UINT8
*) &PrivateData
->Configuration
,
327 This function processes the results of changes in configuration.
329 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
330 @param Configuration A null-terminated Unicode string in <ConfigResp>
332 @param Progress A pointer to a string filled in with the offset of
333 the most recent '&' before the first failing
334 name/value pair (or the beginning of the string if
335 the failure is in the first name/value pair) or
336 the terminating NULL if all was successful.
338 @retval EFI_SUCCESS The Results is processed successfully.
339 @retval EFI_INVALID_PARAMETER Configuration is NULL.
340 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this
347 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
*This
,
348 IN CONST EFI_STRING Configuration
,
349 OUT EFI_STRING
*Progress
354 DRIVER_SAMPLE_PRIVATE_DATA
*PrivateData
;
355 EFI_HII_CONFIG_ROUTING_PROTOCOL
*HiiConfigRouting
;
357 if (Configuration
== NULL
) {
358 return EFI_INVALID_PARAMETER
;
361 PrivateData
= DRIVER_SAMPLE_PRIVATE_FROM_THIS (This
);
362 HiiConfigRouting
= PrivateData
->HiiConfigRouting
;
364 // Check routing data in <ConfigHdr>.
365 // Note: if only one Storage is used, then this checking could be skipped.
367 if (!IsConfigHdrMatch (Configuration
, &mFormSetGuid
, VariableName
)) {
368 *Progress
= Configuration
;
369 return EFI_NOT_FOUND
;
373 // Get Buffer Storage data from EFI variable
375 BufferSize
= sizeof (DRIVER_SAMPLE_CONFIGURATION
);
376 Status
= gRT
->GetVariable (
381 &PrivateData
->Configuration
383 if (EFI_ERROR (Status
)) {
388 // Convert <ConfigResp> to buffer data by helper function ConfigToBlock()
390 BufferSize
= sizeof (DRIVER_SAMPLE_CONFIGURATION
);
391 Status
= HiiConfigRouting
->ConfigToBlock (
394 (UINT8
*) &PrivateData
->Configuration
,
398 if (EFI_ERROR (Status
)) {
403 // Store Buffer Storage back to EFI variable
405 Status
= gRT
->SetVariable(
408 EFI_VARIABLE_NON_VOLATILE
| EFI_VARIABLE_BOOTSERVICE_ACCESS
,
409 sizeof (DRIVER_SAMPLE_CONFIGURATION
),
410 &PrivateData
->Configuration
418 This function processes the results of changes in configuration.
420 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
421 @param Action Specifies the type of action taken by the browser.
422 @param QuestionId A unique value which is sent to the original
423 exporting driver so that it can identify the type
425 @param Type The type of value for the question.
426 @param Value A pointer to the data being sent to the original
428 @param ActionRequest On return, points to the action requested by the
431 @retval EFI_SUCCESS The callback successfully handled the action.
432 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the
433 variable and its data.
434 @retval EFI_DEVICE_ERROR The variable could not be saved.
435 @retval EFI_UNSUPPORTED The specified Action is not supported by the
442 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
*This
,
443 IN EFI_BROWSER_ACTION Action
,
444 IN EFI_QUESTION_ID QuestionId
,
446 IN EFI_IFR_TYPE_VALUE
*Value
,
447 OUT EFI_BROWSER_ACTION_REQUEST
*ActionRequest
450 DRIVER_SAMPLE_PRIVATE_DATA
*PrivateData
;
452 EFI_HII_UPDATE_DATA UpdateData
;
453 IFR_OPTION
*IfrOptionList
;
456 if ((Value
== NULL
) || (ActionRequest
== NULL
)) {
457 return EFI_INVALID_PARAMETER
;
460 Status
= EFI_SUCCESS
;
461 PrivateData
= DRIVER_SAMPLE_PRIVATE_FROM_THIS (This
);
463 switch (QuestionId
) {
466 // Initialize the container for dynamic opcodes
468 IfrLibInitUpdateData (&UpdateData
, 0x1000);
470 IfrOptionList
= AllocatePool (2 * sizeof (IFR_OPTION
));
471 ASSERT (IfrOptionList
!= NULL
);
473 IfrOptionList
[0].Flags
= 0;
474 IfrOptionList
[0].StringToken
= STRING_TOKEN (STR_BOOT_OPTION1
);
475 IfrOptionList
[0].Value
.u8
= 1;
476 IfrOptionList
[1].Flags
= EFI_IFR_OPTION_DEFAULT
;
477 IfrOptionList
[1].StringToken
= STRING_TOKEN (STR_BOOT_OPTION2
);
478 IfrOptionList
[1].Value
.u8
= 2;
481 0x1237, // Question ID
482 STRING_TOKEN(STR_EXIT_TEXT
), // Prompt text
483 STRING_TOKEN(STR_EXIT_TEXT
), // Help text
484 EFI_IFR_FLAG_CALLBACK
, // Question flag
485 0, // Action String ID
486 &UpdateData
// Container for dynamic created opcodes
490 // Prepare initial value for the dynamic created oneof Question
492 PrivateData
->Configuration
.DynamicOneof
= 2;
493 Status
= gRT
->SetVariable(
496 EFI_VARIABLE_NON_VOLATILE
| EFI_VARIABLE_BOOTSERVICE_ACCESS
,
497 sizeof (DRIVER_SAMPLE_CONFIGURATION
),
498 &PrivateData
->Configuration
501 0x8001, // Question ID (or call it "key")
502 CONFIGURATION_VARSTORE_ID
, // VarStore ID
503 DYNAMIC_ONE_OF_VAR_OFFSET
, // Offset in Buffer Storage
504 STRING_TOKEN (STR_ONE_OF_PROMPT
), // Question prompt text
505 STRING_TOKEN (STR_ONE_OF_HELP
), // Question help text
506 EFI_IFR_FLAG_CALLBACK
, // Question flag
507 EFI_IFR_NUMERIC_SIZE_1
, // Data type of Question Value
508 IfrOptionList
, // Option list
509 2, // Number of options in Option list
510 &UpdateData
// Container for dynamic created opcodes
513 CreateOrderedListOpCode (
514 0x8002, // Question ID
515 CONFIGURATION_VARSTORE_ID
, // VarStore ID
516 DYNAMIC_ORDERED_LIST_VAR_OFFSET
, // Offset in Buffer Storage
517 STRING_TOKEN (STR_BOOT_OPTIONS
), // Question prompt text
518 STRING_TOKEN (STR_BOOT_OPTIONS
), // Question help text
519 EFI_IFR_FLAG_RESET_REQUIRED
, // Question flag
520 0, // Ordered list flag, e.g. EFI_IFR_UNIQUE_SET
521 EFI_IFR_NUMERIC_SIZE_1
, // Data type of Question value
522 5, // Maximum container
523 IfrOptionList
, // Option list
524 2, // Number of options in Option list
525 &UpdateData
// Container for dynamic created opcodes
530 STRING_TOKEN (STR_GOTO_FORM1
), // Prompt text
531 STRING_TOKEN (STR_GOTO_HELP
), // Help text
533 0x8003, // Question ID
534 &UpdateData
// Container for dynamic created opcodes
537 Status
= IfrLibUpdateForm (
538 PrivateData
->HiiHandle
[0], // HII handle
539 &mFormSetGuid
, // Formset GUID
541 0x1234, // Label for where to insert opcodes
542 TRUE
, // Append or replace
543 &UpdateData
// Dynamic created opcodes
545 gBS
->FreePool (IfrOptionList
);
546 IfrLibFreeUpdateData (&UpdateData
);
551 // We will reach here once the Question is refreshed
553 IfrLibInitUpdateData (&UpdateData
, 0x1000);
555 IfrOptionList
= AllocatePool (2 * sizeof (IFR_OPTION
));
556 ASSERT (IfrOptionList
!= NULL
);
559 0x1237, // Question ID
560 STRING_TOKEN(STR_EXIT_TEXT
), // Prompt text
561 STRING_TOKEN(STR_EXIT_TEXT
), // Help text
562 EFI_IFR_FLAG_CALLBACK
, // Question flag
563 0, // Action String ID
564 &UpdateData
// Container for dynamic created opcodes
567 Status
= IfrLibUpdateForm (
568 PrivateData
->HiiHandle
[0], // HII handle
569 &mFormSetGuid
, // Formset GUID
571 0x2234, // Label for where to insert opcodes
572 TRUE
, // Append or replace
573 &UpdateData
// Dynamic created opcodes
575 IfrLibFreeUpdateData (&UpdateData
);
578 // Refresh the Question value
580 PrivateData
->Configuration
.DynamicRefresh
++;
581 Status
= gRT
->SetVariable(
584 EFI_VARIABLE_NON_VOLATILE
| EFI_VARIABLE_BOOTSERVICE_ACCESS
,
585 sizeof (DRIVER_SAMPLE_CONFIGURATION
),
586 &PrivateData
->Configuration
590 // Change an EFI Variable storage (MyEfiVar) asynchronous, this will cause
591 // the first statement in Form 3 be suppressed
594 Status
= gRT
->SetVariable(
597 EFI_VARIABLE_NON_VOLATILE
| EFI_VARIABLE_BOOTSERVICE_ACCESS
,
605 // User press "Exit now", request Browser to exit
607 *ActionRequest
= EFI_BROWSER_ACTION_REQUEST_EXIT
;
612 // User press "Save now", request Browser to save the uncommitted data.
614 *ActionRequest
= EFI_BROWSER_ACTION_REQUEST_SUBMIT
;
619 // When try to set a new password, user will be chanlleged with old password.
620 // The Callback is responsible for validating old password input by user,
621 // If Callback return EFI_SUCCESS, it indicates validation pass.
623 switch (PrivateData
->PasswordState
) {
624 case BROWSER_STATE_VALIDATE_PASSWORD
:
625 Status
= ValidatePassword (PrivateData
, Value
->string
);
626 if (Status
== EFI_SUCCESS
) {
627 PrivateData
->PasswordState
= BROWSER_STATE_SET_PASSWORD
;
631 case BROWSER_STATE_SET_PASSWORD
:
632 Status
= SetPassword (PrivateData
, Value
->string
);
633 PrivateData
->PasswordState
= BROWSER_STATE_VALIDATE_PASSWORD
;
652 IN EFI_HANDLE ImageHandle
,
653 IN EFI_SYSTEM_TABLE
*SystemTable
657 EFI_STATUS SavedStatus
;
658 EFI_HII_PACKAGE_LIST_HEADER
*PackageList
;
659 EFI_HII_HANDLE HiiHandle
[2];
660 EFI_HANDLE DriverHandle
[2];
661 DRIVER_SAMPLE_PRIVATE_DATA
*PrivateData
;
662 EFI_SCREEN_DESCRIPTOR Screen
;
663 EFI_HII_DATABASE_PROTOCOL
*HiiDatabase
;
664 EFI_HII_STRING_PROTOCOL
*HiiString
;
665 EFI_FORM_BROWSER2_PROTOCOL
*FormBrowser2
;
666 EFI_HII_CONFIG_ROUTING_PROTOCOL
*HiiConfigRouting
;
669 DRIVER_SAMPLE_CONFIGURATION
*Configuration
;
670 BOOLEAN ExtractIfrDefault
;
673 // Initialize the library and our protocol.
677 // Initialize screen dimensions for SendForm().
678 // Remove 3 characters from top and bottom
680 ZeroMem (&Screen
, sizeof (EFI_SCREEN_DESCRIPTOR
));
681 gST
->ConOut
->QueryMode (gST
->ConOut
, gST
->ConOut
->Mode
->Mode
, &Screen
.RightColumn
, &Screen
.BottomRow
);
684 Screen
.BottomRow
= Screen
.BottomRow
- 3;
687 // Initialize driver private data
689 PrivateData
= AllocatePool (sizeof (DRIVER_SAMPLE_PRIVATE_DATA
));
690 if (PrivateData
== NULL
) {
691 return EFI_OUT_OF_RESOURCES
;
694 PrivateData
->Signature
= DRIVER_SAMPLE_PRIVATE_SIGNATURE
;
696 PrivateData
->ConfigAccess
.ExtractConfig
= ExtractConfig
;
697 PrivateData
->ConfigAccess
.RouteConfig
= RouteConfig
;
698 PrivateData
->ConfigAccess
.Callback
= DriverCallback
;
699 PrivateData
->PasswordState
= BROWSER_STATE_VALIDATE_PASSWORD
;
702 // Locate Hii Database protocol
704 Status
= gBS
->LocateProtocol (&gEfiHiiDatabaseProtocolGuid
, NULL
, (VOID
**) &HiiDatabase
);
705 if (EFI_ERROR (Status
)) {
708 PrivateData
->HiiDatabase
= HiiDatabase
;
711 // Locate HiiString protocol
713 Status
= gBS
->LocateProtocol (&gEfiHiiStringProtocolGuid
, NULL
, (VOID
**) &HiiString
);
714 if (EFI_ERROR (Status
)) {
717 PrivateData
->HiiString
= HiiString
;
720 // Locate Formbrowser2 protocol
722 Status
= gBS
->LocateProtocol (&gEfiFormBrowser2ProtocolGuid
, NULL
, (VOID
**) &FormBrowser2
);
723 if (EFI_ERROR (Status
)) {
726 PrivateData
->FormBrowser2
= FormBrowser2
;
729 // Locate ConfigRouting protocol
731 Status
= gBS
->LocateProtocol (&gEfiHiiConfigRoutingProtocolGuid
, NULL
, (VOID
**) &HiiConfigRouting
);
732 if (EFI_ERROR (Status
)) {
735 PrivateData
->HiiConfigRouting
= HiiConfigRouting
;
738 // Install Config Access protocol
740 Status
= HiiLibCreateHiiDriverHandle (&DriverHandle
[0]);
741 if (EFI_ERROR (Status
)) {
744 PrivateData
->DriverHandle
[0] = DriverHandle
[0];
746 Status
= gBS
->InstallProtocolInterface (
748 &gEfiHiiConfigAccessProtocolGuid
,
749 EFI_NATIVE_INTERFACE
,
750 &PrivateData
->ConfigAccess
752 ASSERT_EFI_ERROR (Status
);
755 // Publish our HII data
757 PackageList
= HiiLibPreparePackageList (
763 if (PackageList
== NULL
) {
764 return EFI_OUT_OF_RESOURCES
;
767 Status
= HiiDatabase
->NewPackageList (
773 gBS
->FreePool (PackageList
);
774 if (EFI_ERROR (Status
)) {
777 PrivateData
->HiiHandle
[0] = HiiHandle
[0];
780 // Publish another Fromset
782 Status
= HiiLibCreateHiiDriverHandle (&DriverHandle
[1]);
783 if (EFI_ERROR (Status
)) {
786 PrivateData
->DriverHandle
[1] = DriverHandle
[1];
788 PackageList
= HiiLibPreparePackageList (
794 if (PackageList
== NULL
) {
795 return EFI_OUT_OF_RESOURCES
;
798 Status
= HiiDatabase
->NewPackageList (
804 gBS
->FreePool (PackageList
);
805 if (EFI_ERROR (Status
)) {
808 PrivateData
->HiiHandle
[1] = HiiHandle
[1];
811 // Very simple example of how one would update a string that is already
812 // in the HII database
814 NewString
= L
"700 Mhz";
816 Status
= HiiLibSetString (HiiHandle
[0], STRING_TOKEN (STR_CPU_STRING2
), NewString
);
817 if (EFI_ERROR (Status
)) {
822 // Initialize configuration data
824 Configuration
= &PrivateData
->Configuration
;
825 ZeroMem (Configuration
, sizeof (DRIVER_SAMPLE_CONFIGURATION
));
828 // Try to read NV config EFI variable first
830 ExtractIfrDefault
= TRUE
;
831 BufferSize
= sizeof (DRIVER_SAMPLE_CONFIGURATION
);
832 Status
= gRT
->GetVariable (VariableName
, &mFormSetGuid
, NULL
, &BufferSize
, Configuration
);
833 if (!EFI_ERROR (Status
) && (BufferSize
== sizeof (DRIVER_SAMPLE_CONFIGURATION
))) {
834 ExtractIfrDefault
= FALSE
;
837 if (ExtractIfrDefault
) {
839 // EFI variable for NV config doesn't exit, we should build this variable
840 // based on default values stored in IFR
842 BufferSize
= sizeof (DRIVER_SAMPLE_CONFIGURATION
);
843 Status
= IfrLibExtractDefault (Configuration
, &BufferSize
, 1, VfrMyIfrNVDataDefault0000
);
845 if (!EFI_ERROR (Status
)) {
849 EFI_VARIABLE_NON_VOLATILE
| EFI_VARIABLE_BOOTSERVICE_ACCESS
,
850 sizeof (DRIVER_SAMPLE_CONFIGURATION
),
857 // Example of how to display only the item we sent to HII
859 if (DISPLAY_ONLY_MY_ITEM
== 0x0001) {
861 // Have the browser pull out our copy of the data, and only display our data
863 // Status = FormConfig->SendForm (FormConfig, TRUE, HiiHandle, NULL, NULL, NULL, &Screen, NULL);
865 Status
= FormBrowser2
->SendForm (
874 SavedStatus
= Status
;
876 Status
= HiiDatabase
->RemovePackageList (HiiDatabase
, HiiHandle
[0]);
877 if (EFI_ERROR (Status
)) {
881 Status
= HiiDatabase
->RemovePackageList (HiiDatabase
, HiiHandle
[1]);
882 if (EFI_ERROR (Status
)) {
889 // Have the browser pull out all the data in the HII Database and display it.
891 // Status = FormConfig->SendForm (FormConfig, TRUE, 0, NULL, NULL, NULL, NULL, NULL);