Skip to content

Latest commit

 

History

History
187 lines (135 loc) · 6.1 KB

ns-clusapi-clus_starting_params.md

File metadata and controls

187 lines (135 loc) · 6.1 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NS:clusapi.CLUS_STARTING_PARAMS
CLUS_STARTING_PARAMS (clusapi.h)
Indicates whether a node's attempt to start the Cluster service represents an attempt to form or join a cluster, and whether the node has attempted to start this version of the Cluster service before.
*PCLUS_STARTING_PARAMS
CLUS_STARTING_PARAMS
CLUS_STARTING_PARAMS structure [Failover Cluster]
FALSE
PCLUS_STARTING_PARAMS
PCLUS_STARTING_PARAMS structure pointer [Failover Cluster]
TRUE
_wolf_clus_starting_params
clusapi/CLUS_STARTING_PARAMS
clusapi/PCLUS_STARTING_PARAMS
mscs.clus_starting_params
mscs\clus_starting_params.htm
MsCS
255c68ff-0ca0-4718-b7fe-c689c93d0203
12/05/2018
*PCLUS_STARTING_PARAMS, CLUS_STARTING_PARAMS, CLUS_STARTING_PARAMS structure [Failover Cluster], FALSE, PCLUS_STARTING_PARAMS, PCLUS_STARTING_PARAMS structure pointer [Failover Cluster], TRUE, _wolf_clus_starting_params, clusapi/CLUS_STARTING_PARAMS, clusapi/PCLUS_STARTING_PARAMS, mscs.clus_starting_params
clusapi.h
Windows
None supported
Windows Server 2008 Enterprise, Windows Server 2008 Datacenter
Windows
CLUS_STARTING_PARAMS, *PCLUS_STARTING_PARAMS
19H1
CLUS_STARTING_PARAMS
clusapi/CLUS_STARTING_PARAMS
PCLUS_STARTING_PARAMS
clusapi/PCLUS_STARTING_PARAMS
c++
APIRef
kbSyntax
HeaderDef
ClusAPI.h
CLUS_STARTING_PARAMS

CLUS_STARTING_PARAMS structure

-description

Indicates whether a node's attempt to start the Cluster service represents an attempt to form or join a cluster, and whether the node has attempted to start this version of the Cluster service before. Resource DLLs receive the CLUS_STARTING_PARAMS structure with the CLUSCTL_RESOURCE_TYPE_STARTING_PHASE1 and CLUSCTL_RESOURCE_TYPE_STARTING_PHASE2 control codes.

-struct-fields

-field dwSize

Byte size of the structure.

-field bForm

Indicates whether this particular start of the Cluster service represents a form or a join operation.

TRUE

The node starting the Cluster service is attempting to form a cluster. No other nodes are currently active.

FALSE

The node starting the Cluster service is attempting to join an existing cluster. At least one other node is currently active.

-field bFirst

Indicates whether this version of the Cluster service has ever started on the node.

TRUE

The node is starting a version of the Cluster service for the first time.

FALSE

The node has started this version of the Cluster service previously.

-remarks

The CLUS_STARTING_PARAMS structure allows resource DLLs to respond to the CLUSCTL_RESOURCE_TYPE_STARTING_PHASE1 and CLUSCTL_RESOURCE_TYPE_STARTING_PHASE2 control codes based on the circumstances of the start. For example, a DLL might perform special initialization steps when the cluster forms, and perform another set of operations in response to joins.

Examples

The following example illustrates an abbreviated implementation of ResourceTypeControl. For more information, see Implementing 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

-see-also

CLUSCTL_RESOURCE_TYPE_STARTING_PHASE1

CLUSCTL_RESOURCE_TYPE_STARTING_PHASE2