🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
9 messages
9 total messages Started by Christophe MINETTI Fri, 11 Aug 2006 07:55
Processor Serial Number
#3259
Author: Christophe MINETTI
Date: Fri, 11 Aug 2006 07:55
8 lines
948 bytes
Hi all,

I would loke to know if there is any API function that could give me the
Serial Number of the processor ?

Many thanks in advance

Christophe
Re: Processor Serial Number
#3260
Author: JD
Date: Fri, 11 Aug 2006 09:14
11 lines
1152 bytes
Christophe MINETTI <cminetti@ulb.ac.be> wrote:
>
> I would loke to know if there is any API function that could
> give me the Serial Number of the processor ?

There is a way but I don't know what it is because it's
rather useless. You can only get it from a P4+ and the
user can disable access to it.

~ JD
Re: Processor Serial Number
#3261
Author: Alan Bellingham
Date: Fri, 11 Aug 2006 09:18
15 lines
1421 bytes
Christophe MINETTI <cminetti@ulb.ac.be> wrote:

>I would loke to know if there is any API function that could give me the
>Serial Number of the processor ?

'The' processor?

Is it necessary to know for sure, or would you not care that the result
would be extremely unreliable? Not all processors have serial numbers,
and even for the ones that do, the BIOS frequently allows the serial
number to be hidden from software.

Alan Bellingham
-- 
ACCU Conference: 11-14 April 2007 - Paramount Oxford Hotel
Re: Processor Serial Number
#3262
Author: Christophe MINETTI
Date: Fri, 11 Aug 2006 10:12
26 lines
1728 bytes
In fact, it does not matter if it is the processor. What I would like is a
simple way to get the  ID (a uniwue ID) of the computer on which my software
is running. My idea was to get the SN of the processor but it can be the
motherboard or anything else.

Thanks

Christophe

Alan Bellingham wrote:

> Christophe MINETTI <cminetti@ulb.ac.be> wrote:
>
> >I would loke to know if there is any API function that could give me the
> >Serial Number of the processor ?
>
> 'The' processor?
>
> Is it necessary to know for sure, or would you not care that the result
> would be extremely unreliable? Not all processors have serial numbers,
> and even for the ones that do, the BIOS frequently allows the serial
> number to be hidden from software.
>
> Alan Bellingham
> --
> ACCU Conference: 11-14 April 2007 - Paramount Oxford Hotel
Re: Processor Serial Number
#3264
Author: JD
Date: Fri, 11 Aug 2006 11:56
21 lines
1543 bytes
Christophe MINETTI <cminetti@ulb.ac.be> wrote:
>
> [...] What I would like is a simple way to get the  ID (a
> uniwue ID) of the computer on which my software is running.

There is no fool-proof way to do that because equipment can
fail or be replaced during an upgrade.

The best approach is to gather several unique ID's from the
system and allow failure with verifying all but one and then
updating the ones that failed.

If you search the archives, you'll find many links where this
has been discussed in detail:

    http://www.tamaracka.com/search.htm
and
    http://groups.google.com/

~ JD
Re: Processor Serial Number
#3265
Author: Alan Bellingham
Date: Fri, 11 Aug 2006 12:29
37 lines
2598 bytes
Christophe MINETTI <cminetti@ulb.ac.be> wrote:

>In fact, it does not matter if it is the processor. What I would like is a
>simple way to get the  ID (a uniwue ID) of the computer on which my software
>is running. My idea was to get the SN of the processor but it can be the
>motherboard or anything else.

Ah, I thought so.

This is an often-asked question, and the answer tends to descend into
philosophy. What is the computer? Does it change when I do a processor
upgrade? A drive upgrade? A motherboard upgrade? A network card change?

The closest to unique tends to be the MAC on a network interface. But
you may or may not have a network interface, and you may have multiple
ones. And though MACs are supposed to be unique, than can be
reprogrammed.

Now, if you aren't after software protection, but just trying to prevent
multiple machines on a network getting confused, writing an entry into
the registry on installation would work. Use CoCreateGUID() to generate
your GUID, and you should have something

  "To a very high degree of certainty, this function returns a unique
   value � no other invocation, on the same or any other system
  (networked or not), should return the same value."

This value should then hang around on that machine's registry until such
time as you do an OS rebuild.

If you wish to prevent the same software being installed more than once,
that's a different problem. There may be a unique UID somewhere in the
registry, but I don't know of one.

Alan Bellingham
-- 
ACCU Conference: 11-14 April 2007 - Paramount Oxford Hotel
Re: Processor Serial Number
#3269
Author: Remy Lebeau (TeamB)
Date: Fri, 11 Aug 2006 18:14
14 lines
1352 bytes
"Christophe MINETTI" <cminetti@ulb.ac.be> wrote in message
news:44DC3809.9DF18A33@ulb.ac.be...

> I would loke to know if there is any API function that could
> give me the Serial Number of the processor ?

There is no such API function.  You have to use low-level assembly code to
query the CPU directly for that.  Please go to http://www.deja.com and
search through the newsgroup archives.  Sample code has been posted many
times before.


Gambit
Re: Processor Serial Number
#3268
Author: Remy Lebeau (TeamB)
Date: Fri, 11 Aug 2006 18:16
13 lines
1381 bytes
"Christophe MINETTI" <cminetti@ulb.ac.be> wrote in message
news:44DC57F7.ACC3A974@ulb.ac.be...

> In fact, it does not matter if it is the processor. What I would like is
> a simple way to get the  ID (a uniwue ID) of the computer on which
> my software is running.

Ther is no single reliable ID available.  You should make your own IDs
manually, such as by generating GUIDs with CoCreateGuid().


Gambit
Re: Processor Serial Number
#3272
Author: Elkin
Date: Mon, 14 Aug 2006 13:38
47 lines
2289 bytes
Christophe MINETTI ha escrito:

> Hi all,
>
> I would loke to know if there is any API function that could give me the
> Serial Number of the processor ?
>
> Many thanks in advance
>
> Christophe



Hi Christophe,

I've looked for it several times and I've found that the processror's
resial number can be disabled by the user using the bios setup
software.

But, you can use, for example, the Bios Date because it is not the same
for all the processors.

You can use this code to get the bios date that is located in 0xFFFF5
in RAM:

/*-------------------------------*/
PCHAR info;


info=(char*)(0xFFFF5); //Memory location 0xFFFF5
char p = *info; //p stores the byte at the location pointed by info


/*----------------------------------*/


I've used Turbo C+ 3.0, but when the program is written in BCB6 and
reaches the third line of code (char p = *info) an Exception occurs
saying: "Acces violation Read of address 0xFFFF5"


Now the question: is there any way to solve this issue?? I hope you can
find the answer and let me now if that happens.

Best Regards,
Elkin.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads