/* If the conversion results in an overflow or an underflow condition, then Result is set to UINTN_ERROR and RETURN_BUFFER_TOO_SMALL is returned. */
RETURN_STATUS EFIAPI SafeUint64ToUintn(IN UINT64 Operand, OUT UINTN *Result)
/* If the conversion results in an overflow or an underflow condition, then Result is set to UINTN_ERROR and RETURN_BUFFER_TOO_SMALL is returned. */
RETURN_STATUS EFIAPI SafeUint64ToUintn(IN UINT64 Operand, OUT UINTN *Result)
{
  if (Result == NULL) {
    return RETURN_INVALID_PARAMETER;
  }
  if (sizeof (UINTN) == sizeof (UINT32)) {
    return SafeUint64ToUint32 ((UINT64)Operand, (UINT32 *)Result);
  }
  *Result = Operand;
  return RETURN_SUCCESS;
}