3.8.4.2 ClearPR (Opnum 4)

The ClearPR method performs a SCSI PERSISTENT RESERVE OUT command (see [SPC-3] section 6.12) with a REGISTER AND IGNORE EXISTING KEY action, followed by a CLEAR action.

 HRESULT ClearPR(
   [in] unsigned long DeviceNumber
 );

DeviceNumber:  The number of the disk to act on.

Return Values:  A signed 32-bit value that indicates return status. If the method returns a negative value, it has failed. Zero or positive values indicate success, with the lower 16 bits in positive nonzero values containing warnings or flags defined in the method implementation. For more information about Win32 error codes and HRESULT values, see [MS-ERREF] sections 2.2 and 2.1.

Return value/code

Description

0x00000000

S_OK

The call was successful.

0x80070002

ERROR_FILE_NOT_FOUND

The disk was not found.

For any other condition, this method MUST return a value that is not one of the values listed in the preceding table. The client MUST behave in one consistent, identical manner for all values that are not listed in the preceding table.

Exceptions Thrown: No exceptions are thrown beyond those thrown by the underlying RPC protocol [MS-RPCE].

The opnum field value for this method is 4.

When processing this call, the server MUST do the following:

  • Determine the list of disks accessible to the system and for each disk, create an entry in a list that stores the device number in an implementation-specific way. Device numbers are assigned incrementally starting from zero to the number of disks minus one. The mapping between device number and actual device is implementation-specific and is established prior to the method call.

  • Find the disk corresponding to the value passed in the DeviceNumber parameter. If the disk is not found, return ERROR_FILE_NOT_FOUND.

  • Issue a PERSISTENT RESERVE OUT command REGISTER AND IGNORE EXISTING KEY action as specified in [SPC-3] section 6.12.

  • Issue a PERSISTENT RESERVE OUT command CLEAR action as specified in [SPC-3] section 6.12.

  • Destroy the list of disks accessible to the system created as part of this method.