Sending SCSI Pass Through to Unclaimed Devices - Programmer

This is a discussion on Sending SCSI Pass Through to Unclaimed Devices - Programmer ; Hi, I've already posted a couple of questions in the past - and thanks for all the help that everyone has provided so far. For the last couple of weeks I have been struggling with one particular issue - how ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Sending SCSI Pass Through to Unclaimed Devices

  1. Sending SCSI Pass Through to Unclaimed Devices

    Hi,

    I've already posted a couple of questions in the past - and thanks for
    all the help that everyone has provided so far.

    For the last couple of weeks I have been struggling with one particular
    issue - how to send SCSI commands to an unclaimed device.

    I am using the Windows DDK (WDK) for this project - and am unable to
    use third party DLLs or libs such as ASPI.

    What I need to do is scan the SCSI bus, get the inquiry data for
    everything and then send a few more commands here and there.

    Where a device is claimed (i.e. Tape0) - this is fine - but how on
    earth do you send a DeviceIOControl() to a non-claimed device (in
    particular I will be doing this for tape drives without drivers and
    medium changers - nothing else is of interest at the present time).

    For this one I've been racking my brains, searching old news groups and
    the net and have come up with nothing of use... some functions, sample
    code and pointers in the right direction would be immensely appreciated
    in this matter if any of you know and have 5 seconds of time.

    This is obviously possible, as I know applications that already do such
    as task without ASPI (unfortunatley for various reasons I'm having to
    re-invent the wheel here lol).

    Thanks for your time in advance

    Guy Powell


  2. Re: Sending SCSI Pass Through to Unclaimed Devices

    guytp wrote:
    > Hi,
    >
    > I've already posted a couple of questions in the past - and thanks for
    > all the help that everyone has provided so far.
    >
    > For the last couple of weeks I have been struggling with one particular
    > issue - how to send SCSI commands to an unclaimed device.
    >
    > I am using the Windows DDK (WDK) for this project - and am unable to
    > use third party DLLs or libs such as ASPI.
    >
    > What I need to do is scan the SCSI bus, get the inquiry data for
    > everything and then send a few more commands here and there.
    >
    > Where a device is claimed (i.e. Tape0) - this is fine - but how on
    > earth do you send a DeviceIOControl() to a non-claimed device (in
    > particular I will be doing this for tape drives without drivers and
    > medium changers - nothing else is of interest at the present time).


    Two steps.

    1. Get a handle to the SCSI port driver with
    scsihandle = CreateFile("\\\\.\\Scsi0", ...

    (If that doesn't work try "\\\\.\\Scsi1")

    2. Presumably you can recognize your device by examining the inquiry
    data. Once you find it save the associated TargetId from the device
    inquiry data.

    With the scsihandle and TargetId you can call DeviceIOControl.

    --
    Scott McPhillips [VC++ MVP]


+ Reply to Thread