Unit Wnaspi32

Classes

Functions

GetASPI32SupportInfo -
SendASPI32Command -

Types

DWORD
LPSRB
PFNPOST
pSRB_Abort
pSRB_BusDeviceReset
PSRB_ExecSCSICmd
PSRB_GDEVBlock
PSRB_GetDiskInfo
PSRB_HAInquiry
SRB_Abort
SRB_BusDeviceReset
SRB_ExecSCSICmd
SRB_GDEVBlock
SRB_GetDiskInfo
SRB_HAInquiry

Constants

HASTAT_BUS_FREE
HASTAT_BUS_RESET
HASTAT_COMMAND_TIMEOUT
HASTAT_DO_DU
HASTAT_MESSAGE_REJECT
HASTAT_OK
HASTAT_PARITY_ERROR
HASTAT_PHASE_ERR
HASTAT_REQUEST_SENSE_FAILED
HASTAT_SEL_TO
HASTAT_TIMEOUT
SC_ABORT_SRB
SC_EXEC_SCSI_CMD
SC_GET_DEV_TYPE
SC_GET_DISK_INFO
SC_HA_INQUIRY
SC_RESET_DEV
SENSE_LEN
SRB_DATA_SG_LIST
SRB_DIR_IN
SRB_DIR_OUT
SRB_DIR_SCSI
SRB_ENABLE_RESIDUAL_COUNT
SRB_EVENT_NOTIFY
SRB_POSTING
SS_ABORTED
SS_ABORT_FAIL
SS_ASPI_IS_BUSY
SS_BUFFER_TO_BIG
SS_COMP
SS_ERR
SS_FAILED_INIT
SS_INVALID_CMD
SS_INVALID_HA
SS_INVALID_SRB
SS_NO_DEVICE
SS_PENDING
WM_ASPIPOST

Variables


Functions


function GetASPI32SupportInfo:DWORD;


function SendASPI32Command(P:LPSRB):DWORD;


Types


DWORD=Cardinal
/**************************************************************************** * * * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY * * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR * * PURPOSE. * * * * Copyright (C) 1993-95 Microsoft Corporation. All Rights Reserved. * * * ****************************************************************************/ //*************************************************************************** // // Name: WNASPI32.h // // Description: ASPI for Win32 definitions // // //*************************************************************************** // Recycled for Delphi. // needs installed wnaspi32.dll, whitch is included in Win95 // and freely available for NT // // // Febr. 1998
LPSRB=Pointer

PFNPOST=Pointer

pSRB_Abort=^SRB_Abort
*************************************************************************** %%% SRB - ABORT AN SRB - SC_ABORT_SRB %%%
pSRB_BusDeviceReset=^SRB_BusDeviceReset
*************************************************************************** %%% SRB - BUS DEVICE RESET - SC_RESET_DEV %%%
PSRB_ExecSCSICmd=^SRB_ExecSCSICmd
*************************************************************************** %%% SRB - EXECUTE SCSI COMMAND - SC_EXEC_SCSI_CMD %%%
PSRB_GDEVBlock=^SRB_GDEVBlock
*************************************************************************** %%% SRB - GET DEVICE TYPE - SC_GET_DEV_TYPE %%%
PSRB_GetDiskInfo=^SRB_GetDiskInfo
*************************************************************************** %%% SRB - GET DISK INFORMATION - SC_GET_DISK_INFO %%%
PSRB_HAInquiry=^SRB_HAInquiry
The adapter failed in issuing REQUEST SENSE. *************************************************************************** %%% SRB - HOST ADAPTER INQUIRY - SC_HA_INQUIRY %%%
SRB_Abort = record
SRB_Cmd : Byte;
SRB_Status : Byte;
SRB_HaId : Byte;
SRB_Flags : Byte;
SRB_Hdr_Rsvd : DWORD;
SRB_ToAbort : Pointer;
end;

SRB_BusDeviceReset = record
SRB_Cmd : Byte;
SRB_Status : Byte;
SRB_HaId : Byte;
SRB_Flags : Byte;
SRB_Hdr_Rsvd : DWORD;
SRB_Target : Byte;
SRB_Lun : Byte;
SRB_Rsvd1 : array [0..11] of Byte;
SRB_HaStat : Byte;
SRB_TargStat : Byte;
SRB_PostProc : Pointer;
SRB_Rsvd2 : Pointer;
SRB_Rsvd3 : array[0..15] of Byte;
CDBByte : array[0..15] of Byte;
end;

