Interfaz IGetClusterResourceInfo (cluadmex.h)
[Esta interfaz está disponible para su uso en los sistemas operativos especificados en la sección Requisitos. Se quitó la compatibilidad con esta interfaz en Windows Server 2008.]
La extensión administrador de clústeres de conmutación por error llama a la interfaz IGetClusterResourceInfo para recuperar información sobre un recurso.
Herencia
La interfaz IGetClusterResourceInfo hereda de la interfaz IUnknown . IGetClusterResourceInfo también tiene estos tipos de miembros:
Métodos
La interfaz IGetClusterResourceInfo tiene estos métodos.
IGetClusterResourceInfo::GetResourceHandle Devuelve un identificador a un recurso. |
IGetClusterResourceInfo::GetResourceNetworkName Devuelve el nombre de la red administrada por el recurso Nombre de red en el que depende un recurso. |
IGetClusterResourceInfo::GetResourceTypeName Devuelve el tipo de un recurso. |
Comentarios
Si el objeto que se extiende no es un recurso, se producirá un error en las consultas de los métodos IGetClusterResourceInfo . De lo contrario, puede usar la interfaz IGetClusterResourceInfo cuando el administrador de clústeres de conmutación por error llama a las implementaciones de los métodos siguientes:
- IWEExtendPropertySheet::CreatePropertySheetPages
- IWEExtendContextMenu::AddContextMenuItems
- IWEExtendWizard::CreateWizardPages
- IWEExtendWizard97::CreateWizard97Pages
- IWEInvokeCommand::InvokeCommand
Use la interfaz IGetClusterResourceInfo solo en el contexto de una extensión de recursos. No obtenga otras interfaces de información, como IGetClusterGroupInfo, de la interfaz IGetClusterResourceInfo . Aunque QueryInterface devolverá una interfaz válida, la operación no es válida en el contexto del clúster y el resultado es una interfaz que no representa ningún objeto de clúster real.
Ejemplos
En el código siguiente, se producirá un error en la sección entre comentarios de estilo C según el párrafo anterior.
//
// 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...
}
Requisitos
Requisito | Value |
---|---|
Cliente mínimo compatible | No se admite ninguno |
Servidor mínimo compatible | Windows Server 2003 Enterprise, Windows Server 2003 Datacenter |
Plataforma de destino | Windows |
Encabezado | cluadmex.h |
Consulte también
Interfaces de información del administrador de clústeres de conmutación por error
IWEExtendContextMenu::AddContextMenuItems
IWEExtendPropertySheet::CreatePropertySheetPages
IWEExtendWizard97::CreateWizard97Pages