PSS ID Number: 207576
Article Last Modified on 10/21/2003
#include "stdafx.h"
#include <windows.h>
#include <clusapi.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
HCLUSTER hCluster;
HNODE hNode;
WCHAR lpwBuffer[100];
DWORD dwcbSize;
int iCount;
int iMaxCount = 100000;
if( argc > 1 )
{
iMaxCount = atoi( argv[1] );
if( -1 == iMaxCount )
{
Sleep( 10000 );
return 0;
}
}
dwcbSize = 100;
if( GetComputerNameW( lpwBuffer, &dwcbSize ) )
{
wprintf( L"Local node name: %s\n", lpwBuffer );
hCluster = OpenCluster( NULL );
if( NULL == hCluster )
{
wprintf( L"Unable to open cluster.\n" );
}
else
{
hNode = OpenClusterNode( hCluster, lpwBuffer );
for( iCount = 0; NULL != hNode && iCount < iMaxCount; iCount++ )
{
CloseClusterNode( hNode );
hNode = OpenClusterNode( hCluster, lpwBuffer );
}
if( NULL != hNode )
{
CloseClusterNode( hNode );
}
wprintf( L"Performed %d iterations.\n", iCount );
CloseCluster( hCluster );
}
}
else
{
wprintf( L"Unable to get computer name.\n");
}
return 0;
}
Keywords: kbbug kbClustering kbfix KB207576
Technology: kbAudDeveloper kbClustServSearch kbSDKSearch kbWinSDKSearch