IOCTL_STORAGE_PERSISTENT_RESERVE_IN IOCTL

The generic storage class driver (classpnp.sys) exposes an I/O control (IOCTL) interface for issuing Persistent Reserve In commands. The behavior of the storage device when a Persistent Reserve In command is received is described in the SCSI Primary Commands - 2 (SPC-2) specification. The IOCTL interface requires the caller to have read access to the physical device for Persistent Reserve In 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, requiring a device handle to have read permissions to issue the Persistent Reserve In 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_IN.ServiceAction can be one of the following:

  • RESERVATION_ACTION_READ_KEYS

  • RESERVATION_ACTION_READ_RESERVATIONS

PR_IN.Allocation length is the size (in bytes) of the buffer allocated for the returned parameter list.

Input Buffer Length

The length of .

Output Buffer

For PR_IN.ServiceAction = RESERVATION_ACTION_READ_KEYS, the output buffer contains a PRI_REGISTRATION_LIST structure and must be at least sizeof(PRI_REGISTRATION_LIST).

For PR_IN.ServiceAction = RESERVATION_ACTION_READ_RESERVATIONS, the output buffer contains a PRI_RESERVATION_LIST structure and must be at least sizeof(PRI_RESERVATION_LIST).

If the allocated buffer is too small to return all the Persistent Reserve In data, success will be returned and the required size will be returned in the parameter list AdditionalLength field.

Output Buffer Length

The length of .

Input / Output Buffer

Input / Output Buffer Length

Status Block

The Information field is set to the size of the output buffer. For ServiceAction = RESERVATION_ACTION_READ_KEYS, the output buffer is a PRI_REGISTRATION_LIST structure. For ServiceAction = RESERVATION_ACTION_READ_RESERVATIONS, the output buffer is a PRI_RESERVATION_LIST structure.

The Status field is set to one of the following:

Requirements

   
Header ntddstor.h (include Ntddstor.h)