开发者

What is the recommended way to define a GUID for a driver?

开发者 https://www.devze.com 2023-03-21 19:21 出处:网络
I would like to define/generate a GUID (interface class) for my test driver. What is the best way to do that \'programatically using C/C++\' so it won\'t conflict with other devices/drivers in the sys

I would like to define/generate a GUID (interface class) for my test driver. What is the best way to do that 'programatically using C/C++' so it won't conflict with other devices/drivers in the system?

Also, are there a开发者_StackOverflowny standard guidelines to follow or other things to keep in mind while creating a new GUID?

Please suggest.


Use a GUID generator. There is one bundled with Visual Studio. In 2008, it's under Tools > Create GUID.


CoCreateGuid is the Win32 API that does this using randomness sources including your network adapter.

Martyn


If you have Boost, check out Boost UUID (Universally Unique Id) library.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号