Click here to Skip to main content
15,908,264 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear all,

anyone having reference/links material to get the HDD Firmware Serial Number Detection Tool using activelock. i need it to detect the hardware serial number. its from the actual HDD not fro the registry.


Any kind of link, suggestion and specially expert advice would be highly appreciated.


Thanks & Regards,
Balkrishna Raut
Posted

-- Update --
What about using S.M.A.R.T. interface ?
C# and S.M.A.R.T Information about Hard Disk Drive[^]

DeviceIoControl: Get a SMART Drive Serial Number[^]


A CP article on how to get serial number in C#
How to Retrieve the REAL Hard Drive Serial Number[^]

Another CP article.
Get Physical HDD Serial Number without WMI[^]

WMI object on Win32_PhysicalMedia Class[^]


---
Perhaps a query to Windows Management Instrumentation (WMI) can help you?

WMI Queries[^]
 
Share this answer
 
v3
Comments
Mwanzia_M 25-Apr-11 19:59pm    
I too agree. Its just a matter of getting hardware information. My five.
meBalkrishna 26-Apr-11 1:33am    
thanks for the reply!....correct me if i ma wrong. WMI reads the hardware information from the registry. it will not gives you actual physical information i.e. hard disk firmware serial number. it is necessary to read the information from the kernal. which is possible using alcrypto3.dll which i am using. When you read this information using WMI then its value cant be same while formatting of computer. its value keep on changing on formatting. for more reference follow this link.
http://www.diskserialnumber.com/
if you know how to read this information from kernal please share with me.
Kim Togo 26-Apr-11 2:58am    
See my updated answer.
meBalkrishna 27-Apr-11 2:53am    
thanks for the solution...
i found one dll (diskID32.dll) which actual reads hardware firmware serial number from the kernal.
using we can read the actual firmware number.
http://www.programingreference.com/disk32dll-with-diskiddll-and-serial-number-of-drive/
http://www.7880.com/Info/Article-527e2a00.html

using WMI class sometimes we meight not get the actual values.
Kim Togo 27-Apr-11 3:04am    
Cool, you found a solution :-)
C#
[DllImport("DiskID32.dll")]
      public static extern long DiskID32(ref byte DiskModel, ref byte DiskID);


C#
private string GetHardDiskID()
        {
            byte[] DiskModel = new byte[31];
            byte[] DiskID = new byte[31];
            int i;
            string Model = "";
            string HDDID = "";
            if (DiskID32(ref DiskModel[0], ref DiskID[0]) != 1)
            {
                for (i = 0; i < 31; i++)
                {
                    if (Convert.ToChar(DiskID[i]) != Convert.ToChar(0))
                    {
                        HDDID = HDDID + Convert.ToChar(DiskID[i]);
                    }
                }
                HDDID = HDDID.Trim();
            }
            else
            {
                HDDID = "";
            }
            return HDDID;
        }
 
Share this answer
 
Comments
fmellaerts 8-Dec-11 0:17am    
Where Can I download the DiskId32.dll ?
Freddy Mellaerts : fmellaerts@gmail.com

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900