/*++ Copyright (c) 1996 Microsoft Corporation Module Name: tcontrol.c Abstract: Test for cluster group controls Author: Rod Gamache (rodga) 30-Dec-1996 Revision History: --*/ #include "windows.h" #include "cluster.h" #include "stdio.h" #include "stdlib.h" #include "resapi.h" LPWSTR ClusterName=NULL; LPWSTR GroupName=NULL; LPWSTR NodeName=NULL; DWORD ControlCode=0xffffffff; DWORD Access=CLUS_ACCESS_READ; CHAR UsageText[] = "TCONTROL [-c cluster] -n node -g group -a access ControlCode\n" " cluster\tspecifies the name of the cluster to connect to\n" " node\tspecifies the node to direct the request to\n" " group\tspecifies the name of the group to control\n" " access\tspecifies the access to the group (read, write or any)\n" " ControlCode\ta number between 1 and 99\n"; void Usage( void ) { fprintf(stderr, UsageText); exit(1); } LPWSTR GetString( IN LPSTR String ) { LPWSTR wString; DWORD Length; Length = strlen(String)+1; wString = malloc(Length*sizeof(WCHAR)); if (wString == NULL) { fprintf(stderr, "GetString couldn't malloc %d bytes\n",Length*sizeof(WCHAR)); } mbstowcs(wString, String, Length); return(wString); } void ParseArgs( int argc, char *argv[] ) { int i; DWORD IntCount; DWORD Value; CHAR TestValue[16]; PUCHAR ControlData; LPWSTR access; for (i=1;i 16 ) j = 16; ZeroMemory(PrintBuffer, 18); MoveMemory(PrintBuffer, Data, j); ReturnSize -= j; for ( i = 0; i < 4; i++ ) { fprintf(stdout, " %08lx", PrintData[i]); } fprintf(stdout, " "); for ( i = 0; i < 16; i++ ) { fprintf(stdout, "%c", isprint(PrintBuffer[i])?PrintBuffer[i]:'.'); } Data += 4; fprintf(stdout, "\n"); } switch ( controlCode ) { case CLUSCTL_GROUP_GET_COMMON_PROPERTIES: controlCode = CLUSCTL_GROUP_SET_COMMON_PROPERTIES; break; case CLUSCTL_GROUP_GET_PRIVATE_PROPERTIES: controlCode = CLUSCTL_GROUP_SET_PRIVATE_PROPERTIES; break; default: controlCode = 0; break; } if ( controlCode != 0 ) { status = ClusterGroupControl( hGroup, hNode, controlCode, buffer, inputSize, NULL, 0, &ReturnSize ); } fprintf(stdout, "Status of *INPUT* Control request = %d, size = %d\n", status, ReturnSize); } LocalFree(buffer); return(0); }