UuidCreate 和 CoCreateGuid 之间的区别

Difference between UuidCreate and CoCreateGuid

从 Win32 API 调用 UuidCreate and CoCreateGuid 创建的 UUID 有区别吗?

文档中说CoCreateGuid只是调用了UuidCreate,但是文档中的备注却大相径庭
只有CoCreateGuid特别提到用例:

[...] absolutely unique number that you will use as a persistent identifier in a distributed environment.

而 Uuidcreate 则专注于解释不可追溯性:

[...] generates a UUID that cannot be traced to the ethernet address of the computer on which it was generated. It also cannot be associated with other UUIDs created on the same computer.

我认为差异可能只是历史性的,文档提到 UuidCreate 在过去某个时间出于安全原因从基于 MAC 的版本 1 UUID 更改为随机不可追踪的版本 4。如果需要基于 MAC 的 UUID,则引入 UuidCreateSequential。

如果是这样,UuidCreate 的 return 值(RPC_S_OK、RPC_S_UUID_LOCAL_ONLY、RPC_S_UUID_NO_ADDRESS)如今只是为了兼容旧版而包含在内,基本上已经过时了?

有人知道更多吗?据我所知,没有区别。

CoCreateGuid 调用 UuidCreate.

UuidCreate 曾经是唯一的函数,它是一个 type 1 (mac + datetime) uuid.

后来,一个孩子因为他写的软件是 traced back to his laptop because of his MAC address 而被捕,Windows Vista 更改 UuidCreatetype 4 (随机)uuid.

Microsoft 添加了 UuidCreateSequential 作为遗留 type 1 uuid。

For security reasons, UuidCreate was modified so that it no longer uses a machine's MAC address to generate UUIDs. UuidCreateSequential was introduced to allow creation of UUIDs using the MAC address of a machine's Ethernet card.