Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CoCreateGuid source code?

657 views
Skip to first unread message

Marc UNEt

unread,
Mar 21, 2000, 3:00:00 AM3/21/00
to
Is the source code for the CoCreateGuid() function available somewhere? I
need to calculate something unique that identifies a machine, and thats
exactly what CoCreateGuid (partly) does. However i am not sure if i can rely
on the dynamics of a GUID. On the other hand i think the wheel has been
invented enough times by now.

My thanks will be forever :-)
Marc.

PeteRobinson

unread,
Mar 21, 2000, 3:00:00 AM3/21/00
to
Mark,

look on the MSDN disk

Samples\VC98\MFC\Utility\GUIDGEN.

I think that's what you're looking for.

Cheers,
Pete.

Marc UNEt <m.bo...@instromet.be> wrote in message
news:8b7ga8$8ua$1...@newnews1.news.nl.uu.net...

Nick Jacobs

unread,
Mar 21, 2000, 3:00:00 AM3/21/00
to
Pete,
If I'm correct, Marc is looking for the source to CoCreateGuid function.
The directory/example/program you directed him to just shows how to use the
call. (What it DOES show is how the numbers can be broken down into the
8-4-4-12 combination to be put into a string. It also quietly tells you
about uuid.data1, uuid.data2, uuuid.data3, uuid.data4)

Nick


"PeteRobinson" <Pete.R...@t-online.de> wrote in message
news:8b816a$5tt$1...@news08.btx.dtag.de...

Marc UNEt

unread,
Mar 21, 2000, 3:00:00 AM3/21/00
to
That's right Nick!
I even thougt that the UUID.DATA3 and UUID.DATA4 may fit. But i read in an
atricle that Windows 2000 also mangles the machine id part of the GUID.

So i do not think that i can use CoCreateGuid() for my purpose.

Thank you,
Marc.


Nick Jacobs <jac...@dynastress.com> wrote in message
news:uo9IlP0k$GA.282@cppssbbsa04...

Nick Jacobs

unread,
Mar 21, 2000, 3:00:00 AM3/21/00
to
Actually, W2K is not the only one any more...

Data4 is/was mostly the ethernet address of the local machine (or some other
number if the ecard is not present). What happened is that it became sort
of a security risk type of an issue so MS decided to encode the address.
(There are still calls in the VC environment that will allow you to do the
calls this way, but they lack security). You'll see this problem being
addressed on all platforms to get around this security issue.


That's what I know. <grin>

Nick

"Marc UNEt" <m.bo...@instromet.be> wrote in message

news:8b86a4$e4o$1...@newnews1.news.nl.uu.net...

Nick Jacobs

unread,
Mar 21, 2000, 3:00:00 AM3/21/00
to
Marc,
Check out this address:
http://www.opengroup.org/onlinepubs/9629399/apdxa.htm

It has a discussion on what exactly UUIDs are all about. Now, as far as
what algorithm is concerned...

Nick


"Nick Jacobs" <jac...@dynastress.com> wrote in message

news:O3cFu#0k$GA.244@cppssbbsa04...

Marc UNEt

unread,
Mar 22, 2000, 3:00:00 AM3/22/00
to
Thanks for the article. It exactly defines the UUID fields.
However, i still have to code my own "node" :(
I am thinking of using the network adapter MAC address or some BIOS /
Harddisk information.
Marc

Nick Jacobs <jac...@dynastress.com> wrote in message

news:Ogzx7D1k$GA.174@cppssbbsa04...

Nick Jacobs

unread,
Mar 22, 2000, 3:00:00 AM3/22/00
to
Marc,
The Network Adapter MAC is what the machine id is. (At least for MS Based
products). MS just disguises it a little bit. 6 octects long (12 bytes).
Maybe you could use another random number or something in there to make it
unique.


"Marc UNEt" <m.bo...@instromet.be> wrote in message

news:8bagdm$2ma$1...@newnews1.news.nl.uu.net...

Marc UNEt

unread,
Mar 23, 2000, 3:00:00 AM3/23/00
to
Oh men, this thread is growing...

I am afraight that i do not understand you completely. Of course i can use
the machine id, but do you think i can still use it in the future or is MS
going to randomize this number every time a new UUID is created??

If the machine ID remains CONSTANT for one machine i am done!
Marc.


Nick Jacobs <jac...@dynastress.com> wrote in message

news:#wv6bVAl$GA.189@cppssbbsa04...

Nick Jacobs

unread,
Mar 23, 2000, 3:00:00 AM3/23/00
to
Well, actually, there are two different calls (at least for now) that allow
you to create UUIDs. The first of which is the older one that keeps the
machine id constant. This is probably one of those calls that is going to
go away. Mostly because of security issues. The newer call already
randomizes the field to disguise where the UUID came from. I have a fealing
that this call is the one that is going to stick and the other one is the
one that is going to go by the wayside. I *thought* I read some place that
the new call generates a completely new UUID everytime with the newer call.

Sorry.
Nick


"Marc UNEt" <m.bo...@instromet.be> wrote in message

news:8bckvs$jeo$1...@newnews1.news.nl.uu.net...

0 new messages