windows-nt/Source/XPSP1/NT/ds/dns/dnsapi/test/chkname.c

61 lines
1.2 KiB
C
Raw Permalink Normal View History

2020-09-26 03:20:57 -05:00
#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 pszDomain = NULL;
DNS_STATUS Status = NO_ERROR;
if ( argc != 2 )
{
printf( "\n Usage: chkname <DNS Name>\n\n" );
return(-1);
}
Status = DnsCheckNameCollision_A( argv[1], 0 );
if ( Status )
{
printf( "\n DnsCheckNameCollision_A( 0 ) returned error: 0x%x\n",
Status );
}
else
{
printf( "\n DnsCheckNameCollision_A( 0 ) returned success\n" );
}
Status = DnsCheckNameCollision_A( argv[1], 1 );
if ( Status )
{
printf( "\n DnsCheckNameCollision_A( 1 ) returned error: 0x%x\n",
Status );
}
else
{
printf( "\n DnsCheckNameCollision_A( 1 ) returned success\n" );
}
Status = DnsCheckNameCollision_A( argv[1], 2 );
if ( Status )
{
printf( "\n DnsCheckNameCollision_A( 2 ) returned error: 0x%x\n",
Status );
}
else
{
printf( "\n DnsCheckNameCollision_A( 2 ) returned success\n" );
}
return(0);
}