Harddisk Serial Number Delphi

  1. Hard Disk Serial Number Delphi 7
  2. Windows Hard Disk Serial Number
  3. Get Hard Drive Serial Number Delphi

Dear all,I'm trying to read serial no of the hard disk as a unique id of the machine. I tried the code as follows:class function TDeviceUtils.GetDeviceId: string;constIDENTIFYBUFFERSIZE = 512;typeTIDERegs = packed recordbFeaturesReg: BYTE; // Used for specifying SMART 'commands'.bSectorCountReg: BYTE; // IDE sector count registerbSectorNumberReg: BYTE; // IDE sector number registerbCylLowReg: BYTE; // IDE low order cylinder valuebCylHighReg: BYTE; // IDE high order cylinder valuebDriveHeadReg: BYTE; // IDE drive/head registerbCommandReg: BYTE; // Actual IDE command.bReserved: BYTE; // reserved for future use. Must be zero.end;TSendCmdInParams = packed record// Buffer size in bytescBufferSize: LongInt;// Structure with drive register values.irDriveRegs: TIDERegs;// Physical drive number to send command to (0,1,2,3).bDriveNumber: BYTE;bReserved: array 0. 2 of BYTE;dwReserved: array 0.

Tips: GetDiskSerial DLL is a windows Dynamic Link Library for retrieve real serial number of hard disk in your windows applicatons.If you are looking for a solution to protect your windows applicaton, please free trial License Shield SDK, with a few function call, it helps.

3 of DWORD;bBuffer: array 0. 0 of BYTE; // Input buffer.end;TIdSector = packed recordwGenConfig: Word;wNumCyls: Word;wReserved: Word;wNumHeads: Word;wBytesPerTrack: Word;wBytesPerSector: Word;wSectorsPerTrack: Word;wVendorUnique: array 0. 2 of Word;sSerialNumber: array 0.

19 of CHAR;wBufferType: Word;wBufferSize: Word;wECCSize: Word;sFirmwareRev: array 0. 7 of CHAR;sModelNumber: array 0. 39 of CHAR;wMoreVendorUnique: Word;wDoubleWordIO: Word;wCapabilities: Word;wReserved1: Word;wPIOTiming: Word;wDMATiming: Word;wBS: Word;wNumCurrentCyls: Word;wNumCurrentHeads: Word;wNumCurrentSectorsPerTrack: Word;ulCurrentSectorCapacity: DWORD;wMultSectorStuff: Word;ulTotalAddressableSectors: DWORD;wSingleWordDMA: Word;wMultiWordDMA: Word;bReserved: array 0. 127 of BYTE;end;PIdSector = ^TIdSector;TDriverStatus = packed recordbDriverError: BYTE;bIDEStatus: BYTE;bReserved: array 0.

1 of BYTE;dwReserved: array 0. 1 of DWORD;end;TSendCmdOutParams = packed record// bBuffer的大小cBufferSize: DWORD;DriverStatus: TDriverStatus;bBuffer: array 0. 0 of BYTE;end;varhDevice: Thandle;cbBytesReturned: DWORD;SCIP: TSendCmdInParams;aIdOutCmd: array 0. Dear all,I'm trying to read serial no of the hard disk as a unique id of themachine. I tried the code as follows:class function TDeviceUtils.GetDeviceId: string;constIDENTIFYBUFFERSIZE = 512;typeTIDERegs = packed recordbFeaturesReg: BYTE; // Used for specifying SMART 'commands'.bSectorCountReg: BYTE; // IDE sector count registerbSectorNumberReg: BYTE; // IDE sector number registerbCylLowReg: BYTE; // IDE low order cylinder valuebCylHighReg: BYTE; // IDE high order cylinder valuebDriveHeadReg: BYTE; // IDE drive/head registerbCommandReg: BYTE; // Actual IDE command.bReserved: BYTE; // reserved for future use. Must be zero.end;TSendCmdInParams = packed record// Buffer size in bytescBufferSize: LongInt;// Structure with drive register values.irDriveRegs: TIDERegs;// Physical drive number to send command to (0,1,2,3).bDriveNumber: BYTE;bReserved: array 0. 2 of BYTE;dwReserved: array 0.

3 of DWORD;bBuffer: array 0. 0 of BYTE; // Input buffer.end;TIdSector = packed recordwGenConfig: Word;wNumCyls: Word;wReserved: Word;wNumHeads: Word;wBytesPerTrack: Word;wBytesPerSector: Word;wSectorsPerTrack: Word;wVendorUnique: array 0.

