3.4.4.10 CprepDiskFindKey3 (Opnum 12)
The CprepDiskFindKey3 method queries the SCSI Persistent Reserve registration table for the disk and determines if the specified key is listed in the table.
The user supplies a key and this method returns a BOOLEAN indicating whether the key is found in the registration table.
-
HRESULT CprepDiskFindKey3( [in] CPREP_DISKID DiskId, [in] ULONGLONG Key, [out] BOOLEAN* pbFound );
DiskId: The identifier of the ClusPrepDisk representing the disk.
Key: The registration key to search for in the SCSI Persistent Reserve registration table for the LUN underlying the operating system disk identified by the DiskId parameter. A value of zero for this parameter indicates that the caller is querying to discover whether any keys are registered.
pbFound: Returns a nonzero value if the registration key is found in the SCSI Persistent Reserve registration table for the LUN underlying the operating system disk identified by the DiskId parameter.
Return Values: A signed 32-bit value that indicates return status. If the method returns a negative value, it has failed. Non-negative values indicate success, with the lower 16 bits of the value 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.
0x00000057
ERROR_INVALID_PARAMETER
An internal error occurred.
0x80070548
ERROR_INVALID_SERVER_STATE
The server's Prepare State is not Online.
0x8007139F
ERROR_INVALID_STATE
The value of ClusPrepDisk.AttachedState is not Attached.
-
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 (see [MS-RPCE]).
The opnum field value for this method is 12.
When processing this call, the server MUST do the following:
Obtain the ClusPrepDisk identified by the DiskId parameter, as described in section 3.2.4.
If the Key parameter is not zero, search for that key in the SCSI Persistent Reserve registration table for the LUN underlying the operating system disk identified by the DiskId parameter, as specified in [SPC-3] section 6.12 and return TRUE in the pbFound parameter if the key is found.
If the Key parameter is zero, return TRUE in the pbFound parameter if at least one key is present in the SCSI Persistent Reserve registration table for the LUN underlying the operating system disk identified by the DiskId parameter.