SRB_ExecSCSICmd = record
SRB_Cmd : Byte;
SRB_Status : Byte;
SRB_HaId : Byte;
SRB_Flags : Byte;
SRB_Hdr_Rsvd : DWORD;
SRB_Target : Byte;
SRB_Lun : Byte;
SRB_Rsvd1 : Word;
SRB_BufLen : DWORD;
SRB_BufPointer : Pointer;
SRB_SenseLen : Byte;
SRB_CDBLen : Byte;
SRB_HaStat : Byte;
SRB_TargStat : Byte;
SRB_PostProc : POINTER;
SRB_Rsvd2 : POINTER;
SRB_Rsvd3 : Array [0..15] of Byte;
CDBByte : Array [0..15] of Byte;
SenseArea : Array [0..SENSE_LEN+1] of Byte;
end;

SRB_GDEVBlock = record
SRB_Cmd : Byte;
SRB_Status : Byte;
SRB_HaId : Byte;
SRB_Flags : Byte;
SRB_Hdr_Rsvd : DWORD;
SRB_Target : Byte;
SRB_Lun : Byte;
SRB_DeviceType : Byte;
SRB_Rsvd1 : Byte;
end;

SRB_GetDiskInfo = record
SRB_Cmd : Byte;
SRB_Status : Byte;
SRB_HaId : Byte;
SRB_Flags : Byte;
SRB_Hdr_Rsvd : DWORD;
SRB_Target : Byte;
SRB_Lun : Byte;
SRB_DriveFlags : Byte;
SRB_Int13HDriveInfo : Byte;
SRB_Heads : Byte;
SRB_Sectors : Byte;
SRB_Rsvd1 : array[0..9] of Byte;
end;

SRB_HAInquiry = record
SRB_Cmd : Byte;
SRB_Status : Byte;
SRB_HaId : Byte;
SRB_Flags : Byte;
SRB_Hdr_Rsvd : DWORD;
HA_Count : Byte;
HA_SCSI_ID : Byte;
HA_ManagerId : array [0..15] of Byte;
HA_Identifier : array[0..15] of Byte;
HA_Unique : array[0..15] of Byte;
HA_Rsvd1 : Word;
end;

Constants

HASTAT_BUS_FREE = $13

Data overrun data underrun

HASTAT_BUS_RESET = $0E

While processing SRB, the // adapter received a MESSAGE // REJECT.

HASTAT_COMMAND_TIMEOUT = $0B

Timed out while SRB was waiting to beprocessed.

HASTAT_DO_DU = $12

Selection Timeout

HASTAT_MESSAGE_REJECT = $0D

While processing the SRB, the adapter timed out.

HASTAT_OK = $00

Buffer size to big to handle! *************************************************************************** %%% Host Adapter Status %%%

HASTAT_PARITY_ERROR = $0F

A bus reset was detected.

HASTAT_PHASE_ERR = $14

Unexpected bus free

HASTAT_REQUEST_SENSE_FAILED = $10

A parity error was detected.

HASTAT_SEL_TO = $11

Host adapter did not detect an // error

HASTAT_TIMEOUT = $09

Target bus phase sequence // failure

SC_ABORT_SRB = $03

Execute SCSI command

SC_EXEC_SCSI_CMD = $02

Get device type

SC_GET_DEV_TYPE = $01

Host adapter inquiry

SC_GET_DISK_INFO = $06

SCSI bus device reset

SC_HA_INQUIRY = $00

ASPI Post message *************************************************************************** %%% ASPI Command Definitions %%%

SC_RESET_DEV = $04

Abort an SRB

SENSE_LEN = 14

SRB_DATA_SG_LIST = $02

Enable residual byte count // reporting

SRB_DIR_IN = $08

Direction determined by SCSI // command

SRB_DIR_OUT = $10

Transfer from SCSI target to // host

SRB_DIR_SCSI = $00

Default sense buffer length

SRB_ENABLE_RESIDUAL_COUNT = $04

Enable ASPI event notification

SRB_EVENT_NOTIFY = $40

Enable ASPI posting

SRB_POSTING = $01

Transfer from host to SCSI // target

SS_ABORTED = $02

SRB completed without error

SS_ABORT_FAIL = $03

SRB aborted

SS_ASPI_IS_BUSY = $E5

ASPI for windows failed init

SS_BUFFER_TO_BIG = $E6

No resources available to execute cmd

SS_COMP = $01

SRB being processed

SS_ERR = $04

Unable to abort SRB

SS_FAILED_INIT = $E4

Invalid parameter set in SRB

SS_INVALID_CMD = $80

SRB completed with error

SS_INVALID_HA = $81

Invalid ASPI command

SS_INVALID_SRB = $E0

SCSI device not installed

SS_NO_DEVICE = $82

Invalid host adapter number

SS_PENDING = $00

Get Disk information *************************************************************************** %%% SRB Status %%%

WM_ASPIPOST = $4D42

Data buffer points to // scatter-gather list

Variables