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.

123 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 1995-2000 Microsoft Corporation
  3. Module Name:
  4. dnscmd.c
  5. Abstract:
  6. Domain Name System (DNS)
  7. DNS Directory Partition Creation Utility
  8. Author:
  9. Jeff Westhead (jwesth) April 2001
  10. Revision History:
  11. --*/
  12. #include "precomp.h"
  13. //
  14. // Debug printing (crude!)
  15. //
  16. #if DBG
  17. #define DPDBG( _DbgArg ) printf _DbgArg;
  18. #else
  19. #define DPDBG( _DbgArg )
  20. #endif
  21. #if 1
  22. int WINAPI
  23. WinMain(
  24. HINSTANCE hInst,
  25. HINSTANCE hPrevInst,
  26. LPSTR lpszCmdLn,
  27. int nShowCmd
  28. )
  29. #else
  30. INT __cdecl
  31. wmain(
  32. IN INT Argc,
  33. IN PWSTR * Argv
  34. )
  35. #endif
  36. /*++
  37. Routine Description:
  38. DnsAddDp main routine
  39. Note that this executable print no messages (except in debug mode) so no
  40. localization is required.
  41. Arguments:
  42. Command line args (currently unused)
  43. Return Value:
  44. DNS_STATUS of create partitions operation
  45. --*/
  46. {
  47. DNS_STATUS status;
  48. //
  49. // Create forest built-in directory partition.
  50. //
  51. DPDBG(( "\n" ));
  52. DPDBG(( "Attempting forest directory partition auto-create operation to local server...\n" ));
  53. status = DnssrvEnlistDirectoryPartition(
  54. L".",
  55. DNS_DP_OP_CREATE_FOREST,
  56. NULL );
  57. if ( status == ERROR_SUCCESS )
  58. {
  59. DPDBG(( "\nForest directory partition auto-create operation succeeded!\n" ));
  60. }
  61. else
  62. {
  63. DPDBG(( "\nForest directory partition auto-create operation returned %d\n", status ));
  64. }
  65. //
  66. // Create domain built-in directory partition.
  67. //
  68. DPDBG(( "\n" ));
  69. DPDBG(( "Attempting domain directory partition auto-create operation to local server...\n" ));
  70. status = DnssrvEnlistDirectoryPartition(
  71. L".",
  72. DNS_DP_OP_CREATE_DOMAIN,
  73. NULL );
  74. if ( status == ERROR_SUCCESS )
  75. {
  76. DPDBG(( "\nDomain directory partition auto-create operation succeeded!\n" ));
  77. }
  78. else
  79. {
  80. DPDBG(( "\nDomain directory partition auto-create operation returned %d\n", status ));
  81. }
  82. return status;
  83. };
  84. //
  85. // End DnsAddDp.c
  86. //