IOCTL_STORAGE_PERSISTENT_RESERVE_OUT IOCTL

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.

Major Code

IRP_MJ_DEVICE_CONTROL

Input Buffer

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:

  • RESERVATION_ACTION_REGISTER
  • RESERVATION_ACTION_RESERVE
  • RESERVATION_ACTION_RELEASE
  • RESERVATION_ACTION_CLEAR
  • RESERVATION_ACTION_PREEMPT
  • RESERVATION_ACTION_PREEMPT_ABORT
  • RESERVATION_ACTION_REGISTER_IGNORE_EXISTING
PR_OUT.Scope can be one of the following:
  • RESERVATION_SCOPE_LU
  • RESERVATION_SCOPE_ELEMENT
PR_OUT.Type can be one of the following:
  • RESERVATION_TYPE_WRITE_EXCLUSIVE
  • RESERVATION_TYPE_EXCLUSIVE
  • RESERVATION_TYPE_WRITE_EXCLUSIVE_REGISTRANTS
  • RESERVATION_TYPE_EXCLUSIVE_REGISTRANTS
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.

Input Buffer Length

The length of a PERSISTENT_RESERVE_COMMAND structure.

Output Buffer

None.

Output Buffer Length

None.

Status Block

The Information field is set to zero.

The Status field is set to one of the following:

Requirements

   
Header ntddstor.h (include Ntddstor.h)