/* This function checks VarOffset and VarWidth is in the block range. */
BOOLEAN BlockArrayCheck(IN IFR_BLOCK_DATA *BlockArray, IN UINT16 VarOffset, IN UINT16 VarWidth)
/* This function checks VarOffset and VarWidth is in the block range. */
BOOLEAN BlockArrayCheck(IN IFR_BLOCK_DATA *BlockArray, IN UINT16 VarOffset, IN UINT16 VarWidth)
{
  LIST_ENTRY      *Link;
  IFR_BLOCK_DATA  *BlockData;
  if (BlockArray == NULL) {
    return TRUE;
  }
  for (Link = BlockArray->Entry.ForwardLink; Link != &BlockArray->Entry; Link = Link->ForwardLink) {
    BlockData = BASE_CR (Link, IFR_BLOCK_DATA, Entry);
    if ((VarOffset >= BlockData->Offset) && ((VarOffset + VarWidth) <= (BlockData->Offset + BlockData->Width))) {
      return TRUE;
    }
  }
  return FALSE;
}