Revision: 14034
          http://edk2.svn.sourceforge.net/edk2/?rev=14034&view=rev
Author:   ydong10
Date:     2013-01-06 06:07:38 +0000 (Sun, 06 Jan 2013)
Log Message:
-----------
Base on the type field to generate numeric opcode.

Signed-off-by: Eric Dong <[email protected]>
Reviewed-by: Liming Gao <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdeModulePkg/Library/UefiHiiLib/HiiLib.c

Modified: trunk/edk2/MdeModulePkg/Library/UefiHiiLib/HiiLib.c
===================================================================
--- trunk/edk2/MdeModulePkg/Library/UefiHiiLib/HiiLib.c 2013-01-05 02:43:14 UTC 
(rev 14033)
+++ trunk/edk2/MdeModulePkg/Library/UefiHiiLib/HiiLib.c 2013-01-06 06:07:38 UTC 
(rev 14034)
@@ -1,7 +1,7 @@
 /** @file
   HII Library implementation that uses DXE protocols and services.
 
-  Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
   which accompanies this distribution.  The full text of the license may be 
found at
@@ -2959,9 +2959,11 @@
 {
   EFI_IFR_NUMERIC  OpCode;
   UINTN            Position;
+  UINTN            Length;
 
   ASSERT ((QuestionFlags & (~(EFI_IFR_FLAG_READ_ONLY | EFI_IFR_FLAG_CALLBACK | 
EFI_IFR_FLAG_RESET_REQUIRED))) == 0);
 
+  Length  = 0;
   ZeroMem (&OpCode, sizeof (OpCode));
   OpCode.Question.QuestionId             = QuestionId;
   OpCode.Question.VarStoreId             = VarStoreId;
@@ -2976,33 +2978,39 @@
     OpCode.data.u8.MinValue = (UINT8)Minimum;
     OpCode.data.u8.MaxValue = (UINT8)Maximum;
     OpCode.data.u8.Step     = (UINT8)Step;
+    Length                  = 3;
     break;
 
   case EFI_IFR_NUMERIC_SIZE_2:
     OpCode.data.u16.MinValue = (UINT16)Minimum;
     OpCode.data.u16.MaxValue = (UINT16)Maximum;
     OpCode.data.u16.Step     = (UINT16)Step;
+    Length                   = 6;
     break;
 
   case EFI_IFR_NUMERIC_SIZE_4:
     OpCode.data.u32.MinValue = (UINT32)Minimum;
     OpCode.data.u32.MaxValue = (UINT32)Maximum;
     OpCode.data.u32.Step     = (UINT32)Step;
+    Length                   = 12;
     break;
 
   case EFI_IFR_NUMERIC_SIZE_8:
     OpCode.data.u64.MinValue = Minimum;
     OpCode.data.u64.MaxValue = Maximum;
     OpCode.data.u64.Step     = Step;
+    Length                   = 24;
     break;
   }
 
+  Length += OFFSET_OF (EFI_IFR_NUMERIC, data);
+
   if (DefaultsOpCodeHandle == NULL) {
-    return InternalHiiCreateOpCode (OpCodeHandle, &OpCode, EFI_IFR_NUMERIC_OP, 
sizeof (OpCode));
+    return InternalHiiCreateOpCode (OpCodeHandle, &OpCode, EFI_IFR_NUMERIC_OP, 
Length);
   }
 
   Position = InternalHiiOpCodeHandlePosition (OpCodeHandle);
-  InternalHiiCreateOpCodeExtended (OpCodeHandle, &OpCode, EFI_IFR_NUMERIC_OP, 
sizeof (OpCode), 0, 1);
+  InternalHiiCreateOpCodeExtended (OpCodeHandle, &OpCode, EFI_IFR_NUMERIC_OP, 
Length, 0, 1);
   InternalHiiAppendOpCodes (OpCodeHandle, DefaultsOpCodeHandle);
   HiiCreateEndOpCode (OpCodeHandle);
   return InternalHiiOpCodeHandleBuffer (OpCodeHandle) + Position;

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_123012
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to