windows-nt/Source/XPSP1/NT/ds/nameres/rnr/setup/test/ghn.c

38 lines
601 B
C
Raw Normal View History

2020-09-26 03:20:57 -05:00
#include <nt.h>
#include <ntrtl.h>
#include <nturtl.h>
#include <windows.h>
#include <winsock2.h>
#include <wsipx.h>
#include <svcguid.h>
#include <nspapi.h>
#include <stdio.h>
#include <stdlib.h>
#include <rpc.h>
#include <rpcdce.h>
_cdecl
main(int argc, char **argv)
{
WSADATA wsaData;
char hostName[256];
WSAStartup( MAKEWORD(1, 1), &wsaData );
if ( !gethostname( hostName, 256 ) )
{
printf( "\nHost name is %s.\n", hostName );
}
else
{
printf( "\nNo host name.\nError: %d", WSAGetLastError() );
}
WSACleanup();
return( 0 );
}