THDDInfo
THDDInfo - nonvisual Delphi component
provided low level information about IDE, ATAPI and SCSI devices
Version: 2.3 (2008 December 26)
Supports Win9x, WinNT and Vista platforms, provided information about IDE, ATAPI and SCSI devices.
Provided information:
Properties:
property HDDType : TDriveType; - Device type (Fixed, Removable, CD-Rom, Unknown, Tape, Optical disk, Array device).
TDriveType = (dtFixed, dtRemovable, dtCDROM, dtUnknown, dtTape, dtOptical, dtArray);
property Serial : string; - Serial number.
property Revision : string; - Firmware revision.
property Model : string; - Model string.
property CylsTotal : word; - Cylinders (IDE only).
property HeadTotal : word; - Heads (IDE only).
property BPT : word; - Bytes per track (IDE only).
property BPS : word; - Bytes per sector (IDE only).
property SPT : word; - Sectors per track (IDE only).
property BufSize : DWord; - Controller buffer size (IDE only).
property ECC : Word; - ECC code (IDE only).
property LBASectors: dword; - LBA sectors count (IDE only).
property Size : int64; - Nonformatted disk size (IDE only).
property Vendor : TVendor; - Vendor data (IDE only).
TVendor = array[0..2] of word;
property isIDE: boolean; - Specifies whether specified device is IDE device.
property ScsiInfo : TScsiInfo; - Holds information about Scsi device.
TScsiInfo = record
PathId, - Indicates the number of the bus the device is located on.
TargetId, - Indicates the number of the device on the bus.
Lun : byte; - Indicates the logical unit number of the logical unit on the target device.
DeviceClaimed : boolean; - When true, indicates that the device has been claimed by a class driver.
HDDType : TDriveType; - Indicates device type;
Data : string; - Contains device info (as a rule the name and first several bytes of firmware revision).
end;
property ScsiPort : integer; - Specifies Scsi port number to get information.
property ScsiBus : integer; - Specifies Scsi bus number to get information (should be from 0 to ScsiBusCount-1).
property ScsiDevice : integer; - Specifies Scsi device number to get information (should be from 0 to ScsiDevCount-1).
property ScsiBusCount : word; - Contains number of buses for specified Scsi port.
property ScsiDevCount : word; - Contains number of devices for specified Scsi bus.
property isNT : boolean; - Specifies whether OS is WinNT.
Published properties:
property Drive : TDrive; - Specifies drive to get information about. On change, calls GetInfo procedure.
TDrive = (dPrimaryMaster, dPrimarySlave, dSecondaryMaster, dSecondarySlave, dTertiaryMaster, dTertiarySlave, dQuaternaryMaster, dQuaternarySlave);
property DeviceName : string; - Specifies device name (for gimByName retrieving information method).
property Method : TGetInfoMethod; - Specifies retrieving information method.
TGetInfoMethod = (gimAuto, gimNT, gimScsi, gim9x, gimByName, gimASPI, gimZeroRights, gimWMI);
Important: gimNT method deal with logical numbering of physical drives regardless of IDE interface, i.e. dPrimaryMaster corresponds to PhysicalDrive0, dPrimarySlave to PhysicalDrive1 etc. For instance if you system has one drive connected as Secondary Master, set Drive property to dPrimaryMaster to get info about this drive.
gimNT method useful when you need to obtain information about first (second, etc.) drive in system and don't want to puzzle over IDE device numbering. If you need to obtain information about specific IDE port use gimScsi instead.
property CanonicalScsiAddressing : boolean; - For gimASPI. If true, HDDInfo uses predefined addresses for IDE devices ((0,0,0) - for Primary Master, (0,1,0) - for Primary Slave, (1,0,0) - for Secondary Master and so on.). If false, HDDInfo will treat Drive property as the number of found device (dPrimaryMaster - first found device, dPrimarySlave - second and so on).
Procedures:
procedure GetInfo; - retrieves information about drive, specified by Drive property. On error raises exception.
Simply set Drive or DeviceName property to desirable value. Also you can use GetInfo procedure. Use try-except block to catch exceptions. See demo.
To scan Scsi bus:
Note: ScsiPort=0 and ScsiPort=1 correspond to IDE Primary and IDE Secondary controllers.
Artem V. Parlyuk, e-mail:artsoft@nm.ru, http://artsoft.site88.net
Partially based on Lynn McGuire C++ source (diskid32.cpp)
CallRing0 function based on Andrey Jdanov (rivitna@mailru.com) asm source (Ring0.asm)
IMPORTANT - READ CAREFULLY
This license and disclaimer statement constitutes a legal agreement ("License Agreement") between you (either as an individual or a single entity) and Artem Parlyuk (the "Author"), for this software product in this particular case THDDInfo Delphi component ("Software"), including any software, media, and accompanying on-line or printed documentation.
BY DOWNLOADING, INSTALLING, COPYING, OR OTHERWISE USING THE SOFTWARE, YOU AGREE TO BE BOUND BY ALL OF THE TERMS AND CONDITIONS OF THIS LICENSE AND DISCLAIMER AGREEMENT. If you do not agree with the terms and conditions of this agreement, you must promptly cease all use of the software and destroy all copies of this software and all of its component parts in your possession or under your control.
This Software is owned by Author and is protected by copyright law and international copyright treaty.
This Software is freeware. You are granted the permission to use Software in your own applications for private purposes. You are granted the permission to use Software in your own applications for commercial purposes, provided your software contains the copyright notice "THDDInfo Delphi component Copyright (c) by Artem Parlyuk" and link to the Author site (http://artsoft.site88.net) and Author e-mail (mailto:artsoft@nm.ru).
You can freely distribute copies of the main archive as long as no alterations are made to the contents and no charge is raised except a reasonable fee for distributing costs. You may not remove copyright notices from copies of the Software. You may not claim this Software as written by anyone but Author, Artem Parlyuk.
The author has taken all possible care to ensure the software is error-free, however the author disavows any potential liability arising from any use of the software. This software is provided "as is" and without any warranties expressed or implied, including, but not limited to, implied warranties of fitness for a particular purpose, and non-infringement. You expressly acknowledge and agree that use of the Software is at your sole risk.
In no event shall the author be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use this software or documentation, even if the author has been advised of the possibility of such damages.
Any feedback given to the Author will be treated as non-confidential. The Author may use any feedback free of charge without limitation.