//+--------------------------------------------------------------------------- // // Microsoft Windows // Copyright (C) Microsoft Corporation, 1996. // // File:clusbrow.cpp // // Contents: To list all the clusters in the network. // // // Classes: // // Functions: // // Coupling: // // Notes: // // History: 3-24-1997 sivapad Created // //---------------------------------------------------------------------------- #define UNICODE 1 #define _UNICODE 1 #include #include #include #include #include #include #include #define SRV101_ENTRY_COUNT 1024 void Usage () { wprintf (L"clusbrow [domain:] [servertype:CORE|VS]\n") ; exit (1) ; } int __cdecl wmain (DWORD argc, WCHAR *argv[]) { PSERVER_INFO_101 srvInfo; DWORD i, dwRet, entriesRead, totalEntries ; DWORD serverType = SV_TYPE_CLUSTER_NT | SV_TYPE_CLUSTER_VS_NT ; DWORD entryCount; WCHAR blanks[] = L" "; DWORD numBlanks; WCHAR szDomainName [DNS_MAX_NAME_BUFFER_LENGTH] ; LPTSTR pszDomainName = NULL ; // Process the command line arguments for (i=1; isv101_name ); wprintf (L"%ws%.*ws", srvInfo->sv101_name, numBlanks, blanks ); if ( srvInfo->sv101_type & SV_TYPE_CLUSTER_NT && srvInfo->sv101_type & SV_TYPE_CLUSTER_VS_NT ) { wprintf(L"CORE, VS"); } else if ( srvInfo->sv101_type & SV_TYPE_CLUSTER_NT ) { wprintf(L"CORE"); } else if ( srvInfo->sv101_type & SV_TYPE_CLUSTER_VS_NT ) { wprintf(L"VS"); } else { wprintf(L"????"); } wprintf(L"\n"); ++srvInfo; } } else { wprintf (L"Error, making the actual call to NetServerEnum dwRet=%d\n", dwRet) ; exit (1) ; } return 0 ; }