+ IfrDataArray = AllocateZeroPool (sizeof (FRAMEWORK_EFI_IFR_DATA_ARRAY) + sizeof (FRAMEWORK_EFI_IFR_DATA_ENTRY) + Size);\r
+ ASSERT (IfrDataArray != NULL);\r
+\r
+ BufferStorage = GetStorageFromQuestionId (ConfigAccess->ThunkContext->FormSet, QuestionId);\r
+\r
+ if (BufferStorage == NULL) {\r
+ //\r
+ // The QuestionId is not associated with a Buffer Storage.\r
+ // Try to get the first Buffer Storage then.\r
+ //\r
+ BufferStorage = GetFirstStorageOfFormSet (ConfigAccess->ThunkContext->FormSet);\r
+ }\r
+ \r
+ if (BufferStorage != NULL) {\r
+ BrowserDataSize = BufferStorage->Size;\r
+\r
+ if (ConfigAccess->ThunkContext->NvMapOverride == NULL) {\r
+ *NvMapAllocated = TRUE;\r
+ IfrDataArray->NvRamMap = AllocateZeroPool (BrowserDataSize);\r
+ } else {\r
+ *NvMapAllocated = FALSE;\r
+ IfrDataArray->NvRamMap = ConfigAccess->ThunkContext->NvMapOverride;\r
+ }\r
+ \r
+ Status = GetBrowserData (&BufferStorage->Guid, BufferStorage->Name, &BrowserDataSize, IfrDataArray->NvRamMap);\r
+ ASSERT_EFI_ERROR (Status);\r
+\r
+ IfrDataEntry = (FRAMEWORK_EFI_IFR_DATA_ENTRY *) (IfrDataArray + 1);\r
+\r
+ switch (Type) {\r
+ case EFI_IFR_TYPE_NUM_SIZE_8:\r
+ case EFI_IFR_TYPE_NUM_SIZE_16:\r
+ case EFI_IFR_TYPE_NUM_SIZE_32:\r
+ case EFI_IFR_TYPE_NUM_SIZE_64:\r
+ case EFI_IFR_TYPE_BOOLEAN:\r
+ CopyMem (&IfrDataEntry->Data, &(Value->u8), sizeof (*Value));\r
+ break;\r
+\r
+ case EFI_IFR_TYPE_STRING:\r
+ ASSERT (String != NULL);\r
+ StrCpy ((CHAR16 *) &IfrDataEntry->Data, String);\r
+ FreePool (String);\r
+ break;\r
+ default:\r
+ ASSERT (FALSE);\r
+ break;\r
+ }\r
+\r
+ //\r
+ // Need to fiil in the information for the rest of field for FRAMEWORK_EFI_IFR_DATA_ENTRY.\r
+ // It seems that no implementation is found to use other fields. Leave them uninitialized for now.\r
+ //\r
+ //UINT8 OpCode; // Likely a string, numeric, or one-of\r
+ //UINT8 Length; // Length of the FRAMEWORK_EFI_IFR_DATA_ENTRY packet\r
+ //UINT16 Flags; // Flags settings to determine what behavior is desired from the browser after the callback\r
+ //VOID *Data; // The data in the form based on the op-code type - this is not a pointer to the data, the data follows immediately\r
+ // If the OpCode is a OneOf or Numeric type - Data is a UINT16 value\r
+ // If the OpCode is a String type - Data is a CHAR16[x] type\r
+ // If the OpCode is a Checkbox type - Data is a UINT8 value\r
+ // If the OpCode is a NV Access type - Data is a FRAMEWORK_EFI_IFR_NV_DATA structure\r
+ }\r
+\r