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