]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Universal/UserInterface/DriverSample/DriverSample.c
Add missing files in msa file and add module description in msa file, and reorganize...
[mirror_edk2.git] / EdkModulePkg / Universal / UserInterface / DriverSample / DriverSample.c
diff --git a/EdkModulePkg/Universal/UserInterface/DriverSample/DriverSample.c b/EdkModulePkg/Universal/UserInterface/DriverSample/DriverSample.c
new file mode 100644 (file)
index 0000000..5f3823c
--- /dev/null
@@ -0,0 +1,631 @@
+/*++\r
+Copyright (c) 2006, Intel Corporation                                                         \r
+All rights reserved. This program and the accompanying materials                          \r
+are licensed and made available under the terms and conditions of the BSD License         \r
+which accompanies this distribution.  The full text of the license may be found at        \r
+http://opensource.org/licenses/bsd-license.php                                            \r
+                                                                                          \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+Module Name:\r
+  DriverSample.c\r
+\r
+Abstract:\r
+\r
+  This is an example of how a driver might export data to the HII protocol to be \r
+  later utilized by the Setup Protocol\r
+\r
+--*/\r
+\r
+#include "DriverSample.h"\r
+\r
+#define DISPLAY_ONLY_MY_ITEM  0x0001\r
+\r
+#define STRING_PACK_GUID \\r
+  { \\r
+    0x8160a85f, 0x934d, 0x468b, { 0xa2, 0x35, 0x72, 0x89, 0x59, 0x14, 0xf6, 0xfc } \\r
+  }\r
+\r
+EFI_GUID  mFormSetGuid    = FORMSET_GUID;\r
+EFI_GUID  mStringPackGuid = STRING_PACK_GUID; \r
+\r
+EFI_STATUS\r
+EFIAPI\r
+DriverCallback (\r
+  IN EFI_FORM_CALLBACK_PROTOCOL       *This,\r
+  IN UINT16                           KeyValue,\r
+  IN EFI_IFR_DATA_ARRAY               *Data,\r
+  OUT EFI_HII_CALLBACK_PACKET         **Packet\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  This is the function that is called to provide results data to the driver.  This data\r
+  consists of a unique key which is used to identify what data is either being passed back\r
+  or being asked for. \r
+\r
+Arguments:\r
+\r
+  KeyValue -        A unique value which is sent to the original exporting driver so that it\r
+                    can identify the type of data to expect.  The format of the data tends to\r
+                    vary based on the op-code that geerated the callback.\r
+\r
+  Data -            A pointer to the data being sent to the original exporting driver.\r
+\r
+Returns: \r
+\r
+--*/\r
+{\r
+  EFI_CALLBACK_INFO       *Private;\r
+  EFI_HII_UPDATE_DATA     *UpdateData;\r
+  EFI_STATUS              Status;\r
+  UINT8                   *Location;\r
+  EFI_HII_CALLBACK_PACKET *DataPacket;\r
+  UINT16                  Value;\r
+  CHAR16                  VariableName[40];\r
+  STATIC UINT16           QuestionId = 0;\r
+  IFR_OPTION              *OptionList;\r
+  UINTN                   Index;\r
+  MyIfrNVData             NVStruc;\r
+\r
+  Private     = EFI_CALLBACK_INFO_FROM_THIS (This);\r
+\r
+  //\r
+  // This should tell me the first offset AFTER the end of the compiled NV map\r
+  // If op-code results are not going to be saved to NV locations ensure the QuestionId\r
+  // is beyond the end of the NVRAM mapping.\r
+  //\r
+  if (QuestionId == 0) {\r
+    QuestionId = sizeof (MyIfrNVData);\r
+  }\r
+\r
+  ZeroMem (VariableName, (sizeof (CHAR16) * 40));\r
+\r
+  switch (KeyValue) {\r
+  case 0x0001:\r
+    //\r
+    // Create a small boot order list\r
+    //\r
+    QuestionId = (UINT16) ((UINTN) (&NVStruc.BootOrder) - (UINTN) (&NVStruc));\r
+\r
+    //\r
+    // Need some memory for OptionList. Allow for up to 8 options.\r
+    //\r
+    OptionList = AllocateZeroPool (sizeof (IFR_OPTION) * 8);\r
+\r
+    //\r
+    // Allocate space for creation of Buffer\r
+    //\r
+    UpdateData = AllocateZeroPool (0x1000);\r
+\r
+    //\r
+    // Remove all the op-codes starting with Label 0x2222 to next Label (second label is for convenience\r
+    // so we don't have to keep track of how many op-codes we added or subtracted.  The rules for removal\r
+    // of op-codes are simply that the removal will always stop as soon as a label or the end of a form is\r
+    // encountered.  Therefore, giving a large obnoxious count such as below takes care of other complexities.\r
+    //\r
+    UpdateData->DataCount = 0xFF;\r
+\r
+    //\r
+    // Delete set of op-codes\r
+    //\r
+    Private->Hii->UpdateForm (\r
+                    Private->Hii,\r
+                    Private->RegisteredHandle,\r
+                    (EFI_FORM_LABEL) 0x2222,\r
+                    FALSE,  // If we aren't adding, we are deleting\r
+                    UpdateData\r
+                    );\r
+\r
+    //\r
+    // Create 3 options\r
+    //\r
+    for (Index = 0; Index < 3; Index++) {\r
+      OptionList[Index].StringToken = (UINT16) (STR_BOOT_OPTION1 + Index);\r
+      OptionList[Index].Value       = (UINT16) (Index + 1);\r
+      OptionList[Index].Flags       = RESET_REQUIRED;\r
+    }\r
+\r
+    CreateOrderedListOpCode (\r
+      QuestionId,                               // Question ID\r
+      8,                                        // Max Entries\r
+      (UINT16) STRING_TOKEN (STR_BOOT_OPTIONS), // Token value for the Prompt\r
+      (UINT16) STRING_TOKEN (STR_NULL_STRING),  // Token value for the Help\r
+      OptionList,\r
+      3,\r
+      &UpdateData->Data                         // Buffer location to place op-codes\r
+      );\r
+\r
+    //\r
+    // For one-of/ordered lists commands, they really consist of 2 op-codes (a header and a footer)\r
+    // Each option within a one-of/ordered list is also an op-code\r
+    // So this example has 5 op-codes it is adding since we have a one-of header + 3 options + one-of footer\r
+    //\r
+    UpdateData->DataCount = 0x5;\r
+\r
+    //\r
+    // Add one op-code\r
+    //\r
+    Private->Hii->UpdateForm (\r
+                    Private->Hii,\r
+                    Private->RegisteredHandle,\r
+                    (EFI_FORM_LABEL) 0x2222,\r
+                    TRUE,\r
+                    UpdateData\r
+                    );\r
+\r
+    gBS->FreePool (UpdateData);\r
+    gBS->FreePool (OptionList);\r
+    break;\r
+\r
+  case 0x0002:\r
+    //\r
+    // Create a large boot order list\r
+    //\r
+    QuestionId = (UINT16) ((UINTN) (&NVStruc.BootOrder) - (UINTN) (&NVStruc));\r
+\r
+    //\r
+    // Need some memory for OptionList. Allow for up to 8 options.\r
+    //\r
+    OptionList = AllocateZeroPool (sizeof (IFR_OPTION) * 8);\r
+\r
+    //\r
+    // Allocate space for creation of Buffer\r
+    //\r
+    UpdateData = AllocateZeroPool (0x1000);\r
+\r
+    //\r
+    // Remove all the op-codes starting with Label 0x2222 to next Label (second label is for convenience\r
+    // so we don't have to keep track of how many op-codes we added or subtracted\r
+    //\r
+    UpdateData->DataCount = 0xFF;\r
+\r
+    //\r
+    // Delete one op-code\r
+    //\r
+    Private->Hii->UpdateForm (\r
+                    Private->Hii,\r
+                    Private->RegisteredHandle,\r
+                    (EFI_FORM_LABEL) 0x2222,\r
+                    FALSE,\r
+                    UpdateData\r
+                    );\r
+\r
+    //\r
+    // Create 4 options\r
+    //\r
+    for (Index = 0; Index < 4; Index++) {\r
+      OptionList[Index].StringToken = (UINT16) (STR_BOOT_OPTION1 + Index);\r
+      OptionList[Index].Value       = (UINT16) (Index + 1);\r
+      OptionList[Index].Flags       = RESET_REQUIRED;\r
+    }\r
+\r
+    CreateOrderedListOpCode (\r
+      QuestionId,                               // Question ID\r
+      8,                                        // Max Entries\r
+      (UINT16) STRING_TOKEN (STR_BOOT_OPTIONS), // Token value for the Prompt\r
+      (UINT16) STRING_TOKEN (STR_NULL_STRING),  // Token value for the Help\r
+      OptionList,\r
+      4,\r
+      &UpdateData->Data                         // Buffer location to place op-codes\r
+      );\r
+\r
+    //\r
+    // For one-of commands, they really consist of 2 op-codes (a header and a footer)\r
+    // Each option within a one-of is also an op-code\r
+    // So this example has 6 op-codes it is adding since we have a one-of header + 4 options + one-of footer\r
+    //\r
+    UpdateData->DataCount = 0x6;\r
+\r
+    //\r
+    // Add one op-code\r
+    //\r
+    Private->Hii->UpdateForm (\r
+                    Private->Hii,\r
+                    Private->RegisteredHandle,\r
+                    (EFI_FORM_LABEL) 0x2222,\r
+                    TRUE,\r
+                    UpdateData\r
+                    );\r
+\r
+    gBS->FreePool (UpdateData);\r
+    gBS->FreePool (OptionList);\r
+    break;\r
+\r
+  case 0x1234:\r
+    //\r
+    // Allocate space for creation of Buffer\r
+    //\r
+    QuestionId = (UINT16) ((UINTN) (&NVStruc.DynamicCheck));\r
+    Status = gBS->AllocatePool (\r
+                    EfiBootServicesData,\r
+                    0x1000,\r
+                    (VOID **) &UpdateData\r
+                    );\r
+\r
+    ZeroMem (UpdateData, 0x1000);\r
+\r
+    Location                        = (UINT8 *) &UpdateData->Data;\r
+\r
+    UpdateData->FormSetUpdate       = TRUE;\r
+    UpdateData->FormCallbackHandle  = (EFI_PHYSICAL_ADDRESS) (UINTN) Private->CallbackHandle;\r
+    UpdateData->FormUpdate          = FALSE;\r
+    UpdateData->FormTitle           = 0;\r
+    UpdateData->DataCount           = 2;\r
+\r
+    CreateGotoOpCode (\r
+      1,\r
+      STR_GOTO_FORM1,                                   // Token value for the Prompt\r
+      0,                                                // Goto Help\r
+      0,                                                // Flags\r
+      0,                                                // Key\r
+      &UpdateData->Data                                 // Buffer location to place op-codes\r
+      );\r
+\r
+    Location = Location + ((EFI_IFR_OP_HEADER *) &UpdateData->Data)->Length;\r
+\r
+    CreateCheckBoxOpCode (\r
+      QuestionId,                                       // Question ID\r
+      1,                                                // Data width (BOOLEAN = 1)\r
+      (UINT16) STRING_TOKEN (STR_CHECK_DYNAMIC_PROMPT), // Token value for the Prompt\r
+      (UINT16) STRING_TOKEN (STR_CHECK_DYNAMIC_HELP),   // Token value for the Help\r
+      EFI_IFR_FLAG_INTERACTIVE,                         // Flags\r
+      0x1236,   // Key\r
+      Location  // Buffer location to place op-codes\r
+      );\r
+\r
+    Private->Hii->UpdateForm (\r
+                    Private->Hii,\r
+                    Private->RegisteredHandle,\r
+                    (EFI_FORM_LABEL) 0x1234,\r
+                    TRUE,\r
+                    UpdateData\r
+                    );\r
+\r
+    gBS->FreePool (UpdateData);\r
+    QuestionId++;\r
+    break;\r
+\r
+  case 0x1235:\r
+    //\r
+    // Allocate space for creation of Buffer\r
+    //\r
+    Status = gBS->AllocatePool (\r
+                    EfiBootServicesData,\r
+                    0x1000,\r
+                    (VOID **)&UpdateData\r
+                    );\r
+\r
+    ZeroMem (UpdateData, 0x1000);\r
+\r
+    //\r
+    // Initialize DataPacket with information intended to remove all\r
+    // previously created op-codes in the dynamic page\r
+    //\r
+    UpdateData->FormSetUpdate       = FALSE;\r
+    UpdateData->FormCallbackHandle  = 0;\r
+    UpdateData->FormUpdate          = FALSE;\r
+    UpdateData->FormTitle           = 0;\r
+    //\r
+    // Unlikely to be more than 0xff op-codes in the dynamic page to remove\r
+    //\r
+    UpdateData->DataCount           = 0xff;\r
+    UpdateData->Data = NULL;\r
+\r
+    //\r
+    // Remove all op-codes from dynamic page\r
+    //\r
+    Private->Hii->UpdateForm (\r
+                    Private->Hii,\r
+                    Private->RegisteredHandle,\r
+                    (EFI_FORM_LABEL) 0x1234,  // Label 0x1234\r
+                    FALSE,                    // Remove Op-codes (will never remove form/endform)\r
+                    UpdateData                // Significant value is UpdateData->DataCount\r
+                    );\r
+\r
+    UpdateData->FormSetUpdate       = FALSE;\r
+    UpdateData->FormCallbackHandle  = 0;\r
+    UpdateData->FormUpdate          = FALSE;\r
+    UpdateData->FormTitle           = 0;\r
+    UpdateData->DataCount           = 1;\r
+\r
+    CreateGotoOpCode (\r
+      1,\r
+      STR_GOTO_FORM1,                         // Token value for the Prompt\r
+      0,                                      // Goto Help\r
+      0,                                      // Flags\r
+      0,                                      // Key\r
+      &UpdateData->Data                       // Buffer location to place op-codes\r
+      );\r
+\r
+    Private->Hii->UpdateForm (\r
+                    Private->Hii,\r
+                    Private->RegisteredHandle,\r
+                    (EFI_FORM_LABEL) 0x1234,\r
+                    TRUE,\r
+                    UpdateData\r
+                    );\r
+\r
+    gBS->FreePool (UpdateData);\r
+    break;\r
+\r
+  case 0x1236:\r
+    //\r
+    // If I hit the checkbox, I enter this case statement...\r
+    //\r
+    //\r
+    // Since I am returning an error (for test purposes) I need to pass in the string for the error\r
+    // I will allocate space for the return value.  If an error occurs (which is the case) I can simply return\r
+    // an error and fill in the string parameter, otherwise, I will return information in the DataArray structure.\r
+    // The browser will free this packet structure\r
+    //\r
+    Status = gBS->AllocatePool (\r
+                    EfiBootServicesData,\r
+                    sizeof (EFI_HII_CALLBACK_PACKET) + sizeof (SAMPLE_STRING) + 2,\r
+                    (VOID **) Packet\r
+                    );\r
+\r
+    ZeroMem (*Packet, sizeof (EFI_HII_CALLBACK_PACKET) + sizeof (SAMPLE_STRING) + 2);\r
+\r
+    //\r
+    // Assign the buffer address to DataPacket\r
+    //\r
+    DataPacket = *Packet;\r
+\r
+    StrCpy (DataPacket->String, (CHAR16 *) SAMPLE_STRING);\r
+    return EFI_DEVICE_ERROR;\r
+\r
+  case 0x1237:\r
+\r
+    Status = gBS->AllocatePool (\r
+                    EfiBootServicesData,\r
+                    sizeof (EFI_HII_CALLBACK_PACKET) + 2,\r
+                    (VOID **) Packet\r
+                    );\r
+\r
+    ZeroMem (*Packet, sizeof (EFI_HII_CALLBACK_PACKET) + 2);\r
+\r
+    //\r
+    // Assign the buffer address to DataPacket\r
+    //\r
+    DataPacket                        = *Packet;\r
+\r
+    DataPacket->DataArray.EntryCount  = 1;\r
+    DataPacket->DataArray.NvRamMap    = NULL;\r
+    ((EFI_IFR_DATA_ENTRY *) (&DataPacket->DataArray + 1))->Flags = EXIT_REQUIRED;\r
+    break;\r
+\r
+  case 0x1555:\r
+    Value = 0x0001;\r
+    UnicodeSPrint (VariableName, 0x80, (CHAR16 *) L"%d", VAR_EQ_TEST_NAME);\r
+\r
+    Status = gRT->SetVariable (\r
+                    VariableName,\r
+                    &mFormSetGuid,\r
+                    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
+                    2,\r
+                    (VOID *) &Value\r
+                    );\r
+    break;\r
+\r
+  case 0x1556:\r
+    Value = 0x1000;\r
+    UnicodeSPrint (VariableName, 0x80, (CHAR16 *) L"%d", VAR_EQ_TEST_NAME);\r
+\r
+    Status = gRT->SetVariable (\r
+                    VariableName,\r
+                    &mFormSetGuid,\r
+                    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
+                    2,\r
+                    (VOID *) &Value\r
+                    );\r
+    break;\r
+\r
+  case 0x1557:\r
+    Value = 0x0000;\r
+    UnicodeSPrint (VariableName, 0x80, (CHAR16 *) L"%d", VAR_EQ_TEST_NAME);\r
+\r
+    Status = gRT->SetVariable (\r
+                    VariableName,\r
+                    &mFormSetGuid,\r
+                    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
+                    2,\r
+                    (VOID *) &Value\r
+                    );\r
+    break;\r
+\r
+  default:\r
+    break;\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+DriverSampleInit (\r
+  IN EFI_HANDLE                   ImageHandle,\r
+  IN EFI_SYSTEM_TABLE             *SystemTable\r
+  )\r
+{\r
+  EFI_STATUS          Status;\r
+  EFI_HII_PROTOCOL    *Hii;\r
+  //\r
+  //  EFI_FORM_BROWSER_PROTOCOL       *FormConfig;\r
+  //\r
+  EFI_HII_PACKAGES    *PackageList;\r
+  EFI_HII_HANDLE      HiiHandle;\r
+  STRING_REF          TokenToUpdate;\r
+  STRING_REF          TokenToUpdate2;\r
+  STRING_REF          TokenToUpdate3;\r
+  CHAR16              *NewString;\r
+  EFI_HII_UPDATE_DATA *UpdateData;\r
+  EFI_CALLBACK_INFO   *CallbackInfo;\r
+  EFI_HANDLE          Handle;\r
+  EFI_SCREEN_DESCRIPTOR   Screen;\r
+\r
+  ZeroMem (&Screen, sizeof (EFI_SCREEN_DESCRIPTOR));\r
+\r
+  gST->ConOut->QueryMode (gST->ConOut, gST->ConOut->Mode->Mode, &Screen.RightColumn, &Screen.BottomRow);\r
+\r
+  //\r
+  // Remove 3 characters from top and bottom\r
+  //\r
+  Screen.TopRow     = 3;\r
+  Screen.BottomRow  = Screen.BottomRow - 3;\r
+\r
+  //\r
+  // There should only be one HII protocol\r
+  //\r
+  Status = gBS->LocateProtocol (\r
+                  &gEfiHiiProtocolGuid,\r
+                  NULL,\r
+                  (VOID **) &Hii\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;;\r
+  }\r
+\r
+  /*\r
+  //\r
+  // There should only be one Form Configuration protocol\r
+  //\r
+  Status = gBS->LocateProtocol (\r
+                 &gEfiFormBrowserProtocolGuid, \r
+                 NULL, \r
+                 &FormConfig\r
+                 );\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;;\r
+  }\r
+*/\r
+  Status = gBS->AllocatePool (\r
+                  EfiBootServicesData,\r
+                  sizeof (EFI_CALLBACK_INFO),\r
+                  (VOID **) &CallbackInfo\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  CallbackInfo->Signature = EFI_CALLBACK_INFO_SIGNATURE;\r
+  CallbackInfo->Hii       = Hii;\r
+\r
+  //\r
+  // This example does not implement worker functions for the NV accessor functions.  Only a callback evaluator\r
+  //\r
+  CallbackInfo->DriverCallback.NvRead   = NULL;\r
+  CallbackInfo->DriverCallback.NvWrite  = NULL;\r
+  CallbackInfo->DriverCallback.Callback = DriverCallback;\r
+\r
+  //\r
+  // Install protocol interface\r
+  //\r
+  Handle = NULL;\r
+  Status = gBS->InstallProtocolInterface (\r
+                  &Handle,\r
+                  &gEfiFormCallbackProtocolGuid,\r
+                  EFI_NATIVE_INTERFACE,\r
+                  &CallbackInfo->DriverCallback\r
+                  );\r
+\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  CallbackInfo->CallbackHandle  = Handle;\r
+\r
+  PackageList                   = PreparePackages (1, &mStringPackGuid, DriverSampleStrings);\r
+  Status                        = Hii->NewPack (Hii, PackageList, &HiiHandle);\r
+  gBS->FreePool (PackageList);\r
+\r
+  PackageList = PreparePackages (1, &mStringPackGuid, InventoryBin);\r
+  Status      = Hii->NewPack (Hii, PackageList, &HiiHandle);\r
+  gBS->FreePool (PackageList);\r
+\r
+  PackageList = PreparePackages (1, &mStringPackGuid, VfrBin);\r
+  Status      = Hii->NewPack (Hii, PackageList, &HiiHandle);\r
+  gBS->FreePool (PackageList);\r
+\r
+  CallbackInfo->RegisteredHandle = HiiHandle;\r
+\r
+  //\r
+  // Very simple example of how one would update a string that is already\r
+  // in the HII database\r
+  //\r
+  TokenToUpdate = (STRING_REF) STR_CPU_STRING2;\r
+  NewString     = (CHAR16 *) L"700 Mhz";\r
+\r
+  Hii->NewString (Hii, NULL, HiiHandle, &TokenToUpdate, NewString);\r
+\r
+  //\r
+  // Add a string - if 0 will be updated with new Token number\r
+  //\r
+  TokenToUpdate = (STRING_REF) 0;\r
+\r
+  //\r
+  // Add a string - if 0 will be updated with new Token number\r
+  //\r
+  TokenToUpdate2 = (STRING_REF) 0;\r
+\r
+  //\r
+  // Add a string - if 0 will be updated with new Token number\r
+  //\r
+  TokenToUpdate3 = (STRING_REF) 0;\r
+\r
+  Hii->NewString (Hii, NULL, HiiHandle, &TokenToUpdate, (CHAR16 *) L"Desired Speed");\r
+  Hii->NewString (Hii, NULL, HiiHandle, &TokenToUpdate2, (CHAR16 *) L"5 Thz");\r
+  Hii->NewString (Hii, NULL, HiiHandle, &TokenToUpdate3, (CHAR16 *) L"This is next year's desired speed - right?");\r
+\r
+  //\r
+  // Allocate space for creation of Buffer\r
+  //\r
+  Status = gBS->AllocatePool (\r
+                  EfiBootServicesData,\r
+                  0x1000,\r
+                  (VOID **) &UpdateData\r
+                  );\r
+\r
+  ZeroMem (UpdateData, 0x1000);\r
+\r
+  //\r
+  // Flag update pending in FormSet\r
+  //\r
+  UpdateData->FormSetUpdate = TRUE;\r
+  //\r
+  // Register CallbackHandle data for FormSet\r
+  //\r
+  UpdateData->FormCallbackHandle = (EFI_PHYSICAL_ADDRESS) (UINTN) CallbackInfo->CallbackHandle;\r
+  UpdateData->FormUpdate  = FALSE;\r
+  UpdateData->FormTitle   = 0;\r
+  UpdateData->DataCount   = 1;\r
+\r
+  CreateTextOpCode (TokenToUpdate, TokenToUpdate2, TokenToUpdate3, 0, 0, &UpdateData->Data);\r
+\r
+  Hii->UpdateForm (Hii, HiiHandle, (EFI_FORM_LABEL) 100, TRUE, UpdateData);\r
+\r
+  gBS->FreePool (UpdateData);\r
+\r
+  //\r
+  // Example of how to display only the item we sent to HII\r
+  //\r
+  if (DISPLAY_ONLY_MY_ITEM == 0x0001) {\r
+    //\r
+    // Have the browser pull out our copy of the data, and only display our data\r
+    //\r
+    //    Status = FormConfig->SendForm (FormConfig, TRUE, HiiHandle, NULL, NULL, NULL, &Screen, NULL);\r
+    //\r
+  } else {\r
+    //\r
+    // Have the browser pull out all the data in the HII Database and display it.\r
+    //\r
+    //    Status = FormConfig->SendForm (FormConfig, TRUE, 0, NULL, NULL, NULL, NULL, NULL);\r
+    //\r
+  }\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r