Board index » cppbuilder » Unique compuer ID
Renald Yazmir
![]() CBuilder Developer |
Renald Yazmir
![]() CBuilder Developer |
Unique compuer ID2005-05-21 03:37:12 AM cppbuilder41 Hello What Windows API function can I use to get a unique compuer ID? Thanks Rony |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2005-05-21 03:52:25 AM
Re:Unique compuer ID
"Renald Yazmir" < XXXX@XXXXX.COM >wrote in message
QuoteWhat Windows API function can I use to get a unique compuer ID? 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 |
Vladimir Stefanovic
![]() CBuilder Developer |
2005-05-21 04:05:19 AM
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
{smallsort} |
Renald Yazmir
![]() CBuilder Developer |
2005-05-21 04:17:25 AM
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
|
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2005-05-21 04:22:25 AM
Re:Unique compuer ID
"Vladimir Stefanovic" < XXXX@XXXXX.COM >wrote in message
Quote5) MAC addresses 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 |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2005-05-21 04:27:43 AM
Re:Unique compuer ID
"Renald Yazmir" < XXXX@XXXXX.COM >wrote in message
QuoteWhat about "GetCurrentHwProfile" and returned parameter 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 |