/* Internal function creates opcode based on the template opcode. */
UINT8* EFIAPI InternalHiiCreateOpCodeExtended(IN VOID *OpCodeHandle, IN VOID *OpCodeTemplate, IN UINT8 OpCode, IN UINTN OpCodeSize, IN UINTN ExtensionSize, IN UINT8 Scope)
/* Internal function creates opcode based on the template opcode. */
UINT8* EFIAPI InternalHiiCreateOpCodeExtended(IN VOID *OpCodeHandle, IN VOID *OpCodeTemplate, IN UINT8 OpCode, IN UINTN OpCodeSize, IN UINTN ExtensionSize, IN UINT8 Scope)
{
  EFI_IFR_OP_HEADER  *Header;
  UINT8              *Buffer;
  ASSERT (OpCodeTemplate != NULL);
  ASSERT ((OpCodeSize + ExtensionSize) <= 0x7F);
  Header         = (EFI_IFR_OP_HEADER *)OpCodeTemplate;
  Header->OpCode = OpCode;
  Header->Scope  = Scope;
  Header->Length = (UINT8)(OpCodeSize + ExtensionSize);
  Buffer         = InternalHiiGrowOpCodeHandle (OpCodeHandle, Header->Length);
  return (UINT8 *)CopyMem (Buffer, Header, OpCodeSize);
}