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.

133 lines
3.0 KiB

  1. //***************************************************************************
  2. //
  3. // Copyright (c) 2000-2001 Microsoft Corporation, All Rights Reserved
  4. //
  5. // NtDomain.h
  6. //
  7. // Purpose: Nt domain discovery property set provider
  8. //
  9. //***************************************************************************
  10. #ifndef _NTDOMAIN_H
  11. #define _NTDOMAIN_H
  12. // into strings.h
  13. extern LPCWSTR IDS_DomainControllerName;
  14. extern LPCWSTR IDS_DomainControllerAddress;
  15. extern LPCWSTR IDS_DomainControllerAddressType;
  16. extern LPCWSTR IDS_DomainGuid;
  17. extern LPCWSTR IDS_DomainName;
  18. extern LPCWSTR IDS_DnsForestName;
  19. extern LPCWSTR IDS_DS_PDC_Flag;
  20. extern LPCWSTR IDS_DS_WRITABLE_Flag;
  21. extern LPCWSTR IDS_DS_GC_Flag;
  22. extern LPCWSTR IDS_DS_DS_Flag;
  23. extern LPCWSTR IDS_DS_KDC_Flag;
  24. extern LPCWSTR IDS_DS_TIMESERV_Flag;
  25. extern LPCWSTR IDS_DS_DNS_CONTROLLER_Flag;
  26. extern LPCWSTR IDS_DS_DNS_DOMAIN_Flag;
  27. extern LPCWSTR IDS_DS_DNS_FOREST_Flag;
  28. extern LPCWSTR IDS_DcSiteName;
  29. extern LPCWSTR IDS_ClientSiteName;
  30. //==================================
  31. #define PROPSET_NAME_NTDOMAIN L"Win32_NTDomain"
  32. // PROPERTY SET
  33. //=============
  34. class CWin32_NtDomain: public Provider
  35. {
  36. private:
  37. // property names
  38. CHPtrArray m_pProps ;
  39. void SetPropertyTable() ;
  40. HRESULT GetDomainInfo(
  41. CNetAPI32 &a_NetAPI,
  42. bstr_t &a_bstrDomainName,
  43. CInstance *a_pInst,
  44. DWORD a_dwProps
  45. ) ;
  46. HRESULT EnumerateInstances(
  47. MethodContext *a_pMethodContext,
  48. long a_Flags,
  49. CNetAPI32 &a_rNetAPI,
  50. DWORD a_dwProps
  51. ) ;
  52. public:
  53. // Constructor/destructor
  54. //=======================
  55. CWin32_NtDomain( LPCWSTR a_Name, LPCWSTR a_Namespace ) ;
  56. ~CWin32_NtDomain() ;
  57. // Functions that provide properties with current values
  58. //======================================================
  59. HRESULT GetObject (
  60. CInstance *a_Instance,
  61. long a_Flags,
  62. CFrameworkQuery &a_rQuery
  63. ) ;
  64. HRESULT EnumerateInstances (
  65. MethodContext *a_pMethodContext,
  66. long a_Flags = 0L
  67. ) ;
  68. HRESULT ExecQuery (
  69. MethodContext *a_pMethodContext,
  70. CFrameworkQuery &a_rQuery,
  71. long a_Flags = 0L
  72. ) ;
  73. // Property offset defines
  74. enum ePropertyIDs {
  75. e_DomainControllerName, // Win32_NtDomain
  76. e_DomainControllerAddress,
  77. e_DomainControllerAddressType,
  78. e_DomainGuid,
  79. e_DomainName,
  80. e_DnsForestName,
  81. e_DS_PDC_Flag,
  82. e_DS_Writable_Flag,
  83. e_DS_GC_Flag,
  84. e_DS_DS_Flag,
  85. e_DS_KDC_Flag,
  86. e_DS_Timeserv_Flag,
  87. e_DS_DNS_Controller_Flag,
  88. e_DS_DNS_Domain_Flag,
  89. e_DS_DNS_Forest_Flag,
  90. e_DcSiteName,
  91. e_ClientSiteName,
  92. e_CreationClassName, // CIM_System
  93. e_Name, /* override from CIM_ManagedSystemElement */
  94. e_NameFormat,
  95. e_PrimaryOwnerContact,
  96. e_PrimaryOwnerName,
  97. e_Roles,
  98. e_Caption, // CIM_ManagedSystemElement
  99. e_Description,
  100. e_InstallDate,
  101. e_Status,
  102. e_End_Property_Marker, // end marker
  103. e_32bit = 32 // gens compiler error if additions to this set >= 32
  104. };
  105. };
  106. #endif // _NTDOMAIN_H