コンピュータ名だけ
NetServerEnum
https://msdn.microsoft.com/ja-jp/library/cc446915.aspx
SERVER_INFO_100 構造体
https://msdn.microsoft.com/en-us/library/windows/desktop/aa370897(v=vs.85).aspx
SERVER_INFO_101 構造体
https://msdn.microsoft.com/en-us/library/windows/desktop/aa370903(v=vs.85).aspx
他にも、SERVER_INFO_102構造体とか402とかあるけど、
NetServerEnum()で使用できるかは確認していないのでわかりません。
#uselib "netapi32"
#func NetServerEnum "NetServerEnum" int, int, var, int, var, var, int, wptr, sptr
#func NetApiBufferFree "NetApiBufferFree" int
#define MAX_PREFERRED_LENGTH (-1)
#define SV_TYPE_ALL 0xFFFFFFFF
#define NERR_Success 0
#define ERROR_MORE_DATA 234
#define PLATFORM_ID_DOS 300
#define PLATFORM_ID_OS2 400
#define PLATFORM_ID_NT 500
#define PLATFORM_ID_OSF 600
#define PLATFORM_ID_VMS 700
#const NULL 0
bufptr = 0
entriesread = 0
totalentries = 0
// 今回は SERVER_INFO_100 構造体を使用する
NetServerEnum NULL, 100, bufptr, MAX_PREFERRED_LENGTH, entriesread, totalentries, SV_TYPE_ALL, 0, 0
nStatus = stat
if ((nStatus == NERR_Success) || (nStatus == ERROR_MORE_DATA)){
if (bufptr != NULL){
repeat entriesread
dupptr platform_id, bufptr + (8 * cnt) + 0, 4, 4
switch platform_id
case PLATFORM_ID_DOS
mes "platform_id: The MS-DOS platform."
swbreak
case PLATFORM_ID_OS2
mes "platform_id: The OS/2 platform."
swbreak
case PLATFORM_ID_NT
mes "platform_id: The Windows NT platform."
swbreak
case PLATFORM_ID_OSF
mes "platform_id: The OSF platform."
swbreak
case PLATFORM_ID_VMS
mes "platform_id: The VMS platform."
swbreak
default
mes "platform_id: unknown(" + platform_id + ")"
swbreak
swend
dupptr pName, bufptr + (8 * cnt) + 4, 4, 4
dupptr name, pName, 64, 2
mes "name: " + cnvwtos(name)
loop
NetApiBufferFree bufptr
}
}