IGetClusterResourceInfo interface

[This interface is available for use in the operating systems specified in the Requirements section. Support for this interface was removed in Windows Server 2008.]

The IGetClusterResourceInfo interface is called by a Failover Cluster Administrator extension to retrieve information about a resource.


The IGetClusterResourceInfo interface has these methods.

Method Description
IGetClusterResourceInfo::GetResourceHandle Returns a handle to a resource.
IGetClusterResourceInfo::GetResourceNetworkName Returns the name of the network managed by the Network Name resource on which a resource depends.
IGetClusterResourceInfo::GetResourceTypeName Returns the type of a resource.


If the object being extended is not a resource, queries for IGetClusterResourceInfo methods will fail. Otherwise, you can use the IGetClusterResourceInfo interface when Failover Cluster Administrator calls your implementations of the following methods:

Failover Cluster Administrator passes in an IUnknown pointer, piData. Use piData to call QueryInterface for one of the IGetClusterResourceInfo methods.

Use the IGetClusterResourceInfo interface only in the context of a resource extension. Do not obtain other information interfaces, such as IGetClusterGroupInfo, from the IGetClusterResourceInfo interface. While QueryInterface will return a valid interface, the operation is not valid in the context of the cluster, and the result is an interface that represents no real cluster object.


In the following code, the section enclosed by C-style comments will fail per the previous paragraph.

// Context is a resource extension.
HRESULT CExtObject::HrGetResourceInfo( IGetClusterResourceInfo *piResInfo )
  HRESULT   hr;
  HGROUP    hGroup;
  HCLUSTER  hCluster;
  DWORD     cchNameSize = MAX_NAME_SIZE; // 256
  WCHAR     szGroupName[cchNameSize];

IGetClusterGroupInfo *pGrpInfo;

hRes = piResInfo->GetResourceHandle();

// // Get group handle // /******************************************************************* // Incorrect:

// // Obtain an IGetClusterGroupInfo interface from // IGetClusterResourceInfo. By the rules of QueryInterface, this // must return a valid interface. But it is not a valid cluster // operation so the interface won't represent a real object. // hr = pResInfo->QueryInterface( IID_IGetClusterGroupInfo, (LPVOID *) &pGrpInfo );

// // Interface is valid, will pass this test. // if( FAILED( hr ) ) goto Error;

// // FAILS! // Interface does not represent a real cluster object. //
hGrp = pGrpInfo->GetGroupHandle( 0 );

*******************************************************************/ // Correct:
// // Use the valid resource handle to call GetClusterResourceState. // This yields the name of the group to which it belongs, which // can be used to obtain a group handle. // dwState = GetClusterResourceState( hRes, NULL, 0, szGroupName, &cchGroupNameSize );

// Add error check.

hCluster = OpenCluster( g_szClusterName );

// Add error check.

hGrp = OpenClusterGroup( hCluster, szGroupName );

// After error check, use group handle...



Windows version None supported Windows Server 2003 Enterprise, Windows Server 2003 Datacenter
Target Platform Windows
Header cluadmex.h

See Also

Failover Cluster Administrator Information Interfaces