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.

118 lines
2.2 KiB

  1. // Copyright (c) 1997-1999 Microsoft Corporation
  2. //
  3. // DS API wrappers
  4. //
  5. // 12-16-97 sburns
  6. #ifndef DS_HPP_INCLUDED
  7. #define DS_HPP_INCLUDED
  8. class ProgressDialog;
  9. namespace DS
  10. {
  11. const int MAX_NETBIOS_NAME_LENGTH = DNLEN;
  12. const int MAX_USER_NAME_LENGTH = UNLEN;
  13. const int MAX_PASSWORD_LENGTH = PWLEN;
  14. class Error : public Win::Error
  15. {
  16. public:
  17. // Constructs a new instance.
  18. //
  19. // hr - The HRESULT this error represents.
  20. //
  21. // summaryResID - ID of the string resource that corresponds to
  22. // the summary text to be returned by GetSummary().
  23. Error(HRESULT hr, int summaryResID);
  24. Error(HRESULT hr, const String& message, const String& summary);
  25. };
  26. // abortForReplica - true if this call is a precursor to calling
  27. // CreateReplica (used to upgrade a BDC to a replica), false if the call is
  28. // to leave the server as a member server.
  29. void
  30. AbortBDCUpgrade(bool abortForReplica = false)
  31. throw (DS::Error);
  32. void
  33. DemoteDC(ProgressDialog& progressDialog)
  34. throw (DS::Error);
  35. void
  36. CreateNewDomain(ProgressDialog& progressDialog)
  37. throw (DS::Error);
  38. void
  39. CreateReplica(
  40. ProgressDialog& progressDialog,
  41. bool invokeForUpgrade = false)
  42. throw (DS::Error);
  43. bool
  44. DisjoinDomain()
  45. throw (DS::Error);
  46. // Returns true if the domain is located, false if the name is unknown
  47. // or some other error occurred.
  48. //
  49. // domainDNSName - DNS or Netbios name of domain to search for.
  50. bool
  51. DomainExists(const String& domainName);
  52. enum PriorServerRole
  53. {
  54. UNKNOWN,
  55. PDC,
  56. BDC
  57. };
  58. PriorServerRole
  59. GetPriorServerRole(bool& isUpgrade);
  60. bool
  61. IsDomainNameInUse(const String& domainName);
  62. bool
  63. IsDSRunning();
  64. void
  65. JoinDomain(
  66. const String& domainDNSName,
  67. const String& dcName,
  68. const String& userName,
  69. const EncodedString& password,
  70. const String& userDomainName)
  71. throw (DS::Error);
  72. void
  73. UpgradeBDC(ProgressDialog& progressDialog)
  74. throw (DS::Error);
  75. void
  76. UpgradePDC(ProgressDialog& progressDialog)
  77. throw (DS::Error);
  78. }
  79. #endif // DS_HPP_INCLUDED