summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
diff options
context:
space:
mode:
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-11-24 08:47:57 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-11-24 08:47:57 +0000
commite7fd76d180744440db7b5a91a7787ca39713da05 (patch)
treec272e20dc3bca62a890dd363184021ebb32fb048 /MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
parent697ecfd313e6c21a7d01a9eec618174cc4136fb8 (diff)
downloadedk2-platforms-e7fd76d180744440db7b5a91a7787ca39713da05.tar.xz
Patch includes:
1. Support get default value for ref opcode logic. 2. Correct the sample for ref opcode with default value. 3. Refine logic about processing device path info in ref value. Signed-off-by: ydong10 Reviewed-by: lgao4 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12774 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/SetupBrowserDxe/Ui.c')
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Ui.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
index 0be50263dd..ebe8fae2cc 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
@@ -1891,6 +1891,7 @@ ProcessGotoOpCode (
)
{
CHAR16 *StringPtr;
+ UINTN StringLen;
UINTN BufferSize;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
CHAR16 TemStr[2];
@@ -1905,8 +1906,23 @@ ProcessGotoOpCode (
Status = EFI_SUCCESS;
UpdateFormInfo = TRUE;
+ StringPtr = NULL;
+ StringLen = 0;
+ //
+ // Prepare the device path check, get the device path info first.
+ //
if (Statement->HiiValue.Value.ref.DevicePath != 0) {
+ StringPtr = GetToken (Statement->HiiValue.Value.ref.DevicePath, Selection->FormSet->HiiHandle);
+ if (StringPtr != NULL) {
+ StringLen = StrLen (StringPtr);
+ }
+ }
+
+ //
+ // Check whether the device path string is a valid string.
+ //
+ if (Statement->HiiValue.Value.ref.DevicePath != 0 && StringPtr != NULL && StringLen != 0) {
if (Selection->Form->ModalForm) {
return Status;
}
@@ -1914,16 +1930,6 @@ ProcessGotoOpCode (
// Goto another Hii Package list
//
Selection->Action = UI_ACTION_REFRESH_FORMSET;
-
- StringPtr = GetToken (Statement->HiiValue.Value.ref.DevicePath, Selection->FormSet->HiiHandle);
- if (StringPtr == NULL) {
- //
- // No device path string not found, exit
- //
- Selection->Action = UI_ACTION_EXIT;
- Selection->Statement = NULL;
- return Status;
- }
BufferSize = StrLen (StringPtr) / 2;
DevicePath = AllocatePool (BufferSize);
ASSERT (DevicePath != NULL);
@@ -1947,8 +1953,11 @@ ProcessGotoOpCode (
DevicePathBuffer [Index/2] = (UINT8) ((DevicePathBuffer [Index/2] << 4) + DigitUint8);
}
}
+ FreePool (StringPtr);
Selection->Handle = DevicePathToHiiHandle (DevicePath);
+ FreePool (DevicePath);
+
if (Selection->Handle == NULL) {
//
// If target Hii Handle not found, exit
@@ -1958,9 +1967,6 @@ ProcessGotoOpCode (
return Status;
}
- FreePool (StringPtr);
- FreePool (DevicePath);
-
CopyMem (&Selection->FormSetGuid,&Statement->HiiValue.Value.ref.FormSetGuid, sizeof (EFI_GUID));
Selection->FormId = Statement->HiiValue.Value.ref.FormId;
Selection->QuestionId = Statement->HiiValue.Value.ref.QuestionId;