}\r
\r
/**\r
- Get the EFI_IFR_VARSTORE where the Question's value is stored.\r
+ Get the FORM_BROWSER_STATEMENT that matches the Question's value.\r
\r
@param FormSet The Form Set.\r
+ @param QuestionId QuestionId\r
\r
- @retval FORMSET_STORAGE * The EFI_IFR_VARSTORE where the Question's value is stored.\r
- @retval NULL If the Form Set does not have EFI_IFR_VARSTORE.\r
+ @retval FORM_BROWSER_STATEMENT* FORM_BROWSER_STATEMENT that match Question's value.\r
+ @retval NULL If the Form Set does not have EFI_IFR_VARSTORE.\r
**/\r
-FORMSET_STORAGE *\r
+FORM_BROWSER_STATEMENT *\r
GetStorageFromQuestionId (\r
IN CONST FORM_BROWSER_FORMSET * FormSet,\r
IN EFI_QUESTION_ID QuestionId\r
// UEFI Question ID is unique in a FormSet.\r
//\r
ASSERT (Statement->Storage->Type == EFI_HII_VARSTORE_BUFFER);\r
- return Statement->Storage;\r
+ return Statement;\r
}\r
StatementList = GetNextNode (&Form->StatementListHead, StatementList);\r
}\r
FORMSET_STORAGE *BufferStorage;\r
UINTN Size;\r
EFI_STRING String;\r
+ FORM_BROWSER_STATEMENT *Statement;\r
\r
*NvMapAllocated = FALSE;\r
\r
\r
IfrDataArray = AllocateZeroPool (sizeof (EFI_IFR_DATA_ARRAY) + sizeof (EFI_IFR_DATA_ENTRY) + Size);\r
ASSERT (IfrDataArray != NULL);\r
+ IfrDataArray->EntryCount = 1;\r
+ IfrDataEntry = (EFI_IFR_DATA_ENTRY *) (IfrDataArray + 1);\r
\r
- BufferStorage = GetStorageFromQuestionId (ConfigAccess->ThunkContext->FormSet, QuestionId);\r
+ Statement = GetStorageFromQuestionId (ConfigAccess->ThunkContext->FormSet, QuestionId);\r
\r
- if (BufferStorage == NULL) {\r
+ if (Statement == NULL || Statement->Storage == 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
+ } else {\r
+ BufferStorage = Statement->Storage;\r
+ IfrDataEntry->OpCode = Statement->Operand;\r
}\r
\r
if (BufferStorage != NULL) {\r
- BrowserDataSize = BufferStorage->Size;\r
+ BrowserDataSize = BufferStorage->Size;\r
+ IfrDataEntry->Length = (UINT8) (sizeof (EFI_IFR_DATA_ENTRY) + Size);\r
\r
if (ConfigAccess->ThunkContext->NvMapOverride == NULL) {\r
*NvMapAllocated = TRUE;\r
}\r
\r
ASSERT (HiiGetBrowserData (&BufferStorage->Guid, BufferStorage->Name, BrowserDataSize, (UINT8 *) IfrDataArray->NvRamMap));\r
- IfrDataEntry = (EFI_IFR_DATA_ENTRY *) (IfrDataArray + 1);\r
\r
switch (Type) {\r
case EFI_IFR_TYPE_NUM_SIZE_8:\r
FORMSET_STORAGE *BufferStorage;\r
BOOLEAN CheckFlag;\r
UINTN BrowserDataSize;\r
+ FORM_BROWSER_STATEMENT *Statement;\r
\r
if (ConfigAccess->ThunkContext->NvMapOverride != NULL) {\r
\r
- BufferStorage = GetStorageFromQuestionId (ConfigAccess->ThunkContext->FormSet, QuestionId);\r
+ Statement = GetStorageFromQuestionId (ConfigAccess->ThunkContext->FormSet, QuestionId);\r
\r
- if (BufferStorage == NULL) {\r
+ if (Statement == NULL || Statement->Storage == NULL) {\r
//\r
// QuestionId is a statement without Storage.\r
// 1) It is a Goto. \r
// \r
//\r
BufferStorage = GetFirstStorageOfFormSet (ConfigAccess->ThunkContext->FormSet);\r
+ } else {\r
+ BufferStorage = Statement->Storage;\r
}\r
\r
//\r