Leaked source code of windows server 2003
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

  1. #include <nt.h>
  2. #include <ntrtl.h>
  3. #include <nturtl.h>
  4. #include <windows.h>
  5. #include <winsock2.h>
  6. #include <wsipx.h>
  7. #include <svcguid.h>
  8. #include <nspapi.h>
  9. #include <stdio.h>
  10. #include <stdlib.h>
  11. #include <rpc.h>
  12. #include <rpcdce.h>
  13. _cdecl
  14. main(int argc, char **argv)
  15. {
  16. WSADATA wsaData;
  17. char hostName[256];
  18. WSAStartup( MAKEWORD(1, 1), &wsaData );
  19. if ( !gethostname( hostName, 256 ) )
  20. {
  21. printf( "\nHost name is %s.\n", hostName );
  22. }
  23. else
  24. {
  25. printf( "\nNo host name.\nError: %d", WSAGetLastError() );
  26. }
  27. WSACleanup();
  28. return( 0 );
  29. }