

string Server::GetNewGUID()
{
    UUID uuid = {0};
    string guid;

    // Create uuid or load from a string by UuidFromString() function
    ::UuidCreate(&uuid);

    // If you want to convert uuid to string, use UuidToString() function
    RPC_CSTR szUuid = NULL;
    if (::UuidToStringA(&uuid, &szUuid) == RPC_S_OK)
    {
        guid = (char*) szUuid;
        ::RpcStringFreeA(&szUuid);
    }

    return guid;
}

