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";
32 UINT8 VfrMyIfrNVDataBlockName
[] = "BugBug";
46 Buffer
= AllocateZeroPool (MaxSize
);
47 ASSERT (Buffer
!= NULL
);
49 for (Index
= 0; Key
[Index
] != 0; Index
++) {
50 for (Loop
= 0; Loop
< (UINT8
) (MaxSize
/ 2); Loop
++) {
51 Buffer
[Loop
] = (CHAR16
) (Password
[Loop
] ^ Key
[Index
]);
55 CopyMem (Password
, Buffer
, MaxSize
);
57 gBS
->FreePool (Buffer
);
63 DRIVER_SAMPLE_PRIVATE_DATA
*PrivateData
,
64 EFI_STRING_ID StringId
71 CHAR16
*EncodedPassword
;
75 // Get encoded password first
77 BufferSize
= sizeof (DRIVER_SAMPLE_CONFIGURATION
);
78 Status
= gRT
->GetVariable (
83 &PrivateData
->Configuration
85 if (EFI_ERROR (Status
)) {
87 // Old password not exist, prompt for new password
94 // Check whether we have any old password set
96 for (Index
= 0; Index
< 20; Index
++) {
97 if (PrivateData
->Configuration
.WhatIsThePassword2
[Index
] != 0) {
104 // Old password not exist, return EFI_SUCCESS to prompt for new password
110 // Get user input password
112 BufferSize
= 21 * sizeof (CHAR16
);
113 Password
= AllocateZeroPool (BufferSize
);
114 ASSERT (Password
!= NULL
);
116 Status
= HiiLibGetString (PrivateData
->HiiHandle
[0], StringId
, Password
, &BufferSize
);
117 if (EFI_ERROR (Status
)) {
118 gBS
->FreePool (Password
);
123 // Validate old password
125 EncodedPassword
= AllocateCopyPool (21 * sizeof (CHAR16
), Password
);
126 ASSERT (EncodedPassword
!= NULL
);
127 EncodePassword (EncodedPassword
, 20 * sizeof (CHAR16
));
128 if (CompareMem (EncodedPassword
, PrivateData
->Configuration
.WhatIsThePassword2
, 20 * sizeof (CHAR16
)) != 0) {
130 // Old password mismatch, return EFI_NOT_READY to prompt for error message
132 Status
= EFI_NOT_READY
;
134 Status
= EFI_SUCCESS
;
137 gBS
->FreePool (Password
);
138 gBS
->FreePool (EncodedPassword
);
145 DRIVER_SAMPLE_PRIVATE_DATA
*PrivateData
,
146 EFI_STRING_ID StringId
152 DRIVER_SAMPLE_CONFIGURATION
*Configuration
;
155 // Get Buffer Storage data from EFI variable
157 BufferSize
= sizeof (DRIVER_SAMPLE_CONFIGURATION
);
158 Status
= gRT
->GetVariable (
163 &PrivateData
->Configuration
165 if (EFI_ERROR (Status
)) {
170 // Get user input password
172 Password
= &PrivateData
->Configuration
.WhatIsThePassword2
[0];
173 ZeroMem (Password
, 20 * sizeof (CHAR16
));
174 Status
= HiiLibGetString (PrivateData
->HiiHandle
[0], StringId
, Password
, &BufferSize
);
175 if (EFI_ERROR (Status
)) {
180 // Retrive uncommitted data from Browser
182 BufferSize
= sizeof (DRIVER_SAMPLE_CONFIGURATION
);
183 Configuration
= AllocateZeroPool (sizeof (DRIVER_SAMPLE_PRIVATE_DATA
));
184 ASSERT (Configuration
!= NULL
);
185 Status
= GetBrowserData (&mFormSetGuid
, VariableName
, &BufferSize
, (UINT8
*) Configuration
);
186 if (!EFI_ERROR (Status
)) {
188 // Update password's clear text in the screen
190 CopyMem (Configuration
->PasswordClearText
, Password
, 20 * sizeof (CHAR16
));
193 // Update uncommitted data of Browser
195 BufferSize
= sizeof (DRIVER_SAMPLE_CONFIGURATION
);
196 Status
= SetBrowserData (
200 (UINT8
*) Configuration
,
204 gBS
->FreePool (Configuration
);
209 EncodePassword (Password
, 20 * sizeof (CHAR16
));
210 Status
= gRT
->SetVariable(
213 EFI_VARIABLE_NON_VOLATILE
| EFI_VARIABLE_BOOTSERVICE_ACCESS
,
214 sizeof (DRIVER_SAMPLE_CONFIGURATION
),
215 &PrivateData
->Configuration
222 This function allows a caller to extract the current configuration for one
223 or more named elements from the target driver.
225 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
226 @param Request A null-terminated Unicode string in
227 <ConfigRequest> format.
228 @param Progress On return, points to a character in the Request
229 string. Points to the string's null terminator if
230 request was successful. Points to the most recent
231 '&' before the first failing name/value pair (or
232 the beginning of the string if the failure is in
233 the first name/value pair) if the request was not
235 @param Results A null-terminated Unicode string in
236 <ConfigAltResp> format which has all values filled
237 in for the names in the Request string. String to
238 be allocated by the called function.
240 @retval EFI_SUCCESS The Results is filled with the requested values.
241 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.
242 @retval EFI_INVALID_PARAMETER Request is NULL, illegal syntax, or unknown name.
243 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this
250 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
*This
,
251 IN CONST EFI_STRING Request
,
252 OUT EFI_STRING
*Progress
,
253 OUT EFI_STRING
*Results
258 DRIVER_SAMPLE_PRIVATE_DATA
*PrivateData
;
259 EFI_HII_CONFIG_ROUTING_PROTOCOL
*HiiConfigRouting
;
261 PrivateData
= DRIVER_SAMPLE_PRIVATE_FROM_THIS (This
);
262 HiiConfigRouting
= PrivateData
->HiiConfigRouting
;
266 // Get Buffer Storage data from EFI variable
268 BufferSize
= sizeof (DRIVER_SAMPLE_CONFIGURATION
);
269 Status
= gRT
->GetVariable (
274 &PrivateData
->Configuration
276 if (EFI_ERROR (Status
)) {
280 if (Request
== NULL
) {
282 // Request is set to NULL, return all configurable elements together with ALTCFG
284 Status
= ConstructConfigAltResp (
290 PrivateData
->DriverHandle
[0],
291 &PrivateData
->Configuration
,
293 VfrMyIfrNVDataBlockName
,
295 STRING_TOKEN (STR_STANDARD_DEFAULT_PROMPT
),
296 VfrMyIfrNVDataDefault0000
,
297 STRING_TOKEN (STR_MANUFACTURE_DEFAULT_PROMPT
),
298 VfrMyIfrNVDataDefault0001
305 // Check routing data in <ConfigHdr>.
306 // Note: if only one Storage is used, then this checking could be skipped.
308 if (!IsConfigHdrMatch (Request
, &mFormSetGuid
, VariableName
)) {
310 return EFI_NOT_FOUND
;
314 // Convert buffer data to <ConfigResp> by helper function BlockToConfig()
316 Status
= HiiConfigRouting
->BlockToConfig (
319 (UINT8
*) &PrivateData
->Configuration
,
329 This function processes the results of changes in configuration.
331 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
332 @param Configuration A null-terminated Unicode string in <ConfigResp>
334 @param Progress A pointer to a string filled in with the offset of
335 the most recent '&' before the first failing
336 name/value pair (or the beginning of the string if
337 the failure is in the first name/value pair) or
338 the terminating NULL if all was successful.
340 @retval EFI_SUCCESS The Results is processed successfully.
341 @retval EFI_INVALID_PARAMETER Configuration is NULL.
342 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this
349 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
*This
,
350 IN CONST EFI_STRING Configuration
,
351 OUT EFI_STRING
*Progress
356 DRIVER_SAMPLE_PRIVATE_DATA
*PrivateData
;
357 EFI_HII_CONFIG_ROUTING_PROTOCOL
*HiiConfigRouting
;
359 if (Configuration
== NULL
) {
360 return EFI_INVALID_PARAMETER
;
363 PrivateData
= DRIVER_SAMPLE_PRIVATE_FROM_THIS (This
);
364 HiiConfigRouting
= PrivateData
->HiiConfigRouting
;
366 // Check routing data in <ConfigHdr>.
367 // Note: if only one Storage is used, then this checking could be skipped.
369 if (!IsConfigHdrMatch (Configuration
, &mFormSetGuid
, VariableName
)) {
370 *Progress
= Configuration
;
371 return EFI_NOT_FOUND
;
375 // Get Buffer Storage data from EFI variable
377 BufferSize
= sizeof (DRIVER_SAMPLE_CONFIGURATION
);
378 Status
= gRT
->GetVariable (
383 &PrivateData
->Configuration
385 if (EFI_ERROR (Status
)) {
390 // Convert <ConfigResp> to buffer data by helper function ConfigToBlock()
392 BufferSize
= sizeof (DRIVER_SAMPLE_CONFIGURATION
);
393 Status
= HiiConfigRouting
->ConfigToBlock (
396 (UINT8
*) &PrivateData
->Configuration
,
400 if (EFI_ERROR (Status
)) {
405 // Store Buffer Storage back to EFI variable
407 Status
= gRT
->SetVariable(
410 EFI_VARIABLE_NON_VOLATILE
| EFI_VARIABLE_BOOTSERVICE_ACCESS
,
411 sizeof (DRIVER_SAMPLE_CONFIGURATION
),
412 &PrivateData
->Configuration
420 This function processes the results of changes in configuration.
422 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
423 @param Action Specifies the type of action taken by the browser.
424 @param QuestionId A unique value which is sent to the original
425 exporting driver so that it can identify the type
427 @param Type The type of value for the question.
428 @param Value A pointer to the data being sent to the original
430 @param ActionRequest On return, points to the action requested by the
433 @retval EFI_SUCCESS The callback successfully handled the action.
434 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the
435 variable and its data.
436 @retval EFI_DEVICE_ERROR The variable could not be saved.
437 @retval EFI_UNSUPPORTED The specified Action is not supported by the
444 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL
*This
,
445 IN EFI_BROWSER_ACTION Action
,
446 IN EFI_QUESTION_ID QuestionId
,
448 IN EFI_IFR_TYPE_VALUE
*Value
,
449 OUT EFI_BROWSER_ACTION_REQUEST
*ActionRequest
452 DRIVER_SAMPLE_PRIVATE_DATA
*PrivateData
;
454 EFI_HII_UPDATE_DATA UpdateData
;
455 IFR_OPTION
*IfrOptionList
;
458 if ((Value
== NULL
) || (ActionRequest
== NULL
)) {
459 return EFI_INVALID_PARAMETER
;
462 Status
= EFI_SUCCESS
;
463 PrivateData
= DRIVER_SAMPLE_PRIVATE_FROM_THIS (This
);
465 switch (QuestionId
) {
468 // Initialize the container for dynamic opcodes
470 IfrLibInitUpdateData (&UpdateData
, 0x1000);
472 IfrOptionList
= AllocatePool (2 * sizeof (IFR_OPTION
));
473 ASSERT (IfrOptionList
!= NULL
);
475 IfrOptionList
[0].Flags
= 0;
476 IfrOptionList
[0].StringToken
= STRING_TOKEN (STR_BOOT_OPTION1
);
477 IfrOptionList
[0].Value
.u8
= 1;
478 IfrOptionList
[1].Flags
= EFI_IFR_OPTION_DEFAULT
;
479 IfrOptionList
[1].StringToken
= STRING_TOKEN (STR_BOOT_OPTION2
);
480 IfrOptionList
[1].Value
.u8
= 2;
483 0x1237, // Question ID
484 STRING_TOKEN(STR_EXIT_TEXT
), // Prompt text
485 STRING_TOKEN(STR_EXIT_TEXT
), // Help text
486 EFI_IFR_FLAG_CALLBACK
, // Question flag
487 0, // Action String ID
488 &UpdateData
// Container for dynamic created opcodes
492 // Prepare initial value for the dynamic created oneof Question
494 PrivateData
->Configuration
.DynamicOneof
= 2;
495 Status
= gRT
->SetVariable(
498 EFI_VARIABLE_NON_VOLATILE
| EFI_VARIABLE_BOOTSERVICE_ACCESS
,
499 sizeof (DRIVER_SAMPLE_CONFIGURATION
),
500 &PrivateData
->Configuration
503 0x8001, // Question ID (or call it "key")
504 CONFIGURATION_VARSTORE_ID
, // VarStore ID
505 DYNAMIC_ONE_OF_VAR_OFFSET
, // Offset in Buffer Storage
506 STRING_TOKEN (STR_ONE_OF_PROMPT
), // Question prompt text
507 STRING_TOKEN (STR_ONE_OF_HELP
), // Question help text
508 EFI_IFR_FLAG_CALLBACK
, // Question flag
509 EFI_IFR_NUMERIC_SIZE_1
, // Data type of Question Value
510 IfrOptionList
, // Option list
511 2, // Number of options in Option list
512 &UpdateData
// Container for dynamic created opcodes
515 CreateOrderedListOpCode (
516 0x8002, // Question ID
517 CONFIGURATION_VARSTORE_ID
, // VarStore ID
518 DYNAMIC_ORDERED_LIST_VAR_OFFSET
, // Offset in Buffer Storage
519 STRING_TOKEN (STR_BOOT_OPTIONS
), // Question prompt text
520 STRING_TOKEN (STR_BOOT_OPTIONS
), // Question help text
521 EFI_IFR_FLAG_RESET_REQUIRED
, // Question flag
522 0, // Ordered list flag, e.g. EFI_IFR_UNIQUE_SET
523 EFI_IFR_NUMERIC_SIZE_1
, // Data type of Question value
524 5, // Maximum container
525 IfrOptionList
, // Option list
526 2, // Number of options in Option list
527 &UpdateData
// Container for dynamic created opcodes
532 STRING_TOKEN (STR_GOTO_FORM1
), // Prompt text
533 STRING_TOKEN (STR_GOTO_HELP
), // Help text
535 0x8003, // Question ID
536 &UpdateData
// Container for dynamic created opcodes
539 Status
= IfrLibUpdateForm (
540 PrivateData
->HiiHandle
[0], // HII handle
541 &mFormSetGuid
, // Formset GUID
543 0x1234, // Label for where to insert opcodes
544 TRUE
, // Append or replace
545 &UpdateData
// Dynamic created opcodes
547 gBS
->FreePool (IfrOptionList
);
548 IfrLibFreeUpdateData (&UpdateData
);
553 // We will reach here once the Question is refreshed
555 IfrLibInitUpdateData (&UpdateData
, 0x1000);
557 IfrOptionList
= AllocatePool (2 * sizeof (IFR_OPTION
));
558 ASSERT (IfrOptionList
!= NULL
);
561 0x1237, // Question ID
562 STRING_TOKEN(STR_EXIT_TEXT
), // Prompt text
563 STRING_TOKEN(STR_EXIT_TEXT
), // Help text
564 EFI_IFR_FLAG_CALLBACK
, // Question flag
565 0, // Action String ID
566 &UpdateData
// Container for dynamic created opcodes
569 Status
= IfrLibUpdateForm (
570 PrivateData
->HiiHandle
[0], // HII handle
571 &mFormSetGuid
, // Formset GUID
573 0x2234, // Label for where to insert opcodes
574 TRUE
, // Append or replace
575 &UpdateData
// Dynamic created opcodes
577 IfrLibFreeUpdateData (&UpdateData
);
580 // Refresh the Question value
582 PrivateData
->Configuration
.DynamicRefresh
++;
583 Status
= gRT
->SetVariable(
586 EFI_VARIABLE_NON_VOLATILE
| EFI_VARIABLE_BOOTSERVICE_ACCESS
,
587 sizeof (DRIVER_SAMPLE_CONFIGURATION
),
588 &PrivateData
->Configuration
592 // Change an EFI Variable storage (MyEfiVar) asynchronous, this will cause
593 // the first statement in Form 3 be suppressed
596 Status
= gRT
->SetVariable(
599 EFI_VARIABLE_NON_VOLATILE
| EFI_VARIABLE_BOOTSERVICE_ACCESS
,
607 // User press "Exit now", request Browser to exit
609 *ActionRequest
= EFI_BROWSER_ACTION_REQUEST_EXIT
;
614 // User press "Save now", request Browser to save the uncommitted data.
616 *ActionRequest
= EFI_BROWSER_ACTION_REQUEST_SUBMIT
;
621 // When try to set a new password, user will be chanlleged with old password.
622 // The Callback is responsible for validating old password input by user,
623 // If Callback return EFI_SUCCESS, it indicates validation pass.
625 switch (PrivateData
->PasswordState
) {
626 case BROWSER_STATE_VALIDATE_PASSWORD
:
627 Status
= ValidatePassword (PrivateData
, Value
->string
);
628 if (Status
== EFI_SUCCESS
) {
629 PrivateData
->PasswordState
= BROWSER_STATE_SET_PASSWORD
;
633 case BROWSER_STATE_SET_PASSWORD
:
634 Status
= SetPassword (PrivateData
, Value
->string
);
635 PrivateData
->PasswordState
= BROWSER_STATE_VALIDATE_PASSWORD
;
654 IN EFI_HANDLE ImageHandle
,
655 IN EFI_SYSTEM_TABLE
*SystemTable
659 EFI_STATUS SavedStatus
;
660 EFI_HII_PACKAGE_LIST_HEADER
*PackageList
;
661 EFI_HII_HANDLE HiiHandle
[2];
662 EFI_HANDLE DriverHandle
[2];
663 DRIVER_SAMPLE_PRIVATE_DATA
*PrivateData
;
664 EFI_SCREEN_DESCRIPTOR Screen
;
665 EFI_HII_DATABASE_PROTOCOL
*HiiDatabase
;
666 EFI_HII_STRING_PROTOCOL
*HiiString
;
667 EFI_FORM_BROWSER2_PROTOCOL
*FormBrowser2
;
668 EFI_HII_CONFIG_ROUTING_PROTOCOL
*HiiConfigRouting
;
671 DRIVER_SAMPLE_CONFIGURATION
*Configuration
;
672 BOOLEAN ExtractIfrDefault
;
675 // Initialize the library and our protocol.
679 // Initialize screen dimensions for SendForm().
680 // Remove 3 characters from top and bottom
682 ZeroMem (&Screen
, sizeof (EFI_SCREEN_DESCRIPTOR
));
683 gST
->ConOut
->QueryMode (gST
->ConOut
, gST
->ConOut
->Mode
->Mode
, &Screen
.RightColumn
, &Screen
.BottomRow
);
686 Screen
.BottomRow
= Screen
.BottomRow
- 3;
689 // Initialize driver private data
691 PrivateData
= AllocatePool (sizeof (DRIVER_SAMPLE_PRIVATE_DATA
));
692 if (PrivateData
== NULL
) {
693 return EFI_OUT_OF_RESOURCES
;
696 PrivateData
->Signature
= DRIVER_SAMPLE_PRIVATE_SIGNATURE
;
698 PrivateData
->ConfigAccess
.ExtractConfig
= ExtractConfig
;
699 PrivateData
->ConfigAccess
.RouteConfig
= RouteConfig
;
700 PrivateData
->ConfigAccess
.Callback
= DriverCallback
;
701 PrivateData
->PasswordState
= BROWSER_STATE_VALIDATE_PASSWORD
;
704 // Locate Hii Database protocol
706 Status
= gBS
->LocateProtocol (&gEfiHiiDatabaseProtocolGuid
, NULL
, (VOID
**) &HiiDatabase
);
707 if (EFI_ERROR (Status
)) {
710 PrivateData
->HiiDatabase
= HiiDatabase
;
713 // Locate HiiString protocol
715 Status
= gBS
->LocateProtocol (&gEfiHiiStringProtocolGuid
, NULL
, (VOID
**) &HiiString
);
716 if (EFI_ERROR (Status
)) {
719 PrivateData
->HiiString
= HiiString
;
722 // Locate Formbrowser2 protocol
724 Status
= gBS
->LocateProtocol (&gEfiFormBrowser2ProtocolGuid
, NULL
, (VOID
**) &FormBrowser2
);
725 if (EFI_ERROR (Status
)) {
728 PrivateData
->FormBrowser2
= FormBrowser2
;
731 // Locate ConfigRouting protocol
733 Status
= gBS
->LocateProtocol (&gEfiHiiConfigRoutingProtocolGuid
, NULL
, (VOID
**) &HiiConfigRouting
);
734 if (EFI_ERROR (Status
)) {
737 PrivateData
->HiiConfigRouting
= HiiConfigRouting
;
740 // Install Config Access protocol
742 Status
= HiiLibCreateHiiDriverHandle (&DriverHandle
[0]);
743 if (EFI_ERROR (Status
)) {
746 PrivateData
->DriverHandle
[0] = DriverHandle
[0];
748 Status
= gBS
->InstallProtocolInterface (
750 &gEfiHiiConfigAccessProtocolGuid
,
751 EFI_NATIVE_INTERFACE
,
752 &PrivateData
->ConfigAccess
754 ASSERT_EFI_ERROR (Status
);
757 // Publish our HII data
759 PackageList
= HiiLibPreparePackageList (
765 if (PackageList
== NULL
) {
766 return EFI_OUT_OF_RESOURCES
;
769 Status
= HiiDatabase
->NewPackageList (
775 gBS
->FreePool (PackageList
);
776 if (EFI_ERROR (Status
)) {
779 PrivateData
->HiiHandle
[0] = HiiHandle
[0];
782 // Publish another Fromset
784 Status
= HiiLibCreateHiiDriverHandle (&DriverHandle
[1]);
785 if (EFI_ERROR (Status
)) {
788 PrivateData
->DriverHandle
[1] = DriverHandle
[1];
790 PackageList
= HiiLibPreparePackageList (
796 if (PackageList
== NULL
) {
797 return EFI_OUT_OF_RESOURCES
;
800 Status
= HiiDatabase
->NewPackageList (
806 gBS
->FreePool (PackageList
);
807 if (EFI_ERROR (Status
)) {
810 PrivateData
->HiiHandle
[1] = HiiHandle
[1];
813 // Very simple example of how one would update a string that is already
814 // in the HII database
816 NewString
= L
"700 Mhz";
818 Status
= HiiLibSetString (HiiHandle
[0], STRING_TOKEN (STR_CPU_STRING2
), NewString
);
819 if (EFI_ERROR (Status
)) {
824 // Initialize configuration data
826 Configuration
= &PrivateData
->Configuration
;
827 ZeroMem (Configuration
, sizeof (DRIVER_SAMPLE_CONFIGURATION
));
830 // Try to read NV config EFI variable first
832 ExtractIfrDefault
= TRUE
;
833 BufferSize
= sizeof (DRIVER_SAMPLE_CONFIGURATION
);
834 Status
= gRT
->GetVariable (VariableName
, &mFormSetGuid
, NULL
, &BufferSize
, Configuration
);
835 if (!EFI_ERROR (Status
) && (BufferSize
== sizeof (DRIVER_SAMPLE_CONFIGURATION
))) {
836 ExtractIfrDefault
= FALSE
;
839 if (ExtractIfrDefault
) {
841 // EFI variable for NV config doesn't exit, we should build this variable
842 // based on default values stored in IFR
844 BufferSize
= sizeof (DRIVER_SAMPLE_CONFIGURATION
);
845 Status
= IfrLibExtractDefault (Configuration
, &BufferSize
, 1, VfrMyIfrNVDataDefault0000
);
847 if (!EFI_ERROR (Status
)) {
851 EFI_VARIABLE_NON_VOLATILE
| EFI_VARIABLE_BOOTSERVICE_ACCESS
,
852 sizeof (DRIVER_SAMPLE_CONFIGURATION
),
859 // Example of how to display only the item we sent to HII
861 if (DISPLAY_ONLY_MY_ITEM
== 0x0001) {
863 // Have the browser pull out our copy of the data, and only display our data
865 // Status = FormConfig->SendForm (FormConfig, TRUE, HiiHandle, NULL, NULL, NULL, &Screen, NULL);
867 Status
= FormBrowser2
->SendForm (
876 SavedStatus
= Status
;
878 Status
= HiiDatabase
->RemovePackageList (HiiDatabase
, HiiHandle
[0]);
879 if (EFI_ERROR (Status
)) {
883 Status
= HiiDatabase
->RemovePackageList (HiiDatabase
, HiiHandle
[1]);
884 if (EFI_ERROR (Status
)) {
891 // Have the browser pull out all the data in the HII Database and display it.
893 // Status = FormConfig->SendForm (FormConfig, TRUE, 0, NULL, NULL, NULL, NULL, NULL);