diff --git a/include/uuid.h b/include/uuid.h index 723b5cf..d17713a 100644 --- a/include/uuid.h +++ b/include/uuid.h @@ -613,7 +613,12 @@ namespace uuids #ifdef _WIN32 GUID newId; - ::CoCreateGuid(&newId); + HRESULT hr = ::CoCreateGuid(&newId); + + if (FAILED(hr)) + { + throw std::system_error(hr, std::system_category(), "CoCreateGuid failed"); + } std::array bytes = { {