184.108.40.206.20 ApiAddResourceDependency (Opnum 19)
(Protocol Version 3) The ApiAddResourceDependency method instructs the server to add a simple dependency, as specified in section 220.127.116.11.2, from the resource that is identified by the hResource parameter to the resource that is identified by the hDependsOn parameter. For successful completion of the method, the server MUST add the dependency to the nonvolatile cluster state.
The server MUST fail this method with ERROR_DEPENDENCY_ALREADY_EXISTS (0x0000138B) if a dependency already exists between the resource that is identified by hResource and the resource that is identified by hDependsOn. The server MUST fail this method with ERROR_CIRCULAR_DEPENDENCY (0x00000423) if the new dependency would result in a circular dependency between the two resources. The server MUST fail this method with ERROR_INVALID_PARAMETER (0x00000057) if hResource and hDependsOn designate the same resource.
The server MUST limit the depth of a resource's dependency tree to 100.
The server MUST require that the access level associated with the hResource context handle is "All" and that the access level associated with the hDependsOn context handle is "All" (section 3.1.4).
error_status_t ApiAddResourceDependency( [in] HRES_RPC hResource, [in] HRES_RPC hDependsOn, [out] error_status_t* rpc_status );
hDependsOn: An HRES_RPC context handle that was obtained in a previous ApiOpenResource or ApiOpenResourceEx method call. After successful completion of this method, the resource that is specified in the hResource parameter has a simple dependency to this resource.
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
The data that is pointed to by either the hResource parameter or the hDependsOn parameter does not represent a valid HRES_RPC context handle.
A dependency already exists from the resource that is identified by hResource to the resource that is identified by hDependsOn.
The dependent resource is the quorum.
The new dependency would result in a circular dependency between the two resources.
The hResource parameter and the hDependsOn parameter designate the same resource.
This error code MUST be returned if any of the following conditions are true:
The resource designated by hResource is in the ClusterResourceOnlinePending state.
The resource designated by hResource is in the ClusterResourceOnline state and the resource designated by hDependsOn is not in the ClusterResourceOnline state.
The resource represented by either the hResource parameter or the hDependsOn parameter no longer exists in the nonvolatile cluster state.
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. The client SHOULD treat errors specified in section 18.104.22.168 as recoverable errors and initiate the reconnect procedure as specified in section 22.214.171.124.