取得硬盘序列号

时间:2021-09-24 14:58:55
【文件属性】:

文件名称:取得硬盘序列号

文件大小:4KB

文件格式:RAR

更新时间:2021-09-24 14:58:55

例子

//获得硬盘序列号 function GetIdeSerialNumber: pchar; const IDENTIFY_BUFFER_SIZE = 512; type TIDERegs = packed record bFeaturesReg: BYTE; // Used for specifying SMART "commands". bSectorCountReg: BYTE; // IDE sector count register bSectorNumberReg: BYTE; // IDE sector number register bCylLowReg: BYTE; // IDE low order cylinder value bCylHighReg: BYTE; // IDE high order cylinder value bDriveHeadReg: BYTE; // IDE drive/head register bCommandReg: BYTE; // Actual IDE command. bReserved: BYTE; // reserved for future use. Must be zero. end; TSendCmdInParams = packed record // Buffer size in bytes cBufferSize: DWORD; // 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 record wGenConfig: 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 record // 驱动器返回的错误代码,无错则返回0 bDriverError: Byte; // IDE出错寄存器的内容,只有当bDriverError 为 SMART_IDE_ERROR 时有效 bIDEStatus: Byte; bReserved: array[0..1] of Byte; dwReserved: array[0..1] of DWORD; end; TSendCmdOutParams = packed record // bBuffer的大小 cBufferSize: DWORD; // 驱动器状态 DriverStatus: TDriverStatus; // 用于保存从驱动器读出的数据的缓冲区,实际长度由cBufferSize决定 bBuffer: array[0..0] of BYTE; end;


【文件预览】:
获取硬盘物理序列号的delphi2010源码.txt

网友评论