2 of Word;sSerialNumber: array 0. 19 of CHAR;wBufferType: Word;wBufferSize: Word;wECCSize: Word;sFirmwareRev: array 0. 7 of CHAR;sModelNumber: array 0. 39 of CHAR;wMoreVendorUnique: Word;wDoubleWordIO: Word;wCapabilities: Word;wReserved1: Word;wPIOTiming: Word;wDMATiming: Word;wBS: Word;wNumCurrentCyls: Word;wNumCurrentHeads: Word;wNumCurrentSectorsPerTrack: Word;ulCurrentSectorCapacity: DWORD;wMultSectorStuff: Word;ulTotalAddressableSectors: DWORD;wSingleWordDMA: Word;wMultiWordDMA: Word;bReserved: array 0. 127 of BYTE;end;PIdSector = ^TIdSector;TDriverStatus = packed recordbDriverError: BYTE;bIDEStatus: BYTE;bReserved: array 0. 1 of BYTE;dwReserved: array 0.

1 of DWORD;end;TSendCmdOutParams = packed record// bBuffer???cBufferSize: DWORD;DriverStatus: TDriverStatus;bBuffer: array 0. 0 of BYTE;end;varhDevice: Thandle;cbBytesReturned: DWORD;SCIP: TSendCmdInParams;aIdOutCmd: array 0. Dear all,I'm trying to read serial no of the hard disk as a unique id of themachine. I tried the code as follows:class function TDeviceUtils.GetDeviceId: string;constIDENTIFYBUFFERSIZE = 512;typeTIDERegs = packed recordbFeaturesReg: BYTE; // Used for specifying SMART 'commands'.bSectorCountReg: BYTE; // IDE sector count registerbSectorNumberReg: BYTE; // IDE sector number registerbCylLowReg: BYTE; // IDE low order cylinder valuebCylHighReg: BYTE; // IDE high order cylinder valuebDriveHeadReg: BYTE; // IDE drive/head registerbCommandReg: BYTE; // Actual IDE command.bReserved: BYTE; // reserved for future use. Must be zero.end;TSendCmdInParams = packed record// Buffer size in bytescBufferSize: LongInt;// Structure with drive register values.irDriveRegs: TIDERegs;// Physical drive number to send command to (0,1,2,3).bDriveNumber: BYTE;bReserved: array 0. 2 of BYTE;dwReserved: array 0. 3 of DWORD;bBuffer: array 0.

Harddisk Serial Number Delphi

0 of BYTE; // Input buffer.end;TIdSector = packed recordwGenConfig: Word;wNumCyls: Word;wReserved: Word;wNumHeads: Word;wBytesPerTrack: Word;wBytesPerSector: Word;wSectorsPerTrack: Word;wVendorUnique: array 0. 2 of Word;sSerialNumber: array 0.

Hard Disk Serial Number Delphi 7

19 of CHAR;wBufferType: Word;wBufferSize: Word;wECCSize: Word;sFirmwareRev: array 0. 7 of CHAR;sModelNumber: array 0.

39 of CHAR;wMoreVendorUnique: Word;wDoubleWordIO: Word;wCapabilities: Word;wReserved1: Word;wPIOTiming: Word;wDMATiming: Word;wBS: Word;wNumCurrentCyls: Word;wNumCurrentHeads: Word;wNumCurrentSectorsPerTrack: Word;ulCurrentSectorCapacity: DWORD;wMultSectorStuff: Word;ulTotalAddressableSectors: DWORD;wSingleWordDMA: Word;wMultiWordDMA: Word;bReserved: array 0. 127 of BYTE;end;PIdSector = ^TIdSector;TDriverStatus = packed recordbDriverError: BYTE;bIDEStatus: BYTE;bReserved: array 0. 1 of BYTE;dwReserved: array 0. 1 of DWORD;end;TSendCmdOutParams = packed record// bBuffer???cBufferSize: DWORD;DriverStatus: TDriverStatus;bBuffer: array 0. 0 of BYTE;end;varhDevice: Thandle;cbBytesReturned: DWORD;SCIP: TSendCmdInParams;aIdOutCmd: array 0. George,Yes, it is for windows only.

Windows Hard Disk Serial Number

It is not perfect but can give you some clues.Each platform you will need to find a different approach. There is not suchcomponent that works on all platforms that I am aware of. I am in need ofthat either.There is no HD on an android for example. You can use the build Serial number,but you will find that it is not always reliable.Cheap chinese androids commonly repeats the same serials.

Not sure how itworks on apple platforms.So it is quite a work to find out.Eduardo. Dear all,I'm trying to read serial no of the hard disk as a unique id of themachine.

Get Hard Drive Serial Number Delphi

I tried the code as follows:class function TDeviceUtils.GetDeviceId: string;constIDENTIFYBUFFERSIZE = 512;typeTIDERegs = packed recordbFeaturesReg: BYTE; // Used for specifying SMART 'commands'.bSectorCountReg: BYTE; // IDE sector count registerbSectorNumberReg: BYTE; // IDE sector number registerbCylLowReg: BYTE; // IDE low order cylinder valuebCylHighReg: BYTE; // IDE high order cylinder valuebDriveHeadReg: BYTE; // IDE drive/head registerbCommandReg: BYTE; // Actual IDE command.bReserved: BYTE; // reserved for future use. Must be zero.end;TSendCmdInParams = packed record// Buffer size in bytescBufferSize: LongInt;// Structure with drive register values.irDriveRegs: TIDERegs;// Physical drive number to send command to (0,1,2,3).bDriveNumber: BYTE;bReserved: array 0.

Harddisk Serial Number Delphi

2 of BYTE;dwReserved: array 0. 3 of DWORD;bBuffer: array 0.

0 of BYTE; // Input buffer.end;TIdSector = packed recordwGenConfig: Word;wNumCyls: Word;wReserved: Word;wNumHeads: Word;wBytesPerTrack: Word;wBytesPerSector: Word;wSectorsPerTrack: Word;wVendorUnique: array 0. 2 of Word;sSerialNumber: array 0. 19 of CHAR;wBufferType: Word;wBufferSize: Word;wECCSize: Word;sFirmwareRev: array 0. 7 of CHAR;sModelNumber: array 0. 39 of CHAR;wMoreVendorUnique: Word;wDoubleWordIO: Word;wCapabilities: Word;wReserved1: Word;wPIOTiming: Word;wDMATiming: Word;wBS: Word;wNumCurrentCyls: Word;wNumCurrentHeads: Word;wNumCurrentSectorsPerTrack: Word;ulCurrentSectorCapacity: DWORD;wMultSectorStuff: Word;ulTotalAddressableSectors: DWORD;wSingleWordDMA: Word;wMultiWordDMA: Word;bReserved: array 0. 127 of BYTE;end;PIdSector = ^TIdSector;TDriverStatus = packed recordbDriverError: BYTE;bIDEStatus: BYTE;bReserved: array 0.

1 of BYTE;dwReserved: array 0. 1 of DWORD;end;TSendCmdOutParams = packed record// bBuffer???cBufferSize: DWORD;DriverStatus: TDriverStatus;bBuffer: array 0. 0 of BYTE;end;varhDevice: Thandle;cbBytesReturned: DWORD;SCIP: TSendCmdInParams;aIdOutCmd: array 0. I'm trying to read serial no of the hard disk as a unique id of themachine. I tried the code as follows:Magenta Systems WMI and SMART Component frommight help, however the SMART APIs were designed for PCs with only four IDEATA drives and drives less than 128 gig, whereas SATA PCs may have six ormore drives. Also they only work with physical drives and not SCSIconnected or RAID drives.There are Intel RST APIs that access the underlaying drives in PCs usingIntel chipsets which Smartmontools supports, but it's complex C code andnot easy to translate to Delphi.Angus. I'm trying to read serial no of the hard disk as a unique id of themachine.

I tried the code as follows:Magenta Systems WMI and SMART Component frommight help, however the SMART APIs were designed for PCs with only four IDEATA drives and drives less than 128 gig, whereas SATA PCs may have six ormore drives. Also they only work with physical drives and not SCSIconnected or RAID drives.There are Intel RST APIs that access the underlaying drives in PCs usingIntel chipsets which Smartmontools supports, but it's complex C code andnot easy to translate to Delphi.Angus.

Hard

.What you are looking at is NOT the hard drive serial number.It is called the. It is generated at the time of creating and formatting the volume / partition.You can get it by using a command at command prompt: C: vol c: if C: is the drive you want to retrieve the Volume Serial Number for.All you can do is redirect the output of that command to a file: C: vol c: myvol.txt and it will be stored as a text file in your C:.I am attaching a screenshot with the highlights:. The file was stored in the root of C:. This is what the myvol.txt file looks like in Notepad.

Comments are closed.