/** @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
}\r
\r
if (OpCode->DevicePath != 0) {\r
- StrPtr = GetToken (OpCode->DevicePath, FormSet->HiiHandle);\r
- if (StrPtr == NULL) {\r
- Value->Type = EFI_IFR_TYPE_UNDEFINED;\r
- break;\r
- }\r
-\r
- DevicePath = ConvertDevicePathFromText(StrPtr);\r
+ Value->Type = EFI_IFR_TYPE_UNDEFINED;\r
\r
- if (!GetQuestionValueFromForm(DevicePath, NULL, &OpCode->Guid, Value->Value.u16, &QuestionVal)){\r
- Value->Type = EFI_IFR_TYPE_UNDEFINED;\r
- } else {\r
- Value = &QuestionVal;\r
+ StrPtr = GetToken (OpCode->DevicePath, FormSet->HiiHandle);\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 (DevicePath != NULL) {\r
- FreePool (DevicePath);\r
+ if (StrPtr != NULL) {\r
+ FreePool (StrPtr);\r
}\r
} else if (CompareGuid (&OpCode->Guid, &gZeroGuid) != 0) {\r
if (!GetQuestionValueFromForm(NULL, FormSet->HiiHandle, &OpCode->Guid, Value->Value.u16, &QuestionVal)){\r
/** @file\r
Utility functions for UI presentation.\r
\r
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 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
gSaveChanges = GetToken (STRING_TOKEN (SAVE_CHANGES), gHiiHandle);\r
gOptionMismatch = GetToken (STRING_TOKEN (OPTION_MISMATCH), gHiiHandle);\r
gFormSuppress = GetToken (STRING_TOKEN (FORM_SUPPRESSED), gHiiHandle);\r
+ gProtocolNotFound = GetToken (STRING_TOKEN (PROTOCOL_NOT_FOUND), gHiiHandle);\r
return ;\r
}\r
\r
FreePool (gSaveChanges);\r
FreePool (gOptionMismatch);\r
FreePool (gFormSuppress);\r
+ FreePool (gProtocolNotFound);\r
return ;\r
}\r
\r
/** @file\r
Entry and initialization module for the browser.\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
EFI_HII_DATABASE_PROTOCOL *mHiiDatabase;\r
EFI_HII_STRING_PROTOCOL *mHiiString;\r
EFI_HII_CONFIG_ROUTING_PROTOCOL *mHiiConfigRouting;\r
+EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *mPathFromText;\r
\r
UINTN gBrowserContextCount = 0;\r
LIST_ENTRY gBrowserContextList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserContextList);\r
CHAR16 *gSaveChanges;\r
CHAR16 *gOptionMismatch;\r
CHAR16 *gFormSuppress;\r
+CHAR16 *gProtocolNotFound;\r
\r
CHAR16 *mUnknownString = L"!";\r
\r
);\r
ASSERT_EFI_ERROR (Status);\r
\r
+ Status = gBS->LocateProtocol (\r
+ &gEfiDevicePathFromTextProtocolGuid,\r
+ NULL,\r
+ (VOID **) &mPathFromText\r
+ );\r
+\r
//\r
// Publish our HII data\r
//\r
gHelpBlockWidth = Context->HelpBlockWidth;\r
gOldFormSet = Context->OldFormSet;\r
gMenuRefreshHead = Context->MenuRefreshHead;\r
+ gProtocolNotFound = Context->ProtocolNotFound;\r
\r
CopyMem (&gScreenDimensions, &Context->ScreenDimensions, sizeof (gScreenDimensions));\r
CopyMem (&gMenuOption, &Context->MenuOption, sizeof (gMenuOption));\r
/** @file\r
Private MACRO, structure and function definitions for Setup Browser module.\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
#include <Protocol/HiiDatabase.h>\r
#include <Protocol/HiiString.h>\r
#include <Protocol/UserManager.h>\r
+#include <Protocol/DevicePathFromText.h>\r
\r
#include <Guid/MdeModuleHii.h>\r
#include <Guid/HiiPlatformSetupFormset.h>\r
CHAR16 *SaveChanges;\r
CHAR16 *OptionMismatch;\r
CHAR16 *FormSuppress;\r
+ CHAR16 *ProtocolNotFound;\r
CHAR16 PromptBlockWidth;\r
CHAR16 OptionBlockWidth;\r
CHAR16 HelpBlockWidth;\r
extern EFI_HII_DATABASE_PROTOCOL *mHiiDatabase;\r
extern EFI_HII_STRING_PROTOCOL *mHiiString;\r
extern EFI_HII_CONFIG_ROUTING_PROTOCOL *mHiiConfigRouting;\r
+extern EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *mPathFromText;\r
\r
extern BANNER_DATA *gBannerData;\r
extern EFI_HII_HANDLE gFrontPageHandle;\r
extern CHAR16 *gSaveChanges;\r
extern CHAR16 *gOptionMismatch;\r
extern CHAR16 *gFormSuppress;\r
+extern CHAR16 *gProtocolNotFound;\r
\r
extern CHAR16 gPromptBlockWidth;\r
extern CHAR16 gOptionBlockWidth;\r
## @file\r
# The DXE driver produces FORM BROWSER protocols defined in UEFI HII 2.1 specificatin.\r
#\r
-# Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
gEfiHiiDatabaseProtocolGuid ## CONSUMES\r
gEfiUnicodeCollation2ProtocolGuid ## CONSUMES\r
gEfiUserManagerProtocolGuid ## SOMETIMES_CONSUMES\r
+ gEfiDevicePathFromTextProtocolGuid ## SOMETIMES_CONSUMES\r
\r
[FeaturePcd]\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkCompatibilitySupport ## CONSUMES\r
/** @file\r
Utility functions for User Interface functions.\r
\r
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 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
return HiiHandle;\r
}\r
\r
-/**\r
- Transfer the device path string to binary format.\r
-\r
- @param StringPtr The device path string info.\r
-\r
- @retval Device path binary info.\r
-\r
-**/\r
-EFI_DEVICE_PATH_PROTOCOL *\r
-ConvertDevicePathFromText (\r
- IN CHAR16 *StringPtr\r
- )\r
-{\r
- UINTN BufferSize;\r
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
- CHAR16 TemStr[2];\r
- UINT8 *DevicePathBuffer;\r
- UINTN Index;\r
- UINT8 DigitUint8;\r
-\r
- ASSERT (StringPtr != NULL);\r
-\r
- BufferSize = StrLen (StringPtr) / 2;\r
- DevicePath = AllocatePool (BufferSize);\r
- ASSERT (DevicePath != NULL);\r
- \r
- //\r
- // Convert from Device Path String to DevicePath Buffer in the reverse order.\r
- //\r
- DevicePathBuffer = (UINT8 *) DevicePath;\r
- for (Index = 0; StringPtr[Index] != L'\0'; Index ++) {\r
- TemStr[0] = StringPtr[Index];\r
- DigitUint8 = (UINT8) StrHexToUint64 (TemStr);\r
- if (DigitUint8 == 0 && TemStr[0] != L'0') {\r
- //\r
- // Invalid Hex Char as the tail.\r
- //\r
- break;\r
- }\r
- if ((Index & 1) == 0) {\r
- DevicePathBuffer [Index/2] = DigitUint8;\r
- } else {\r
- DevicePathBuffer [Index/2] = (UINT8) ((DevicePathBuffer [Index/2] << 4) + DigitUint8);\r
- }\r
- }\r
-\r
- return DevicePath;\r
-}\r
-\r
/**\r
Process the goto op code, update the info in the selection structure.\r
\r
if (Selection->Form->ModalForm) {\r
return Status;\r
}\r
+\r
//\r
// Goto another Hii Package list\r
//\r
- Selection->Action = UI_ACTION_REFRESH_FORMSET;\r
- DevicePath = ConvertDevicePathFromText (StringPtr);\r
-\r
- Selection->Handle = DevicePathToHiiHandle (DevicePath);\r
- FreePool (DevicePath);\r
- FreePool (StringPtr);\r
+ if (mPathFromText != NULL) {\r
+ DevicePath = mPathFromText->ConvertTextToDevicePath(StringPtr);\r
+ if (DevicePath != NULL) {\r
+ Selection->Handle = DevicePathToHiiHandle (DevicePath);\r
+ FreePool (DevicePath);\r
+ }\r
+ FreePool (StringPtr);\r
+ } else {\r
+ //\r
+ // Not found the EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL protocol.\r
+ //\r
+ do {\r
+ CreateDialog (4, TRUE, 0, NULL, &Key, gEmptyString, gProtocolNotFound, gPressEnter, gEmptyString);\r
+ } while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);\r
+ if (Repaint != NULL) {\r
+ *Repaint = TRUE;\r
+ }\r
+ FreePool (StringPtr);\r
+ return Status;\r
+ }\r
\r
+ Selection->Action = UI_ACTION_REFRESH_FORMSET;\r
if (Selection->Handle == NULL) {\r
//\r
// If target Hii Handle not found, exit\r
/** @file\r
Private structure, MACRO and function definitions for User Interface related functionalities.\r
\r
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 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
IN FORM_BROWSER_FORM *Form OPTIONAL\r
);\r
\r
-/**\r
- Transfer the device path string to binary format.\r
-\r
- @param StringPtr The device path string info.\r
-\r
- @retval Device path binary info.\r
-\r
-**/\r
-EFI_DEVICE_PATH_PROTOCOL *\r
-ConvertDevicePathFromText (\r
- IN CHAR16 *StringPtr\r
- );\r
-\r
#endif // _UI_H\r