🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #16035

Re: unique identifier of your computer

#16035
From: Eudy Silva
Date: Sun, 01 Jun 2003 01:30
34 lines
1926 bytes
Hi Mike,

I don't get it. What kind of uniqueness will be
achieved by using a GUID? I mean, how is this going
to be used for protection since the calculated
value is system independent?

Eudy

Mike Collins wrote:
> Hi Mike,
> 
> We do exactly the same thing!  I found the easiest way to generate a unique
> ID is to create a new GUID using the CoCreateGuid function, thus:
> 
>    AnsiString szGUID = NULL;
>    GUID guid;
>    if (CoCreateGuid(&guid)==S_OK)
>    {
>       OLECHAR cBuff[50];
>       ZeroMemory(cBuff, sizeof(cBuff));
>       if ((StringFromGUID2(guid, cBuff, 50))==(MAX_GUID_SIZE+1))
>       {
>          szGUID = AnsiString(cBuff);
>       }
>    }
> 
> Alternatively, you could concatenate together several other pieces of
> information which is specific to the target PC i.e. Computer Name, Domain
> Name, MAC address, IP address etc.
> 
> HTH
> 
> Mike C
Technical Details
Message-ID: <3ED95720.70406@directnet.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3ed8d2c9$1@newsgroups.borland.com> <3ed92560$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,e96c6a7e8e688897
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-05-31 18:32:03 PST
Message-ID: <3ED95720.70406@directnet.com>
Date: Sat, 31 May 2003 22:30:08 -0300
From: Eudy Silva <eudy@directnet.com>
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: unique identifier of your computer
References: <3ed8d2c9$1@newsgroups.borland.com> <3ed92560$1@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 200.152.8.215
X-Trace: newsgroups.borland.com 1054430882 200.152.8.215 (31 May 2003 18:28:02 -0700)
Lines: 36
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail