/** @file\r
Utility functions for expression evaluation.\r
\r
-Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
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
IdToForm (\r
IN FORM_BROWSER_FORMSET *FormSet,\r
IN UINT16 FormId\r
-)\r
+ )\r
{\r
LIST_ENTRY *Link;\r
FORM_BROWSER_FORM *Form;\r
// to keep synchronous, always reload the Question Value.\r
//\r
if (Question->Storage->Type == EFI_HII_VARSTORE_EFI_VARIABLE) {\r
- GetQuestionValue (FormSet, Form, Question, FALSE);\r
+ GetQuestionValue (FormSet, Form, Question, GetSetValueWithHiiDriver);\r
}\r
\r
return Question;\r
CopyMem (TmpBuf, Value.Buffer, Value.BufferLen * sizeof (CHAR16));\r
PrintFormat = L"%s"; \r
}\r
- UnicodeSPrint (Buffer, MAXIMUM_VALUE_CHARACTERS, PrintFormat, Value.Buffer); \r
+ UnicodeSPrint (Buffer, sizeof (Buffer), PrintFormat, Value.Buffer); \r
String = Buffer; \r
FreePool (TmpBuf);\r
FreePool (Value.Buffer);\r
UINTN Base;\r
UINTN Length;\r
CHAR16 *SubString;\r
- UINT8 *Buffer;\r
UINT16 BufferLen;\r
\r
ZeroMem (Value, sizeof (Value));\r
\r
FreePool (String);\r
} else {\r
- Buffer = Value[2].Buffer;\r
BufferLen = Value[2].BufferLen;\r
\r
Result->Type = EFI_IFR_TYPE_BUFFER;\r
//\r
FormSet = AllocateZeroPool (sizeof (FORM_BROWSER_FORMSET));\r
ASSERT (FormSet != NULL);\r
- Status = InitializeFormSet(HiiHandle, FormSetGuid, FormSet, FALSE);\r
+ Status = InitializeFormSet(HiiHandle, FormSetGuid, FormSet);\r
if (EFI_ERROR (Status)) {\r
GetTheVal = FALSE;\r
goto Done;\r
//\r
// Get the question value.\r
//\r
- Status = GetQuestionValue(FormSet, Form, Question, FALSE);\r
+ Status = GetQuestionValue(FormSet, Form, Question, GetSetValueWithHiiDriver);\r
if (EFI_ERROR (Status)) {\r
GetTheVal = FALSE;\r
goto Done;\r
UINT8 *TempBuffer;\r
EFI_TIME EfiTime;\r
EFI_HII_VALUE QuestionVal;\r
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
\r
//\r
// Save current stack offset.\r
//\r
// Get value from string except for STRING value.\r
//\r
- Status = GetValueByName (OpCode->VarStorage, OpCode->ValueName, &StrPtr);\r
+ Status = GetValueByName (OpCode->VarStorage, OpCode->ValueName, &StrPtr, GetSetValueWithEditBuffer);\r
if (!EFI_ERROR (Status)) {\r
ASSERT (StrPtr != NULL);\r
TempLength = StrLen (StrPtr);\r
}\r
\r
if (OpCode->DevicePath != 0) {\r
+ Value->Type = EFI_IFR_TYPE_UNDEFINED;\r
+\r
StrPtr = GetToken (OpCode->DevicePath, FormSet->HiiHandle);\r
- if (StrPtr == NULL) {\r
- Value->Type = EFI_IFR_TYPE_UNDEFINED;\r
- break;\r
+ if (StrPtr != NULL && mPathFromText != NULL) {\r
+ DevicePath = mPathFromText->ConvertTextToDevicePath(StrPtr);\r
+ if (DevicePath != NULL && GetQuestionValueFromForm(DevicePath, NULL, &OpCode->Guid, Value->Value.u16, &QuestionVal)) {\r
+ Value = &QuestionVal;\r
+ }\r
+ if (DevicePath != NULL) {\r
+ FreePool (DevicePath);\r
+ }\r
}\r
\r
- if (!GetQuestionValueFromForm((EFI_DEVICE_PATH_PROTOCOL*)StrPtr, NULL, &OpCode->Guid, Value->Value.u16, &QuestionVal)){\r
- Value->Type = EFI_IFR_TYPE_UNDEFINED;\r
- break;\r
+ if (StrPtr != NULL) {\r
+ FreePool (StrPtr);\r
}\r
- Value = &QuestionVal;\r
} else if (CompareGuid (&OpCode->Guid, &gZeroGuid) != 0) {\r
if (!GetQuestionValueFromForm(NULL, FormSet->HiiHandle, &OpCode->Guid, Value->Value.u16, &QuestionVal)){\r
Value->Type = EFI_IFR_TYPE_UNDEFINED;\r
for (Index = 0; Index < OpCode->ValueWidth; Index ++, TempBuffer --) {\r
StrPtr += UnicodeValueToString (StrPtr, PREFIX_ZERO | RADIX_HEX, *TempBuffer, 2);\r
}\r
- Status = SetValueByName (OpCode->VarStorage, OpCode->ValueName, NameValue, TRUE);\r
+ Status = SetValueByName (OpCode->VarStorage, OpCode->ValueName, NameValue, GetSetValueWithEditBuffer, NULL);\r
FreePool (NameValue);\r
if (!EFI_ERROR (Status)) {\r
Data1.Value.b = TRUE;\r