basinsight.blogg.se

Get Hard Drive Serial Number Delphi
Get Hard Drive Serial Number Delphi










  1. #Get Hard Drive Serial Number Delphi full
  2. #Get Hard Drive Serial Number Delphi code
  3. #Get Hard Drive Serial Number Delphi windows

While ((HardDriveSerialNumber Chr(0)) and (ip Chr(0)) and (ip < 1024)) do

#Get Hard Drive Serial Number Delphi code

However, if you download the code from his website, you will have to fix 1 error in “ hwid_impl.pas” on line 1504. I found someone that has already done that. Of course, I don’t expect you to convert it to Delphi.

#Get Hard Drive Serial Number Delphi full

You can find full history on the application and it’s change-log here: Looking at the source code, it takes many scenarios in mind when attempting to retrieve disk information. There is an open-source application called DiskID32 that is written in C++. I have seen this application recommended on many occasions, although there are other solutions that use similar methods. It does NOT require administrator rights for Win NT/2K.

#Get Hard Drive Serial Number Delphi windows

DiskId32 does not run on plain old DOS and I highly doubt that it works on Windows 3.x. It runs under Windows 9X, Win NT, Win 2K and Win XP (Pro/Home). Well, the smart folks at WinSim Inc., wore an open-source application called DiskId32:ĭiskId32 is a Win32 console utility for reading the manufacturer’s information from your hard drives. It also means we have to care if the drive is SATA, IDE, etc. So if we can’t use GetVolumeInformation() and we can’t rely on WMI 100% of the time, what can we do? Well, it involves querying several sources of information on a system directly.

Get Hard Drive Serial Number Delphi

The reason is that this property is optionally defined by the manufacturer and must be supplied by the hard disk driver.

Get Hard Drive Serial Number Delphi

Interestingly enough, this won’t work 100% of the time. Notice also that it recommends to use the WMI Win32_Physical Media property “SerialNumber” to obtain the manufacturer’s serial. To programmatically obtain the hard disk’s serial number that the manufacturer assigns, use the Windows Management Instrumentation (WMI) Win32_PhysicalMedia property SerialNumber.

Get Hard Drive Serial Number Delphi

This function returns the volume serial number that the operating system assigns when a hard disk is formatted. The problem is that this is not the serial number printed on the hard drive and assigned by the manufacturer, but is (according to the MSDN documentation): Some people recommend using the GetVolumeInformation API function. It’s surprisingly a non-trivial issue to retrieve the manufacturer’s information from a hard drive.












Get Hard Drive Serial Number Delphi