You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
638 B
37 lines
638 B
#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 );
|
|
}
|
|
|
|
|