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.

144 lines
3.0 KiB

  1. // Copyright (c) 1997-1999 Microsoft Corporation
  2. //
  3. // DS utility functions
  4. //
  5. // 3-11-99 sburns
  6. #ifndef DSUTIL_HPP_INCLUDED
  7. #define DSUTIL_HPP_INCLUDED
  8. // Returns true if the dcpromo wizard UI is running on the local machine,
  9. // false if not.
  10. bool
  11. IsDcpromoRunning();
  12. // Returns true if a domain controller for the domain can be contacted, false
  13. // if not.
  14. bool
  15. IsDomainReachable(const String& domainName);
  16. // Returns true if the directory service is running on this computer, false
  17. // if not.
  18. bool
  19. IsDSRunning();
  20. // Caller must unbind the handle with DsUnbind
  21. HRESULT
  22. MyDsBind(const String& dcName, const String& dnsDomain, HANDLE& hds);
  23. // username may be empty, which means use null, default credentials
  24. HRESULT
  25. MyDsBindWithCred(
  26. const String& dcName,
  27. const String& dnsDomain,
  28. const String& username,
  29. const String& userDomain,
  30. const EncryptedString& password,
  31. HANDLE& hds);
  32. // Caller must free info with ::NetApiBufferFree
  33. HRESULT
  34. MyDsGetDcName(
  35. const TCHAR* machine,
  36. const String& domainName,
  37. ULONG flags,
  38. DOMAIN_CONTROLLER_INFO*& info);
  39. // Caller must free info with ::NetApiBufferFree
  40. HRESULT
  41. MyDsGetDcNameWithAccount(
  42. const TCHAR* machine,
  43. const String& accountName,
  44. ULONG allowedAccountFlags,
  45. const String& domainName,
  46. ULONG flags,
  47. DOMAIN_CONTROLLER_INFO*& info);
  48. // Caller needs to delete info with (My)DsFreeDomainControllerInfo
  49. HRESULT
  50. MyDsGetDomainControllerInfo(
  51. HANDLE hDs,
  52. const String& domainName,
  53. DWORD& cOut,
  54. DS_DOMAIN_CONTROLLER_INFO_1W*& info);
  55. // Caller needs to delete info with (My)DsFreeDomainControllerInfo
  56. HRESULT
  57. MyDsGetDomainControllerInfo(
  58. HANDLE hDs,
  59. const String& domainName,
  60. DWORD& cOut,
  61. DS_DOMAIN_CONTROLLER_INFO_2W*& info);
  62. void
  63. MyDsFreeDomainControllerInfo(
  64. DWORD cOut,
  65. DS_DOMAIN_CONTROLLER_INFO_1W* info);
  66. void
  67. MyDsFreeDomainControllerInfo(
  68. DWORD cOut,
  69. DS_DOMAIN_CONTROLLER_INFO_2W* info);
  70. // Caller needs to delete info with ::DsRoleFreeMemory.
  71. HRESULT
  72. MyDsRoleGetPrimaryDomainInformation(
  73. const TCHAR* machine,
  74. DSROLE_PRIMARY_DOMAIN_INFO_BASIC*& info);
  75. // Caller needs to delete info with ::DsRoleFreeMemory.
  76. HRESULT
  77. MyDsRoleGetPrimaryDomainInformation(
  78. const TCHAR* machine,
  79. DSROLE_OPERATION_STATE_INFO*& info);
  80. // Caller needs to delete info with ::DsRoleFreeMemory.
  81. HRESULT
  82. MyDsRoleGetPrimaryDomainInformation(
  83. const TCHAR* machine,
  84. DSROLE_UPGRADE_STATUS_INFO*& info);
  85. #endif // DSUTIL_HPP_INCLUDED