check CoCreateGuid return value
This commit is contained in:
parent
889fffda69
commit
8068131ec3
@ -613,7 +613,12 @@ namespace uuids
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
GUID newId;
|
GUID newId;
|
||||||
::CoCreateGuid(&newId);
|
HRESULT hr = ::CoCreateGuid(&newId);
|
||||||
|
|
||||||
|
if (FAILED(hr))
|
||||||
|
{
|
||||||
|
throw std::system_error(hr, std::system_category(), "CoCreateGuid failed");
|
||||||
|
}
|
||||||
|
|
||||||
std::array<uint8_t, 16> bytes =
|
std::array<uint8_t, 16> bytes =
|
||||||
{ {
|
{ {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user