SRBEX_DATA structure (srb.h)
The SRBEX_DATA structure is the generalized format for containing extended SRB data.
Syntax
typedef struct _SRBEX_DATA {
SRBEXDATATYPE Type;
ULONG Length;
UCHAR Data[ANYSIZE_ARRAY];
} SRBEX_DATA, *PSRBEX_DATA;
Members
Type
Data type indicator for the extended SRB data structure. The possible values for Type are one of the following.
Value | Meaning |
---|---|
|
The SRB extended data type is unknown. |
|
The SRB extended data is formatted as an SRBEX_DATA_BIDIRECTIONAL structure. |
|
The SRB extended data is formatted as an SRBEX_DATA_SCSI_CDB16 structure. |
|
The SRB extended data is formatted as an SRBEX_DATA_SCSI_CDB32 structure. |
|
The SRB extended data is formatted as an SRBEX_DATA_SCSI_CDB_VAR structure. |
|
The SRB extended data is formatted as an SRBEX_DATA_WMI structure. |
|
The SRB extended data is formatted as an SRBEX_DATA_POWER structure. |
|
The SRB extended data is formatted as an SRBEX_DATA_PNP structure. |
|
The SRB extended data is formatted as an SRBEX_DATA_IO_INFO structure. |
Length
Length of the SRB data, in bytes, present in the Data member.
Data[ANYSIZE_ARRAY]
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;
}
Requirements
Requirement | Value |
---|---|
Minimum supported client | Available starting with Windows 8. |
Header | srb.h (include Storport.h, Srb.h, Minitape.h) |