/* Copy the generic stub into the new buffer and fixup the vector number and jump target address. */
VOID CreateEntryStub(IN EFI_EXCEPTION_TYPE ExceptionType, OUT VOID **Stub)
/* Copy the generic stub into the new buffer and fixup the vector number and jump target address. */
VOID CreateEntryStub(IN EFI_EXCEPTION_TYPE ExceptionType, OUT VOID **Stub)
{
  UINT8  *StubCopy;
  StubCopy = *Stub;
  StubCopy[0x1] = (UINT8)ExceptionType;
  *(UINT32 *)&StubCopy[0x3] = (UINT32)((UINTN)CommonIdtEntry - (UINTN)&StubCopy[StubSize]);
  return;
}