IGetClusterResourceInfo interface (cluadmex.h)
[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.
Inheritance
The IGetClusterResourceInfo interface inherits from the IUnknown interface. IGetClusterResourceInfo also has these types of members:
Methods
The IGetClusterResourceInfo interface has these methods.
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. |
Remarks
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:
- IWEExtendPropertySheet::CreatePropertySheetPages
- IWEExtendContextMenu::AddContextMenuItems
- IWEExtendWizard::CreateWizardPages
- IWEExtendWizard97::CreateWizard97Pages
- IWEInvokeCommand::InvokeCommand
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.
Examples
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;
HRESOURCE hRes;
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...
}
Requirements
Requirement | Value |
---|---|
Minimum supported client | None supported |
Minimum supported server | Windows Server 2003 Enterprise, Windows Server 2003 Datacenter |
Target Platform | Windows |
Header | cluadmex.h |
See also
Failover Cluster Administrator Information Interfaces
IWEExtendContextMenu::AddContextMenuItems
IWEExtendPropertySheet::CreatePropertySheetPages
IWEExtendWizard97::CreateWizard97Pages