3.1.4.2.22 ApiCanResourceBeDependent (Opnum 21)

msdn link

(Protocol Version 3) The ApiCanResourceBeDependent method determines whether a resource can be dependent on another resource as specified in section 3.1.1.1.2. The nonvolatile cluster state associated with either resource is not updated.

The server MUST fail this method by using one of the following errors for any of the error's associated conditions described as follows:

  • ERROR_INVALID_PARAMETER

    • hResource and hResourceDependent represent the same resource.

    • The resources are not in the same group.

  • ERROR_DEPENDENCY_ALREADY_EXISTS

    • A dependency between hResource and hResourceDependent already exists.

  • ERROR_CIRCULAR_DEPENDENCY

    • A dependent of hResourceDependent is already dependent on hResource, either directly or indirectly. That is, circular dependencies are not permitted.

  • ERROR_RESOURCE_ONLINE

    • hResource is in the ClusterResourceOnlinePending state.

    • hResource is in the ClusterResourceOnline state and hResourceDependent is in the ClusterResourceOnline state.

  • ERROR_DEPENDENCY_TREE_TOO_COMPLEX

    • The existing dependency tree for hResourceDependent is at its maximum depth.

The server SHOULD accept an ApiCanResourceBeDependent request if its protocol server state is read-only, and MUST accept the request for processing if it is in the read/write state, as specified in section 3.1.1.

The server SHOULD accept an ApiCanResourceBeDependent request if the access levels associated with the hResource and hResourceDependent context handles are at least "Read" (section 3.1.4).

 error_status_t ApiCanResourceBeDependent(
   [in] HRES_RPC hResource,
   [in] HRES_RPC hResourceDependent,
   [out] error_status_t *rpc_status
 );

hResource: An HRES_RPC context handle that was obtained in a previous ApiOpenResource, ApiOpenResourceEx, or ApiCreateResource method call.

hResourceDependent: An HRES_RPC context handle that was obtained in a previous ApiOpenResource, ApiOpenResourceEx, or ApiCreateResource method call.

rpc_status: A 32-bit integer used to indicate success or failure. The RPC runtime MUST indicate, by writing to this parameter, whether it succeeded in executing this method on the server. The encoding of the value passed in this parameter MUST conform to encoding for  comm_status and fault_status, as specified in Appendix E of [C706].

Return Values: The method MUST return the following error codes for the specified conditions.

Return value/code

Description

0x00000000

ERROR_SUCCESS

Success.

0x00000006

ERROR_INVALID_HANDLE

The data that is pointed to by either the hResource parameter or the hResourceDependent parameter does not represent a valid HRES_RPC context handle.

0x00000057

ERROR_INVALID_PARAMETER

See the preceding text for details of when this error can occur.

0x00000423

ERROR_CIRCULAR_DEPENDENCY

See the preceding text for details of when this error can occur.

0x0000138B

ERROR_DEPENDENCY_ALREADY_EXISTS

See the preceding text for details of when this error can occur.

0x0000138E

ERROR_RESOURCE_NOT_AVAILABLE

The resource represented by either the hResource parameter or the hResourceDependent parameter no longer exists in the nonvolatile cluster state.

0x0000139B

ERROR_RESOURCE_ONLINE

See the preceding text for details of when this error can occur.

0x000013CD

ERROR_DEPENDENCY_NOT_ALLOWED

See the preceding text for details of when this error can occur.

0x00001729

ERROR_DEPENDENCY_TREE_TOO_COMPLEX

See the preceding text for details of when this error can occur.

For any other condition, the server MUST set Status to a value that is not one of the values listed in the preceding table. The client MUST treat all values that are not listed in the preceding table the same, except as specified in section 3.2.4.6.