// ntddstor.h
// CTL_CODE(0x002d, 0x407, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_PERSISTENT_RESERVE_OUT 0x002DD01C
View the official Windows Driver Kit DDI referenceNo description available.
The generic storage class driver (classpnp.sys) exposes an I/O control (IOCTL) interface for issuing Persistent Reserve Out commands. The behavior of the storage device when a Persistent Reserve Out command is received is described in the SCSI Primary Commands - 2 (SPC-2) specification. The IOCTL interface requires the caller to have read/write access to the physical device for Persistent Reserve Out commands. User-mode applications, services, and kernel-mode drivers can use this IOCTL to control persistent reservations. If called from a driver, this IOCTL must be called from a thread running at IRQL < DISPATCH_LEVEL. This IOCTL is defined with FILE_READ_ACCESS and FILE_WRITE_ACCESS, requiring a device handle to have both read and write permissions to issue the Persistent Reserve Out command.
The buffer at Irp->AssociatedIrp.SystemBuffer contains a PERSISTENT_RESERVE_COMMAND structure. You must allocate the buffer from nonpaged pool and must align it correctly for the target device and adapter.
PR_OUT.ServiceAction can be one of the following:
PR_OUT.Scope can be one of the following:
PR_OUT.Type can be one of the following:
PR_OUT.ParameterList is used to hold the PRO_PARAMETER_LIST structure. This structure is required and must be contiguous with the rest of the PERSISTENT_RESERVE_COMMAND structure.
The length of a PERSISTENT_RESERVE_COMMAND structure.
None.
None.
The Information field is set to zero.
The Status field is set to one of the following values.
| Value | Meaning |
|---|---|
| STATUS_DEVICE_BUSY (ERROR_BUSY) | The command failed because of a Reservation Conflict (for more information, see the SCSI Primary Commands - 2 (SPC-2) specification). |
| STATUS_INFO_LENGTH_MISMATCH | The input buffer length for the IOCTL is less than sizeof(PERSISTENT_RESERVE_COMMAND) or the size that is specified in the PERSISTENT_RESERVE_COMMAND data structure is less than sizeof(PERSISTENT_RESERVE_COMMAND). |
| STATUS_INVALID_DEVICE_REQUEST (ERROR_INVALID_FUNCTION) | The I/O control code (IOCTL_STORAGE_PERSISTENT_RESERVE_OUT) is not supported by the storage drivers. |
| STATUS_INVALID_PARAMETER (ERROR_INVALID_PARAMETER) | The input buffer structure is incorrectly sized or populated. |
| STATUS_INVALID_USER_BUFFER (ERROR_INVALID_USER_BUFFER) | The input buffer is not aligned correctly for the device or adapter. This status can only be returned when a driver sends an IOCTL to the storage stack. This status isn't returned when a user-mode application sends the IOCTL through the DeviceIoControl API as the I/O Manager automatically aligns the buffers. |
| STATUS_IO_DEVICE_ERROR (ERROR_IO_DEVICE) | The device does not support the Persistent Reserve Out command. |
| STATUS_SUCCESS | The operation was successful. |