ChangerClassSendSrbSynchronous function (mcd.h)
The ChangerClassSendSrbSynchronous routine synchronously sends an SRB to a specified device.
Syntax
NTSTATUS ChangerClassSendSrbSynchronous(
[in] PDEVICE_OBJECT DeviceObject,
[in] PSCSI_REQUEST_BLOCK Srb,
[in] PVOID Buffer,
[in] ULONG BufferSize,
[in] BOOLEAN WriteToDevice
);
Parameters
[in] DeviceObject
Pointer to the functional device object of the target device.
[in] Srb
Pointer to a partially initialized SCSI request block (SRB) to be sent to the target device.
[in] Buffer
Specifies address of the buffer that Srb->DataBuffer should point to. ChangerClassSendSrbSynchronous creates an MDL for this buffer and passes it to the target device driver in the SRB IRP.
[in] BufferSize
Specifies length, in bytes, of the buffer.
[in] WriteToDevice
Indicates a write operation when TRUE and read operation when FALSE.
Return value
Returns STATUS_SUCCESS if the SRB is transmitted successfully or the appropriate error code if the SRB fails or cannot be sent for some reason.
Remarks
Changer miniclass drivers can call this class driver routine in Microsoft Windows XP and later operating systems. Miniclass drivers should use this routine to send an SRB to the port driver instead of calling the classpnp.sys library routine ClassSendSrbSynchronous directly. Although classpnp.sys is shipped with the Windows Driver Kit (WDK), it is not a supported API, and drivers that call this library's routines directly might not function properly in future releases.
ChangerClassSendSrbSynchronous finishes the initialization of the partially initialized SRB, setting the SRB's flags with the values indicated in the target's device object. ChangerClassSendSrbSynchronous creates the IRP that is used to convey the SRB to the target device, sends the IRP, then handles the IRP's completion.
If the IRP fails and the sense request data indicates that the IRP should be retried, ChangerClassSendSrbSynchronous will resend the IRP.
Requirements
Requirement | Value |
---|---|
Target Platform | Desktop |
Header | mcd.h (include Mcd.h, Ntddchgr.h) |
Library | Mcd.lib |