CanResourceBeDependent function

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 WINAPI CanResourceBeDependent(
  _In_ HRESOURCE hResource,
  _In_ HRESOURCE hResourceDependent
);

typedef BOOL (WINAPI *PCLUSAPI_CAN_RESOURCE_BE_DEPENDENT)(
    _In_ HRESOURCE hResource,
    _In_ HRESOURCE hResourceDependent
);

Parameters

hResource [in]

Handle to the resource in question.

hResourceDependent [in]

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

Return value

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

Minimum supported client

None supported

Minimum supported server

Windows Server 2008 Enterprise, Windows Server 2008 Datacenter

Header

ClusAPI.h

Library

ClusAPI.lib

DLL

ClusAPI.dll

See also

AddClusterResourceDependency
OpenClusterResource
RemoveClusterResourceDependency

 

 

Show: