About GUIDGEN.exe in Visual C++6.0

來源:互聯網
上載者:User

今天閱讀了《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

Value Meaning
RPC_S_OK Success
RPC_S_UUID_LOCAL_ONLY The UUID is guaranteed to be unique to this machine only.
RPC_S_UUID_NO_ADDRESS Cannot 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.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.