CanResourceBeDependent function (clusapi.h)

Determines if one resource can be dependent upon another resource. The PCLUSAPI_CAN_RESOURCE_BE_DEPENDENT type defines a pointer to this function.

Syntax

BOOL CanResourceBeDependent(
  [in] HRESOURCE hResource,
  [in] HRESOURCE hResourceDependent
);

Parameters

[in] hResource

Handle to the resource in question.

[in] hResourceDependent

Handle to the resource upon which the resource identified by hResource may depend.

Return value

Return code Description
TRUE
The resource identified by hResource can depend on the resource identified by hResourceDependent.
FALSE
The resource identified by hResource cannot depend on the resource identified by hResourceDependent.

Remarks

With the CanResourceBeDependent function, for the resource identified by hResource to be dependent on the resource identified by hResourceDependent, the following must be true:

  • Both resources must be members of the same group.
  • The resource identified by hResourceDependent cannot depend on the resource identified by hResource, either directly or indirectly.
Do not call CanResourceBeDependent from any resource DLL entry point function. CanResourceBeDependent can safely be called from a worker thread. For more information, see Function Calls to Avoid in Resource DLLs.

Do not pass LPC and RPC handles to the same function call. Otherwise, the call will raise an RPC exception and can have additional destructive effects. For information on how LPC and RPC handles are created, see Using Object Handles and OpenCluster.

Requirements

Requirement Value
Minimum supported client None supported
Minimum supported server Windows Server 2008 Enterprise, Windows Server 2008 Datacenter
Target Platform Windows
Header clusapi.h
Library ClusAPI.lib
DLL ClusAPI.dll

See also

AddClusterResourceDependency

OpenClusterResource

RemoveClusterResourceDependency