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.

130 lines
3.0 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1994 - 1998.
  5. //
  6. // File: rootdse.hxx
  7. //
  8. // Contents: Class to encapsulate work needed to get information from
  9. // RootDSE.
  10. //
  11. // Classes: CRootDSE
  12. //
  13. // History: 02-25-1998 DavidMun Created
  14. //
  15. //---------------------------------------------------------------------------
  16. #ifndef __ROOTDSE_HXX_
  17. #define __ROOTDSE_HXX_
  18. //+--------------------------------------------------------------------------
  19. //
  20. // Class: CRootDSE
  21. //
  22. // Purpose: Class used to fetch interfaces to objects accessed through
  23. // the RootDSE container.
  24. //
  25. // History: 02-25-1998 DavidMun Created
  26. //
  27. //---------------------------------------------------------------------------
  28. class CRootDSE: public CBitFlag
  29. {
  30. public:
  31. CRootDSE();
  32. CRootDSE(
  33. const CRootDSE &rdse);
  34. CRootDSE &
  35. operator=(
  36. const CRootDSE &rdse);
  37. HRESULT
  38. Init(
  39. PCWSTR pwzTargetDomain,
  40. PCWSTR pwzTargetForest);
  41. ~CRootDSE();
  42. HRESULT
  43. BindToWellKnownPrincipalsContainer(
  44. HWND hwnd,
  45. REFIID riid,
  46. void **ppvInterface) const;
  47. HRESULT
  48. BindToDisplaySpecifiersContainer(
  49. HWND hwnd,
  50. REFIID riid,
  51. void **ppvInterface) const;
  52. PCWSTR
  53. GetTargetComputerDomain();
  54. PCWSTR
  55. GetTargetComputerRootDomain() const;
  56. String
  57. GetSchemaNc(
  58. HWND hwnd) const;
  59. private:
  60. HRESULT
  61. _Init(
  62. HWND hwnd) const;
  63. mutable IADs *m_pADsRootDSE;
  64. mutable Bstr m_bstrConfigNamingContext;
  65. mutable Bstr m_bstrSchemaNamingContext;
  66. WCHAR m_wzTargetDomain[MAX_PATH];
  67. WCHAR m_wzTargetForest[MAX_PATH];
  68. //
  69. //If the init failed, return the actual error instead of E_FAIL
  70. //
  71. mutable HRESULT m_hrInitFailed;
  72. };
  73. //+--------------------------------------------------------------------------
  74. //
  75. // Member: CRootDSE::GetTargetComputerDomain
  76. //
  77. // Synopsis: Return domain to which target machine is joined
  78. //
  79. // History: 07-21-1998 DavidMun Created
  80. //
  81. //---------------------------------------------------------------------------
  82. inline PCWSTR
  83. CRootDSE::GetTargetComputerDomain()
  84. {
  85. return m_wzTargetDomain;
  86. }
  87. //+--------------------------------------------------------------------------
  88. //
  89. // Member: CRootDSE::GetTargetComputerDomain
  90. //
  91. // Synopsis: Return name of root domain of tree to which the domain the
  92. // target machine is joined belongs.
  93. //
  94. // History: 07-21-1998 DavidMun Created
  95. //
  96. //---------------------------------------------------------------------------
  97. inline PCWSTR
  98. CRootDSE::GetTargetComputerRootDomain() const
  99. {
  100. return m_wzTargetForest;
  101. }
  102. #endif // __ROOTDSE_HXX_