- case 0x5678:\r
- case 0x1247:\r
- //\r
- // We will reach here once the Question is refreshed\r
- //\r
-\r
- //\r
- // Initialize the container for dynamic opcodes\r
- //\r
- StartOpCodeHandle = HiiAllocateOpCodeHandle ();\r
- ASSERT (StartOpCodeHandle != NULL);\r
-\r
- //\r
- // Create Hii Extend Label OpCode as the start opcode\r
- //\r
- StartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (StartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));\r
- StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;\r
- if (QuestionId == 0x5678) {\r
- StartLabel->Number = LABEL_UPDATE2;\r
- FormId = 0x03;\r
- PrivateData->Configuration.DynamicRefresh++;\r
- } else if (QuestionId == 0x1247 ) {\r
- StartLabel->Number = LABEL_UPDATE3;\r
- FormId = 0x05;\r
- PrivateData->Configuration.RefreshGuidCount++;\r
- }\r
-\r
- HiiCreateActionOpCode (\r
- StartOpCodeHandle, // Container for dynamic created opcodes\r
- 0x1237, // Question ID\r
- STRING_TOKEN(STR_EXIT_TEXT), // Prompt text\r
- STRING_TOKEN(STR_EXIT_TEXT), // Help text\r
- EFI_IFR_FLAG_CALLBACK, // Question flag\r
- 0 // Action String ID\r
- );\r
-\r
- HiiUpdateForm (\r
- PrivateData->HiiHandle[0], // HII handle\r
- &mFormSetGuid, // Formset GUID\r
- FormId, // Form ID\r
- StartOpCodeHandle, // Label for where to insert opcodes\r
- NULL // Insert data\r
- );\r
-\r
- HiiFreeOpCodeHandle (StartOpCodeHandle);\r
-\r
- //\r
- // Refresh the Question value\r
- //\r
- Status = gRT->SetVariable(\r
- VariableName,\r
- &mFormSetGuid,\r
- EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,\r
- sizeof (DRIVER_SAMPLE_CONFIGURATION),\r
- &PrivateData->Configuration\r
- );\r
-\r
- if (QuestionId == 0x5678) {\r
- //\r
- // Change an EFI Variable storage (MyEfiVar) asynchronous, this will cause\r
- // the first statement in Form 3 be suppressed\r
- //\r
- MyVarSize = 1;\r
- MyVar = 111;\r
- Status = gRT->SetVariable(\r
- L"MyVar",\r
- &mFormSetGuid,\r
- EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,\r
- MyVarSize,\r
- &MyVar\r
- );\r
- }\r
- break;\r
-\r
- case 0x1237:\r
- //\r
- // User press "Exit now", request Browser to exit\r
- //\r
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;\r
- break;\r
-\r
- case 0x1238:\r
- //\r
- // User press "Save now", request Browser to save the uncommitted data.\r
- //\r
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;\r
- break;\r
-\r
- case 0x1241:\r
- case 0x1246:\r
- //\r
- // User press "Submit current form and Exit now", request Browser to submit current form and exit\r
- //\r
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;\r
- break;\r
-\r
- case 0x1242:\r
- //\r
- // User press "Discard current form now", request Browser to discard the uncommitted data.\r
- //\r
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD;\r
- break;\r
-\r
- case 0x1243:\r
- //\r
- // User press "Submit current form now", request Browser to save the uncommitted data.\r
- //\r
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;\r
- break;\r
-\r
- case 0x1244:\r
- case 0x1245:\r
- //\r
- // User press "Discard current form and Exit now", request Browser to discard the uncommitted data and exit.\r
- //\r
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT;\r
- break;\r
-\r