Board index » cppbuilder » Unique compuer ID

Unique compuer ID


2005-05-21 03:37:12 AM
cppbuilder41
Hello
What Windows API function can I use to get a unique compuer ID?
Thanks
Rony
 
 

Re:Unique compuer ID

"Renald Yazmir" < XXXX@XXXXX.COM >wrote in message
Quote
What Windows API function can I use to get a unique compuer ID?
There is no such ID associated with a computer to begin with, thus no
function to retreive it. The closest you can get is to:
1) retreive the serial number of your hard drive(s) via
GetVolumeInformation()
2) use inline assembly code to query the CPU for its unique ID (but this
only works on certain Pentium chips, is not included in the latest chips
anymore because it was too controversial, and can be disabled by the user in
the BIOS).
3) generate your own unique IDs, such as via CoCreateGuid(). This generates
a new GUID each time it is called. It is not stored anywhere on the
hardware, although it may use hardware values to help ensure uniqueness.
You are responsible for keeping track of the values you generate. If you
lose it, it is gone.
Gambit
 

Re:Unique compuer ID

In fact there are few more "unique" ID-s to think about:
4) Hardware HD serial number (not volume partition number!)
Google for: diskid32.exe (there is a complete source code)
5) MAC addresses
Plenty of samples on the web (even on BDN), just google...
--
Best regards,
Vladimir Stefanovic
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote

"Renald Yazmir" < XXXX@XXXXX.COM >wrote in message
news:428e3c63$ XXXX@XXXXX.COM ...

>What Windows API function can I use to get a unique compuer ID?

There is no such ID associated with a computer to begin with, thus no
function to retreive it. The closest you can get is to:

1) retreive the serial number of your hard drive(s) via
GetVolumeInformation()

2) use inline assembly code to query the CPU for its unique ID (but this
only works on certain Pentium chips, is not included in the latest chips
anymore because it was too controversial, and can be disabled by the user
in
the BIOS).

3) generate your own unique IDs, such as via CoCreateGuid(). This
generates
a new GUID each time it is called. It is not stored anywhere on the
hardware, although it may use hardware values to help ensure uniqueness.
You are responsible for keeping track of the values you generate. If you
lose it, it is gone.


Gambit


 

{smallsort}

Re:Unique compuer ID

What about "GetCurrentHwProfile" and returned parameter of HW_PROFILE_INFO
szHwProfileGuid
"{12340001-4980-1920-6788-123456789012}" ?
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote

"Renald Yazmir" < XXXX@XXXXX.COM >wrote in message
news:428e3c63$ XXXX@XXXXX.COM ...

>What Windows API function can I use to get a unique compuer ID?

There is no such ID associated with a computer to begin with, thus no
function to retreive it. The closest you can get is to:

1) retreive the serial number of your hard drive(s) via
GetVolumeInformation()

2) use inline assembly code to query the CPU for its unique ID (but this
only works on certain Pentium chips, is not included in the latest chips
anymore because it was too controversial, and can be disabled by the user
in
the BIOS).

3) generate your own unique IDs, such as via CoCreateGuid(). This
generates
a new GUID each time it is called. It is not stored anywhere on the
hardware, although it may use hardware values to help ensure uniqueness.
You are responsible for keeping track of the values you generate. If you
lose it, it is gone.


Gambit


 

Re:Unique compuer ID

"Vladimir Stefanovic" < XXXX@XXXXX.COM >wrote in message
Quote
5) MAC addresses
MAC addresses are not unique across the entire network industry. They are
unique only within a particular manufacturer's own products, but multiple
manufacturers may overlap IDs.
If you use a GUID, it usually includes MAC data when being generating, if
network cards are installed on the machine.
Gambit
 

Re:Unique compuer ID

"Renald Yazmir" < XXXX@XXXXX.COM >wrote in message
Quote
What about "GetCurrentHwProfile" and returned parameter
of HW_PROFILE_INFO szHwProfileGuid
"{12340001-4980-1920-6788-123456789012}" ?
Like its name suggests, it retreives the "current" profile. Multiple
profiles may exist on a machine, and can be swapped dynamically as hardware
changes (docking/undocking devices, inserting/removing hot-swappable
devices, etc). Also, if the user reinstalls the OS, or add/removes
profiles, the GUIDs may change as well. Also, the function is only
available on NT-based systems (NT4/2K/XP/2K3), not on 9x/Me.
Gambit