diff options
author | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-01-06 06:12:50 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-01-06 06:12:50 +0000 |
commit | a7f87053e00ff8a24664b24f745702fa1ece2d80 (patch) | |
tree | f1e892ea2a05c72bea15b3544487ad7ce7a6faa3 /MdeModulePkg/Library/UefiHiiLib | |
parent | dcf5ba47aeb9cc7b1369afb94ae658b48e2529ca (diff) | |
download | edk2-a7f87053e00ff8a24664b24f745702fa1ece2d80.zip edk2-a7f87053e00ff8a24664b24f745702fa1ece2d80.tar.gz edk2-a7f87053e00ff8a24664b24f745702fa1ece2d80.tar.bz2 |
Base on the type field to get the width of value field for option 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@14036 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Library/UefiHiiLib')
-rw-r--r-- | MdeModulePkg/Library/UefiHiiLib/HiiLib.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c index 02887bf..ba74d0f 100644 --- a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c +++ b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c @@ -946,6 +946,7 @@ InternalHiiValidateCurrentSetting ( UINT16 Offset;
UINT16 Width;
UINT64 VarValue;
+ UINT64 TmpValue;
LIST_ENTRY *Link;
UINT8 *VarBuffer;
UINTN MaxBufferSize;
@@ -1510,7 +1511,9 @@ InternalHiiValidateCurrentSetting ( //
// Check current value is the value of one of option.
//
- if (VarValue == IfrOneOfOption->Value.u64) {
+ TmpValue = 0;
+ CopyMem (&TmpValue, &IfrOneOfOption->Value, IfrOneOfOption->Header.Length - OFFSET_OF (EFI_IFR_ONE_OF_OPTION, Value));
+ if (VarValue == TmpValue) {
//
// The value is one of option value.
// Set OpCode to Zero, don't need check again.
@@ -2628,7 +2631,7 @@ HiiCreateOneOfOptionOpCode ( OpCode.Type = Type;
CopyMem (&OpCode.Value, &Value, mHiiDefaultTypeToWidth[Type]);
- return InternalHiiCreateOpCode (OpCodeHandle, &OpCode, EFI_IFR_ONE_OF_OPTION_OP, sizeof (OpCode));
+ return InternalHiiCreateOpCode (OpCodeHandle, &OpCode, EFI_IFR_ONE_OF_OPTION_OP, OFFSET_OF(EFI_IFR_ONE_OF_OPTION, Value) + mHiiDefaultTypeToWidth[Type]);
}
/**
|