Source code of Windows XP (NT5)
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.
 
 
 
 
 
 

43 lines
720 B

#include <nt.h>
#include <ntrtl.h>
#include <nturtl.h>
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <dnsapi.h>
_cdecl
main(int argc, char **argv)
{
LPWSTR pszHostName = NULL;
pszHostName = DnsGetHostName();
if ( pszHostName )
{
printf( "\n Host name (UNICODE): %S\n", pszHostName );
LocalFree( pszHostName );
}
else
{
printf( "\n No host name found.\n" );
}
pszHostName = (LPWSTR) DnsGetHostName_A();
if ( pszHostName )
{
printf( "\n Host name (ANSI): %s\n", (LPSTR) pszHostName );
LocalFree( pszHostName );
}
else
{
printf( "\n No host name found.\n" );
}
return(0);
}