Condividi tramite


struttura CLUS_STARTING_PARAMS (clusapi.h)

Indica se il tentativo di avvio del servizio clusterdi un nodo rappresenta un tentativo di formare o aggiungere un cluster e se il nodo ha tentato di avviare questa versione del servizio cluster in precedenza. Le DLL delle risorse ricevono la struttura CLUS_STARTING_PARAMS con i codici di controllo CLUSCTL_RESOURCE_TYPE_STARTING_PHASE1 e CLUSCTL_RESOURCE_TYPE_STARTING_PHASE2 .

Sintassi

typedef struct CLUS_STARTING_PARAMS {
  DWORD dwSize;
  BOOL  bForm;
  BOOL  bFirst;
} CLUS_STARTING_PARAMS, *PCLUS_STARTING_PARAMS;

Members

dwSize

Dimensioni dei byte della struttura.

bForm

Indica se questo particolare avvio del servizio cluster rappresenta una maschera o un'operazione di join.

true

Il nodo che avvia il servizio cluster sta tentando di formare un cluster. Nessun altro nodo è attualmente attivo.

FALSE

Il nodo che avvia il servizio cluster sta tentando di aggiungere un cluster esistente. Almeno un altro nodo è attualmente attivo.

bFirst

Indica se questa versione del servizio cluster è stata avviata nel nodo.

true

Il nodo avvia una versione del servizio cluster per la prima volta.

FALSE

Il nodo ha avviato questa versione del servizio cluster in precedenza.

Commenti

La struttura CLUS_STARTING_PARAMS consente alle DLL delle risorse di rispondere ai codici di controllo CLUSCTL_RESOURCE_TYPE_STARTING_PHASE1 e CLUSCTL_RESOURCE_TYPE_STARTING_PHASE2 in base alle circostanze dell'inizio. Ad esempio, una DLL può eseguire passaggi di inizializzazione speciali quando i moduli del cluster ed eseguire un altro set di operazioni in risposta ai join.

Esempio

Nell'esempio seguente viene illustrata un'implementazione abbreviata di ResourceTypeControl. Per altre informazioni, vedere Implementazione di ResourceTypeControl.

const LPWSTR g_MY_RESOURCE_TYPE_NAME[] =
{
    L"MyType_0",
    L"MyType_1",
    L"MyType_2",
    L"MyType_3"
};

DWORD WINAPI MyDllResourceTypeControl(
    IN LPCWSTR ResourceTypeName,
    IN DWORD ControlCode,
    IN PVOID InBuffer,
    IN DWORD InBufferSize,
    OUT PVOID OutBuffer,
    IN DWORD OutBufferSize,
    OUT LPDWORD BytesReturned
)
{
    DWORD status;
    PCLUS_STARTING_PARAMS pStart;

    switch ( ControlCode )
    {
        case CLUSCTL_RESOURCE_TYPE_STARTING_PHASE1:

            if( lstrcmpi( ResourceTypeName, g_MY_RESOURCE_TYPE_NAME[2] ) == 0 )
            {
                pStart = (PCLUS_STARTING_PARAMS) InBuffer;
                if( ( pStart->bForm == TRUE ) && 
                    ( pStart->bFirst == FALSE ) )
                {
                //  Hypothetical initialization code for resource type "MyType_2"
                //  Fires only when the cluster forms, but not for first-time launches of the Cluster service.
                }
            }
            else
            {
                status = ERROR_INVALID_FUNCTION;
            }

            break;

        case CLUSCTL_RESOURCE_TYPE_STARTING_PHASE2:

            pStart = (PCLUS_STARTING_PARAMS) InBuffer;
            if( pStart->bFirst == TRUE )
            {
            //  Hypothetical verification code for all resource types supported by the DLL
            //  Fires for first-time launches of the Cluster service
            }
            else
            {
                status = ERROR_INVALID_FUNCTION;
            }

            break;

    //  case ( Other control codes )....
    //      ...
    //      break;

        default:
            status = ERROR_INVALID_FUNCTION;
            break;

    }
    // end switch

    return( status );

}
// MyDllResourceTypeControl

Requisiti

Requisito Valore
Client minimo supportato Nessuno supportato
Server minimo supportato Windows Server 2008 Enterprise, Windows Server 2008 Datacenter
Intestazione clusapi.h

Vedi anche

CLUSCTL_RESOURCE_TYPE_STARTING_PHASE1

CLUSCTL_RESOURCE_TYPE_STARTING_PHASE2