About GUIDGEN.exe in Visual C++6.0

今天阅读了《com技术内幕》中关于GUID一节,其中写道“GUIDGEN.exe其实调用了Microsoft 的COM库中的CoCreateGuid函数,CoCreateGuid将调用RPC函数UnidCreate”

in MSDN:

The UuidCreate function creates a new UUID.

#include <rpc.h>
RPC_STATUS RPC_ENTRY UuidCreate( 
  UUID *  Uuid  
);
 
Parameters
Uuid
Returns a pointer to the created UUID.
Return Values

ValueMeaning
RPC_S_OKSuccess
RPC_S_UUID_LOCAL_ONLYThe UUID is guaranteed to be unique to this machine only.
RPC_S_UUID_NO_ADDRESSCannot get Ethernet or token-ring hardware address for this computer

Remarks

In Windows NT, versions 4.0 and later, Windows 95, DCOM release, and Windows 98, UuidCreate returns RPC_S_UUID_LOCAL_ONLY when the originating machine does not have an ethernet/token ring (IEEE 802.x) address. In this case, the generated UUID is a valid identifier, and is guaranteed to be unique among all UUIDs generated on the machine. However, the possibility exists that another machine without an ethernet/token ring address generated the identical UUID. Therefore you should never use this UUID to identify an object that is not strictly local to your machine. Machines with ethernet/token ring addresses generate UUIDs that are guaranteed to be globally unique.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值