summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/UefiHiiLib
diff options
context:
space:
mode:
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2013-01-06 06:09:43 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2013-01-06 06:09:43 +0000
commitdcf5ba47aeb9cc7b1369afb94ae658b48e2529ca (patch)
tree0d188687624d911ec1600a994e54f946e4b70b54 /MdeModulePkg/Library/UefiHiiLib
parentd5931219354333223ac45cb2e950e3e4b1fe6267 (diff)
downloadedk2-dcf5ba47aeb9cc7b1369afb94ae658b48e2529ca.zip
edk2-dcf5ba47aeb9cc7b1369afb94ae658b48e2529ca.tar.gz
edk2-dcf5ba47aeb9cc7b1369afb94ae658b48e2529ca.tar.bz2
Base on the type field to generate oneof opcode.
Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14035 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Library/UefiHiiLib')
-rw-r--r--MdeModulePkg/Library/UefiHiiLib/HiiLib.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
index 2135cf2..02887bf 100644
--- a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
+++ b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
@@ -3123,6 +3123,7 @@ HiiCreateOneOfOpCode (
{
EFI_IFR_ONE_OF OpCode;
UINTN Position;
+ UINTN Length;
ASSERT (OptionsOpCodeHandle != NULL);
ASSERT ((QuestionFlags & (~(EFI_IFR_FLAG_READ_ONLY | EFI_IFR_FLAG_CALLBACK | EFI_IFR_FLAG_RESET_REQUIRED | EFI_IFR_FLAG_OPTIONS_ONLY))) == 0);
@@ -3136,8 +3137,11 @@ HiiCreateOneOfOpCode (
OpCode.Question.Flags = QuestionFlags;
OpCode.Flags = OneOfFlags;
+ Length = OFFSET_OF (EFI_IFR_ONE_OF, data);
+ Length += (1 << (OneOfFlags & EFI_IFR_NUMERIC_SIZE)) * 3;
+
Position = InternalHiiOpCodeHandlePosition (OpCodeHandle);
- InternalHiiCreateOpCodeExtended (OpCodeHandle, &OpCode, EFI_IFR_ONE_OF_OP, sizeof (OpCode), 0, 1);
+ InternalHiiCreateOpCodeExtended (OpCodeHandle, &OpCode, EFI_IFR_ONE_OF_OP, Length, 0, 1);
InternalHiiAppendOpCodes (OpCodeHandle, OptionsOpCodeHandle);
if (DefaultsOpCodeHandle != NULL) {
InternalHiiAppendOpCodes (OpCodeHandle, DefaultsOpCodeHandle);