I have post an article about “How to get a fixed code for serial number” at http://www.ucosoft.com/archives/51.html. In that article, I suggest you try WMI class to retrieve some hardware ID. But there is some limitation of this method.
The WMI redist package is not always available on user’s system, for example, Windows NT4 and Windows 95/98. And the Volume Serial Number of HDD can be easily changed while the CPU ID is not always available.
As Walter Wang said, the manufacturer of harddisk stored a unique Firmware Serial Number in the harddisk when it’s built. It doesn’t change with Operating System Changes or HDD formatting. So I should serve your purpose.
For source code example on how to retrieve this HDD Firmware Serial Number using DeviceIoControl, you can refer to following this article. It support IDE, SATA and SCSI drive type.
http://www.winsim.com/diskid32/diskid32.html
Local download: diskid32.zipp
Simple output of diskid32:
Primary Controller – Master drive
Drive Model Number________________: ST380011A
Drive Serial Number_______________: 3JV6TBXW
Drive Controller Revision Number__: 3.04
Controller Buffer Size on Drive___: 2097152 bytes
Drive Type________________________: Fixed
Drive Size________________________: 76264796672 bytes
Trying to read the drive IDs using the SCSI back door
Primary Controller – Master drive
Drive Model Number________________: ST380011A
Drive Serial Number_______________: 3JV6TBXW
Drive Controller Revision Number__: 3.04
Controller Buffer Size on Drive___: 2097152 bytes
Drive Type________________________: Fixed
Drive Size________________________: 76264796672 bytes
Trying to read the drive IDs using physical access wi
**** STORAGE_DEVICE_DESCRIPTOR for drive 0 ****
Vendor Id = (
Product Id = ST380011A
Product Revision = 3.04
Serial Number = 3JV6TBXW
Hard Drive Serial Number__________: 3JV6TBXW
Hard Drive Model Number___________: ST380011A
Computer ID_______________________: 652190462
MAC Address: 00-FF-5B-FE-6B-20
MAC Address: 00-0C-76-74-DA-50
Permalink: Code Library - How to get a fixed code for serial number(2)
Subcribe the update with Google Reader.
RSS feed for comments on this post · TrackBack URI
Leave a reply