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:

For IDE drives also:
Description

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);

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.


How to use

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:

  1. Set ScsiPort to desirable value. THDDInfo inquires Scsi port and sets ScsiBusCount.
  2. Set ScsiBus to value from 0 to ScsiBusCount-1. THDDInfo inquire Scsi bus and sets ScsiDevCount
  3. Set ScsiDevice to value from 0 to ScsiDevCount-1. THDDInfo inquires Scsi bus and returns information about device in ScisiInfo property.

Note: ScsiPort=0 and ScsiPort=1 correspond to IDE Primary and IDE Secondary controllers.


History
Author

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)


License and disclaimer agreement

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.