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
This commit is contained in:
ydong10
2011-11-24 08:47:57 +00:00
parent 697ecfd313
commit e7fd76d180
4 changed files with 98 additions and 31 deletions

View File

@@ -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;