12 #if defined (AJA_WINDOWS)
16 unsigned char * str (
NULL);
17 UuidToStringA (&uuid, &str);
19 std::string result (
reinterpret_cast <char *
> (str));
20 RpcStringFreeA (&str);
21 #elif defined (AJA_LINUX)
23 #define GUID_LENGTH 36
25 std::string result (
"");
27 FILE *fp = fopen (
"/proc/sys/kernel/random/uuid",
"r");
30 char guid[GUID_LENGTH + 1];
32 size_t readSize = fread (guid, 1, GUID_LENGTH, fp);
33 if (readSize == GUID_LENGTH)
35 guid [GUID_LENGTH] =
'\0';
36 result = std::string((
const char *) guid);
42 uuid_generate_random (uuid);
44 uuid_unparse (uuid, result);