unit aspi;

// Copyright © 1999 by Semaphore Corporation.  All rights reserved.
// This code, including modified or derived versions, may not be
// distributed, sold, or incorporated in a product or service for sale,
// without permission from semaphore corporation.

interface

function sendaspi32command(p: pointer): longint; stdcall; external 'wnaspi32.dll';
function getaspi32supportinfo: longint; stdcall; external 'wnaspi32.dll';

const
  sense_len = 14; // sense buffer length
  srb_dir_in = $08; // going from scsi target to host
  srb_dir_out = $10; // going from host to scsi target
  srb_event_notify = $40; // enable event notification
  sc_exec_scsi_cmd = $02; // execute scsi command
  ss_pending = $00; // srb being processed
  ss_comp = $01; // srb completed without error

type srb_execscsicmd = packed record
  srb_cmd: byte; // command code = sc_exec_scsi_cmd
  srb_status: byte; // status byte
  srb_haid: byte; // host adapter number
  srb_flags: byte; // request flags
  srb_hdr_rsvd: longint; // reserved
  srb_target: byte; // target's scsi id
  srb_lun: byte; // target's logical unit number
  srb_rsvd1: word; // reserved for alignment
  srb_buflen: longint; // buffer size
  srb_bufpointer: pointer; // address of buffer
  srb_senselen: byte; // sense length
  srb_cdblen: byte; // command block length
  srb_hastat: byte; // host adapter status
  srb_targstat: byte; // target status
  srb_postproc: pointer; // address of post routine
  srb_rsvd2: pointer; // reserved
  srb_rsvd3a, srb_rsvd3b, srb_rsvd3c, srb_rsvd3d: longint; // reserved
  cdbbyte:array [0..15] of byte; // scsi cdb
  sensearea:array [0..sense_len+1] of byte;// request sense buffer
  end;

implementation

end.