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.

125 lines
2.9 KiB

  1. // Copyright (C) 2001 Microsoft Corporation
  2. //
  3. // functions to validate a new domain name
  4. // The functions are split into validation routines
  5. // and UI retrieving error messages based on the
  6. // error codes returned from the validation routines.
  7. //
  8. // 3 December 2001 JeffJon
  9. #ifndef VALIDATEDOMAINNAME_HPP_INCLUDED
  10. #define VALIDATEDOMAINNAME_HPP_INCLUDED
  11. // Error codes for the ValidateDomainDnsNameSyntax routine
  12. typedef enum
  13. {
  14. DNS_NAME_VALID,
  15. DNS_NAME_RESERVED,
  16. DNS_NAME_NON_RFC,
  17. DNS_NAME_NON_RFC_OEM_UNMAPPABLE,
  18. DNS_NAME_NON_RFC_WITH_UNDERSCORE,
  19. DNS_NAME_TOO_LONG,
  20. DNS_NAME_BAD_SYNTAX
  21. } DNSNameSyntaxError;
  22. // Does a syntax validation of the DNS name of the domain
  23. // returning an error code from the DNSNameSyntaxError enum
  24. DNSNameSyntaxError
  25. ValidateDomainDnsNameSyntax(
  26. const String& domainName);
  27. bool
  28. ValidateDomainDnsNameSyntax(
  29. HWND parentDialog,
  30. int editResID,
  31. const Popup& popup);
  32. bool
  33. ValidateDomainDnsNameSyntax(
  34. HWND parentDialog,
  35. int editResID,
  36. const Popup& popup,
  37. bool warnOnNonRFC,
  38. bool* isNonRFC = 0);
  39. bool
  40. ValidateDomainDnsNameSyntax(
  41. HWND parentDialog,
  42. const String& domainName,
  43. int editResID,
  44. const Popup& popup,
  45. bool warnOnNonRFC,
  46. bool* isNonRFC = 0);
  47. typedef enum
  48. {
  49. FOREST_DOMAIN_NAME_EXISTS,
  50. FOREST_DOMAIN_NAME_EMPTY,
  51. FOREST_DOMAIN_NAME_DUPLICATE,
  52. FOREST_NETWORK_UNREACHABLE,
  53. FOREST_DOMAIN_NAME_DOES_NOT_EXIST
  54. } ForestNameExistsError;
  55. // Checks to see if the name already exists as a domain
  56. ForestNameExistsError
  57. ForestValidateDomainDoesNotExist(
  58. const String& name);
  59. // Checks to see if the name already exists as a domain by
  60. // retrieving the name from the specified UI control and then
  61. // calling the overloaded ForestValidateDomainDoesNotExist
  62. bool
  63. ForestValidateDomainDoesNotExist(
  64. HWND parentDialog,
  65. int editResID,
  66. const Popup& popup);
  67. // If the new domain name is a single DNS label, then ask the user to confirm
  68. // that name. If the user rejects the name, set focus to the domain name edit
  69. // box, return false. Otherwise, return true.
  70. //
  71. // parentDialog - HWND of the dialog with the edit box control.
  72. //
  73. // editResID - resource ID of the domain name edit box containing the name to
  74. // be confirmed.
  75. //
  76. // 309670
  77. bool
  78. ConfirmNetbiosLookingNameIsReallyDnsName(
  79. HWND parentDialog,
  80. int editResID,
  81. const Popup& popup);
  82. typedef enum
  83. {
  84. NETBIOS_NAME_VALID,
  85. NETBIOS_NAME_DOT,
  86. NETBIOS_NAME_EMPTY,
  87. NETBIOS_NAME_NUMERIC,
  88. NETBIOS_NAME_BAD,
  89. NETBIOS_NAME_TOO_LONG,
  90. NETBIOS_NAME_INVALID,
  91. NETBIOS_NAME_DUPLICATE,
  92. NETBIOS_NETWORK_UNREACHABLE
  93. } NetbiosNameError;
  94. NetbiosNameError
  95. ValidateDomainNetbiosName(
  96. const String& name);
  97. bool
  98. ValidateDomainNetbiosName(
  99. HWND dialog,
  100. int editResID,
  101. const Popup& popup);
  102. #endif // VALIDATEDOMAINNAME_HPP_INCLUDED