Skip to content

Latest commit

 

History

History
274 lines (215 loc) · 8.78 KB

ns-srb-_srbex_data.md

File metadata and controls

274 lines (215 loc) · 8.78 KB
UID title description old-location tech.root ms.date keywords ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames f1_keywords topic_type api_type api_location api_name
NS:srb._SRBEX_DATA
_SRBEX_DATA (srb.h)
The _SRBEX_DATA structure (srb.h) describes the generalized format for containing extended SCSI Request Block (SRB) data.
storage\srbex_data.htm
storage
03/29/2018
SRBEX_DATA structure
*PSRBEX_DATA, PSRBEX_DATA, PSRBEX_DATA structure pointer [Storage Devices], SRBEX_DATA, SRBEX_DATA structure [Storage Devices], SrbExDataTypeBidirectional, SrbExDataTypeIoInfo, SrbExDataTypePnp, SrbExDataTypePower, SrbExDataTypeScsiCdb16, SrbExDataTypeScsiCdb32, SrbExDataTypeScsiCdbVar, SrbExDataTypeUnknown, SrbExDataTypeWmi, _SRBEX_DATA, storage.srbex_data, storport/PSRBEX_DATA, storport/SRBEX_DATA
srb.h
Storport.h, Srb.h, Minitape.h
Windows
Available starting with Windows 8.
Windows
SRBEX_DATA, *PSRBEX_DATA
_SRBEX_DATA
srb/_SRBEX_DATA
PSRBEX_DATA
srb/PSRBEX_DATA
SRBEX_DATA
srb/SRBEX_DATA
APIRef
kbSyntax
HeaderDef
Storport.h
_SRBEX_DATA
PSRBEX_DATA
SRBEX_DATA

_SRBEX_DATA structure (srb.h)

-description

The SRBEX_DATA structure is the generalized format for containing extended SRB data.

Note  The SCSI port driver and SCSI miniport driver models may be altered or unavailable in the future. Instead, we recommend using the Storport driver and Storport miniport driver models.
 

-struct-fields

-field Type

Data type indicator for the extended SRB data structure. The possible values for Type are one of the following.

Value Meaning
SrbExDataTypeUnknown
The SRB extended data type is unknown.
SrbExDataTypeBidirectional
The SRB extended data is formatted as an SRBEX_DATA_BIDIRECTIONAL structure.
SrbExDataTypeScsiCdb16
The SRB extended data is formatted as an SRBEX_DATA_SCSI_CDB16 structure.
SrbExDataTypeScsiCdb32
The SRB extended data is formatted as an SRBEX_DATA_SCSI_CDB32 structure.
SrbExDataTypeScsiCdbVar
The SRB extended data is formatted as an SRBEX_DATA_SCSI_CDB_VAR structure.
SrbExDataTypeWmi
The SRB extended data is formatted as an SRBEX_DATA_WMI structure.
SrbExDataTypePower
The SRB extended data is formatted as an SRBEX_DATA_POWER structure.
SrbExDataTypePnp
The SRB extended data is formatted as an SRBEX_DATA_PNP structure.
SrbExDataTypeIoInfo
The SRB extended data is formatted as an SRBEX_DATA_IO_INFO structure.

-field Length

Length of the SRB data, in bytes, present in the Data member.

-field Data

The extended SRB data block contents.

-remarks

The SRB extended data is present when the SrbExDataOffset array in the STORAGE_REQUEST_BLOCK structure contains valid offset locations. A storage driver initially references a memory offset location contained in SrbExDataOffset as an SRBEX_DATA structure. A pointer to the data block is then cast to the appropriate structure type based on the data type value in the Type member.

The following example code fragment shows how to access the extended data for the SRB function of SRB_FUNCTION_PNP.

BOOLEAN CheckIo( _In_ PSCSI_REQUEST_BLOCK Srb)
{
    BOOLEAN result = TRUE;
    ULONG function;
    PSTORAGE_REQUEST_BLOCK SrbEx = (PSTORAGE_REQUEST_BLOCK)Srb;
    PSRBEX_DATA SrbExData = NULL;

    function = (SrbEx->Function == SRB_FUNCTION_STORAGE_REQUEST_BLOCK) ? SrbEx->SrbFunction : Srb->Function;

    switch (function)
    {
        case SRB_FUNCTION_PNP:
        {
            STOR_PNP_ACTION PnpAction;
            BOOLEAN ForAdapter;

            if (SrbEx->Function == SRB_FUNCTION_STORAGE_REQUEST_BLOCK)
            {
                PSRBEX_DATA_PNP SrbExDataPnp = NULL;

                SrbExData = (PSRBEX_DATA) ((PUCHAR)SrbEx + SrbEx->SrbExDataOffset[0]);
                if (SrbExData->Type == SrbExDataTypePnp)
                {
                    SrbExDataPnp = (PSRBEX_DATA_PNP) SrbExData;
                    ForAdapter = (SrbExDataPnp->SrbPnPFlags == SRB_PNP_FLAGS_ADAPTER_REQUEST);
                    PnpAction = SrbExDataPnp->PnPAction;
                }
                else
                {
                    ForAdapter = FALSE;
                    result = FALSE;
                }
            }
            else
            {
                PSCSI_PNP_REQUEST_BLOCK PnpSrb = (PSCSI_PNP_REQUEST_BLOCK)Srb;

                ForAdapter = (PnpSrb->SrbPnPFlags == SRB_PNP_FLAGS_ADAPTER_REQUEST);
                PnpAction = PnpSrb->PnPAction;
           }

           if (ForAdapter)
           {
               switch (PnpAction)
               {
                   case StorRemoveDevice:
                       //
                       // ...
                       //
                       Srb->SrbStatus = SRB_STATUS_SUCCESS;
                       break;

                   default:
                       Srb->SrbStatus = SRB_STATUS_INVALID_REQUEST;
                       result = FALSE;
                       break:
            }
        }

        default:
            break; 
    }

    return result;
}

-see-also

SRBEX_DATA_BIDIRECTIONAL

SRBEX_DATA_IO_INFO

SRBEX_DATA_PNP

SRBEX_DATA_POWER

SRBEX_DATA_SCSI_CDB16

SRBEX_DATA_SCSI_CDB32

SRBEX_DATA_SCSI_CDB_VAR

SRBEX_DATA_WMI