// mcd.h
NTSTATUS ChangerSetPosition(
[in] PDEVICE_OBJECT DeviceObject,
[in] PIRP Irp
);
View the official Windows Driver Kit DDI referenceNo description available.
ChangerSetPosition handles the device-specific aspects of a device-control IRP with the IOCTL code IOCTL_CHANGER_SET_POSITION.
DeviceObject [in]Pointer to the device object that represents the changer.
Irp [in]Pointer to the IRP.
If the changer supports setting the position of the transport element, ChangerSetPosition returns the status returned by the system port driver, or one of the following values:
STATUS_INFO_LENGTH_MISMATCH
STATUS_INVALID_PARAMETER
STATUS_INSUFFICIENT_RESOURCES
If the changer does not support setting the position of the transport element, ChangerSetPosition returns STATUS_INVALID_DEVICE_REQUEST.
This routine is required.
ChangerSetPosition sets the changer's robotic transport mechanism to the specified destination, typically to optimize moving or exchanging media by first positioning the transport.
The CHANGER_POSITION_TO_ELEMENT flag in Features0 of GET_CHANGER_PARAMETERS indicates whether the changer supports this functionality.
The changer class driver checks the input buffer length in the I/O stack location before calling ChangerSetPosition. Irp->SystemBuffer points to a CHANGER_SET_POSITION structure as an input parameter that indicates the transport element and the destination to set.
ChangerSetPosition first verifies that the transport and destination element addresses are valid and converts zero-based element addresses to device-specific addresses. It then builds an SRB with a CDB to position the element and sends it to the system port driver.
ChangerSetPosition sets the Information field in the I/O status block to sizeof(CHANGER_SET_POSITION) before returning to the changer class driver.