microsoft / wil

Windows Implementation Library
MIT License
2.58k stars 236 forks source link

THROW_WIN32_IF_MSG / THROW_WIN32_IF_MSG doesn't exist. #377

Open JeffMill opened 1 year ago

JeffMill commented 1 year ago

THROW_WIN32_MSG() exists, but not THROW_WIN32_IF_MSG to avoid someone needing to write:

THROW_HR_IF_MSG(HRESULT_FROM_WIN32(ERROR_NOT_FOUND), (count !=1), "something")
dmachaj commented 1 year ago

Seems reasonable. A lot of scenarios are covered by things like THROW_IF_WIN32_BOOL_FALSE to cover the win32 APIs that return 0 on failure and nonzero on success.