diff --git a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/ErrorHandling.h b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/ErrorHandling.h index d358a30e7e..c59ad56e43 100644 --- a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/ErrorHandling.h +++ b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/ErrorHandling.h @@ -60,13 +60,13 @@ #endif #ifdef ORT_NO_EXCEPTIONS -#define ORT_THROW_HR_IF(hr, condition) ORT_ENFORCE(condition, hr) +#define ORT_THROW_HR_IF(hr, condition) ORT_ENFORCE(!(condition), hr) #else #define ORT_THROW_HR_IF(hr, condition) THROW_HR_IF(hr, condition) #endif #ifdef ORT_NO_EXCEPTIONS -#define ORT_THROW_LAST_ERROR_IF(condition) ORT_ENFORCE(condition) +#define ORT_THROW_LAST_ERROR_IF(condition) ORT_ENFORCE(!(condition)) #else #define ORT_THROW_LAST_ERROR_IF(condition) THROW_LAST_ERROR_IF(condition) #endif