mirror of https://github.com/acidanthera/audk.git
Correctly get the width of orderedlist question.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9376 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
3cf888f5f9
commit
ff28420b56
|
@ -1043,6 +1043,7 @@ ParseIfrData (
|
||||||
//
|
//
|
||||||
IfrOrderedList = (EFI_IFR_ORDERED_LIST *) IfrOpHdr;
|
IfrOrderedList = (EFI_IFR_ORDERED_LIST *) IfrOpHdr;
|
||||||
if (IfrOrderedList->Question.VarStoreId != VarStorageData->VarStoreId) {
|
if (IfrOrderedList->Question.VarStoreId != VarStorageData->VarStoreId) {
|
||||||
|
BlockData = NULL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1052,24 +1053,6 @@ ParseIfrData (
|
||||||
VarOffset = IfrOrderedList->Question.VarStoreInfo.VarOffset;
|
VarOffset = IfrOrderedList->Question.VarStoreInfo.VarOffset;
|
||||||
VarWidth = IfrOrderedList->MaxContainers;
|
VarWidth = IfrOrderedList->MaxContainers;
|
||||||
|
|
||||||
//
|
|
||||||
// Check whether this question is in requested block array.
|
|
||||||
//
|
|
||||||
if (!BlockArrayCheck (RequestBlockArray, VarOffset, VarWidth)) {
|
|
||||||
//
|
|
||||||
// This question is not in the requested string. Skip it.
|
|
||||||
//
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Check this var question is in the var storage
|
|
||||||
//
|
|
||||||
if ((VarOffset + VarWidth) > VarStorageData->Size) {
|
|
||||||
Status = EFI_INVALID_PARAMETER;
|
|
||||||
goto Done;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Set Block Data
|
// Set Block Data
|
||||||
//
|
//
|
||||||
|
@ -1084,11 +1067,6 @@ ParseIfrData (
|
||||||
BlockData->OpCode = IfrOpHdr->OpCode;
|
BlockData->OpCode = IfrOpHdr->OpCode;
|
||||||
BlockData->Scope = IfrOpHdr->Scope;
|
BlockData->Scope = IfrOpHdr->Scope;
|
||||||
InitializeListHead (&BlockData->DefaultValueEntry);
|
InitializeListHead (&BlockData->DefaultValueEntry);
|
||||||
|
|
||||||
//
|
|
||||||
// Add Block Data into VarStorageData BlockEntry
|
|
||||||
//
|
|
||||||
InsertBlockData (&VarStorageData->BlockEntry, &BlockData);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EFI_IFR_CHECKBOX_OP:
|
case EFI_IFR_CHECKBOX_OP:
|
||||||
|
@ -1385,12 +1363,40 @@ ParseIfrData (
|
||||||
// Invalid ordered list option data type.
|
// Invalid ordered list option data type.
|
||||||
//
|
//
|
||||||
Status = EFI_INVALID_PARAMETER;
|
Status = EFI_INVALID_PARAMETER;
|
||||||
|
FreePool (BlockData);
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Calculate Ordered list QuestionId width.
|
// Calculate Ordered list QuestionId width.
|
||||||
//
|
//
|
||||||
BlockData->Width = (UINT16) (BlockData->Width * VarWidth);
|
BlockData->Width = (UINT16) (BlockData->Width * VarWidth);
|
||||||
|
//
|
||||||
|
// Check whether this question is in requested block array.
|
||||||
|
//
|
||||||
|
if (!BlockArrayCheck (RequestBlockArray, BlockData->Offset, BlockData->Width)) {
|
||||||
|
//
|
||||||
|
// This question is not in the requested string. Skip it.
|
||||||
|
//
|
||||||
|
FreePool (BlockData);
|
||||||
|
BlockData = NULL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// Check this var question is in the var storage
|
||||||
|
//
|
||||||
|
if ((BlockData->Offset + BlockData->Width) > VarStorageData->Size) {
|
||||||
|
Status = EFI_INVALID_PARAMETER;
|
||||||
|
FreePool (BlockData);
|
||||||
|
goto Done;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// Add Block Data into VarStorageData BlockEntry
|
||||||
|
//
|
||||||
|
InsertBlockData (&VarStorageData->BlockEntry, &BlockData);
|
||||||
|
//
|
||||||
|
// No default data for OrderedList.
|
||||||
|
//
|
||||||
BlockData = NULL;
|
BlockData = NULL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue