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.

60 lines
1.2 KiB

  1. #include <nt.h>
  2. #include <ntrtl.h>
  3. #include <nturtl.h>
  4. #include <windows.h>
  5. #include <stdio.h>
  6. #include <stdlib.h>
  7. #include <dnsapi.h>
  8. _cdecl
  9. main(int argc, char **argv)
  10. {
  11. LPWSTR pszDomain = NULL;
  12. DNS_STATUS Status = NO_ERROR;
  13. if ( argc != 2 )
  14. {
  15. printf( "\n Usage: chkname <DNS Name>\n\n" );
  16. return(-1);
  17. }
  18. Status = DnsCheckNameCollision_A( argv[1], 0 );
  19. if ( Status )
  20. {
  21. printf( "\n DnsCheckNameCollision_A( 0 ) returned error: 0x%x\n",
  22. Status );
  23. }
  24. else
  25. {
  26. printf( "\n DnsCheckNameCollision_A( 0 ) returned success\n" );
  27. }
  28. Status = DnsCheckNameCollision_A( argv[1], 1 );
  29. if ( Status )
  30. {
  31. printf( "\n DnsCheckNameCollision_A( 1 ) returned error: 0x%x\n",
  32. Status );
  33. }
  34. else
  35. {
  36. printf( "\n DnsCheckNameCollision_A( 1 ) returned success\n" );
  37. }
  38. Status = DnsCheckNameCollision_A( argv[1], 2 );
  39. if ( Status )
  40. {
  41. printf( "\n DnsCheckNameCollision_A( 2 ) returned error: 0x%x\n",
  42. Status );
  43. }
  44. else
  45. {
  46. printf( "\n DnsCheckNameCollision_A( 2 ) returned success\n" );
  47. }
  48. return(0);
  49. }