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.

136 lines
2.9 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000-2002 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // NameUtil.h
  7. //
  8. // Description:
  9. // Name resolution utility.
  10. //
  11. // Maintained By:
  12. // Galen Barbee (GalenB) 28-NOV-2000
  13. //
  14. //////////////////////////////////////////////////////////////////////////////
  15. #pragma once
  16. //
  17. // (jfranco, bug #462673) The effective limit for names passed to
  18. // DnsValidateName needs to be DNS_MAX_NAME_LENGTH - 2, because the value
  19. // mentioned in its MSDN topic (255) includes the terminating null and an
  20. // automatically inserted final dot.
  21. //
  22. #define ADJUSTED_DNS_MAX_NAME_LENGTH ( DNS_MAX_NAME_LENGTH - 2 )
  23. HRESULT
  24. HrCreateBinding(
  25. IClusCfgCallback * pcccbIn
  26. , const CLSID * pclsidLogIn
  27. , LPCWSTR pcwszNameIn
  28. , BSTR * pbstrBindingOut
  29. );
  30. HRESULT
  31. HrGetNetBIOSBinding(
  32. IClusCfgCallback * pcccbIn
  33. , const CLSID * pclsidLogIn
  34. , LPCWSTR pcwszNameIn
  35. , BSTR * pbstrBindingOut
  36. );
  37. HRESULT
  38. HrIsValidIPAddress(
  39. LPCWSTR pcwszAddressIn
  40. );
  41. HRESULT
  42. HrValidateHostnameLabel(
  43. LPCWSTR pcwszLabelIn
  44. , bool fAcceptNonRFCCharsIn
  45. );
  46. HRESULT
  47. HrValidateClusterNameLabel(
  48. LPCWSTR pcwszLabelIn
  49. , bool fAcceptNonRFCCharsIn
  50. );
  51. HRESULT
  52. HrValidateDomainName(
  53. LPCWSTR pcwszDomainIn
  54. , bool fAcceptNonRFCCharsIn
  55. );
  56. HRESULT
  57. HrValidateFQDN(
  58. LPCWSTR pcwszFQDNIn
  59. , bool fAcceptNonRFCCharsIn
  60. );
  61. enum EFQNErrorOrigin
  62. {
  63. feoLABEL = 0,
  64. feoDOMAIN,
  65. feoSYSTEM
  66. };
  67. HRESULT
  68. HrMakeFQN(
  69. LPCWSTR pcwszMachineIn // can be a hostname label, an FQDN, an FQN, or an IP address
  70. , LPCWSTR pcwszDomainIn // can be null, which means to use local machine's domain
  71. , bool fAcceptNonRFCCharsIn
  72. , BSTR * pbstrFQNOut
  73. , EFQNErrorOrigin * pefeoOut = NULL
  74. );
  75. HRESULT
  76. HrFQNToBindingString(
  77. IClusCfgCallback * pcccbIn
  78. , const CLSID * pclsidLogIn
  79. , LPCWSTR pcwszFQNIn
  80. , BSTR * pbstrBindingOut
  81. );
  82. HRESULT
  83. HrFindDomainInFQN(
  84. LPCWSTR pcwszFQNIn
  85. , size_t * pidxDomainOut
  86. );
  87. HRESULT
  88. HrExtractPrefixFromFQN(
  89. LPCWSTR pcwszFQNIn
  90. , BSTR * pbstrPrefixOut
  91. );
  92. HRESULT
  93. HrFQNIsFQDN(
  94. LPCWSTR pcwszFQNIn
  95. );
  96. HRESULT
  97. HrFQNIsFQIP(
  98. LPCWSTR pcwszFQNIn
  99. );
  100. HRESULT
  101. HrIsValidFQN(
  102. LPCWSTR pcwszFQNIn
  103. , bool fAcceptNonRFCCharsIn
  104. , HRESULT * phrValidationErrorOut = NULL
  105. );
  106. HRESULT
  107. HrValidateFQNPrefix(
  108. LPCWSTR pcwszPrefixIn
  109. , bool fAcceptNonRFCCharsIn = true
  110. );
  111. HRESULT
  112. HrGetFQNDisplayName(
  113. LPCWSTR pcwszNameIn
  114. , BSTR * pbstrShortNameOut
  115. );