SCSI SRB FLAG does not make sense - SRB_FLAGS_NO_DATA_TRANSFER

Discussion in 'Windows Vista Drivers' started by Long Ta, Aug 18, 2004.

  1. Long Ta

    Long Ta Guest

    Hello everyone,

    In the DDK, page SCSI_REQUEST_BLOCK (System Support for Buses->SCSI
    Bus->Reference->SCSI Bus Structure->SCSI_REQUEST_BLOCK), the SrbFlags can
    have a flag set as 'SRB_FLAGS_NO_DATA_TRANSFER'. The page says, "Indicates no
    data transfer with this request. If this is set, the flags
    SRB_FLAGS_DATA_OUT, SRB_FLAGS_DATA_IN, and SRB_FLAGS_UNSPECIFIED_DIRECTION
    are clear"

    Now when I look at the include file srb.h, this flag is '#define'd as
    0x00000000. Can anyone explain this? If I am going to test the flag using
    the following statement:

    if( srb->SrbFlags & SRB_FLAGS_NO_DATA_TRANSFER )
    {
    // do all this
    }

    I will never have the block executed.

    This got to be a bug, true or not? Thanks.
     
    Long Ta, Aug 18, 2004
    #1
    1. Advertisements

  2. Long Ta

    Guest Guest

    It's a common practice to use zero flags. If the flag was non-zero, you
    could set SrbFlags to say ( SRB_FLAGS_DATA_IN |
    SRB_FLAGS_NO_DATA_TRANSFER ) which hardly makes any sense.

    Do this:

    if( srb->SrbFlags & ( SRB_FLAGS_DATA_IN | SRB_FLAGS_DATA_OUT ) )
    {
    // data transfer
    }
    else
    {
    // NO data transfer
    }
     
    Guest, Aug 18, 2004
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.