/* Get bit field value from the buffer and then set the value for the question. Note: Data type UINT32 can cover all the bit field value. */
VOID GetBitsQuestionValue(IN HII_STATEMENT *Question, IN UINT8 *Buffer, OUT HII_STATEMENT_VALUE *QuestionValue)
/* Get bit field value from the buffer and then set the value for the question. Note: Data type UINT32 can cover all the bit field value. */
VOID GetBitsQuestionValue(IN HII_STATEMENT *Question, IN UINT8 *Buffer, OUT HII_STATEMENT_VALUE *QuestionValue)
{
  UINTN   StartBit;
  UINTN   EndBit;
  UINT32  RetVal;
  UINT32  BufferValue;
  StartBit = Question->BitVarOffset % 8;
  EndBit   = StartBit + Question->BitStorageWidth - 1;
  CopyMem ((UINT8 *)&BufferValue, Buffer, Question->StorageWidth);
  RetVal = BitFieldRead32 (BufferValue, StartBit, EndBit);
  CopyMem ((UINT8 *)&QuestionValue->Value, (UINT8 *)&RetVal, Question->StorageWidth);
}