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.

115 lines
3.8 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. //
  4. // File: DomCfg.h
  5. //
  6. // Description: DomainConfigTable header file.
  7. //
  8. // Author: mikeswa
  9. //
  10. // Copyright (C) 1998 Microsoft Corporation
  11. //
  12. //-----------------------------------------------------------------------------
  13. #ifndef __DOMCFG_H__
  14. #define __DOMCFG_H__
  15. #include <baseobj.h>
  16. #include <domhash.h>
  17. #define INT_DOMAIN_INFO_SIG 'fnID'
  18. #define DOMAIN_CONFIG_SIG ' TCD'
  19. //---[ eIntDomainInfoFlags ]---------------------------------------------------
  20. //
  21. //
  22. // Description: Internal Domain Info flags
  23. //
  24. //
  25. //-----------------------------------------------------------------------------
  26. typedef enum
  27. {
  28. INT_DOMAIN_INFO_OK = 0x00000000,
  29. INT_DOMAIN_INFO_INVALID = 0x80000000, //The domain info struct
  30. //has been replaced... if
  31. //an object has a cached
  32. //copy it should release it
  33. } eIntDomainInfoFlags;
  34. //---[ CInternalDomainInfo ]---------------------------------------------------
  35. //
  36. // Description:
  37. // A entry in CDomainConfigTable. Basically an internal wrapper for the
  38. // public DomainInfo struct.
  39. //
  40. // Hungarian: IntDomainInfo, pIntDomainInfo
  41. //
  42. //-----------------------------------------------------------------------------
  43. class CInternalDomainInfo : public CBaseObject
  44. {
  45. public:
  46. CInternalDomainInfo(DWORD dwVersion);
  47. ~CInternalDomainInfo();
  48. HRESULT HrInit(DomainInfo *pDomainInfo);
  49. DWORD m_dwSignature;
  50. DWORD m_dwIntDomainInfoFlags;
  51. DWORD m_dwVersion;
  52. DomainInfo m_DomainInfo;
  53. };
  54. //---[ CDomainConfigTable ]----------------------------------------------------
  55. //
  56. //
  57. // Description:
  58. // Contains per domain configuration information, and exposes wildcarded
  59. // hash-table based lookup of this information.
  60. //
  61. // Hungarian: dct, pdct
  62. //
  63. //-----------------------------------------------------------------------------
  64. class CDomainConfigTable
  65. {
  66. protected:
  67. DWORD m_dwSignature;
  68. DWORD m_dwCurrentConfigVersion;
  69. CInternalDomainInfo *m_pLastStarDomainInfo;
  70. DOMAIN_NAME_TABLE m_dnt;
  71. CShareLockInst m_slPrivateData;
  72. DWORD m_dwFlags;
  73. CInternalDomainInfo *m_pDefaultDomainConfig;
  74. public:
  75. CDomainConfigTable();
  76. ~CDomainConfigTable();
  77. HRESULT HrInit();
  78. HRESULT HrSetInternalDomainInfo(IN CInternalDomainInfo *pDomainInfo);
  79. HRESULT HrGetInternalDomainInfo(IN DWORD cbDomainNameLength,
  80. IN LPSTR szDomainName,
  81. OUT CInternalDomainInfo **ppDomainInfo);
  82. HRESULT HrGetDefaultDomainInfo(OUT CInternalDomainInfo **ppDomainInfo);
  83. HRESULT HrIterateOverSubDomains(DOMAIN_STRING * pstrDomain,
  84. IN DOMAIN_ITR_FN pfn,
  85. IN PVOID pvContext)
  86. {
  87. HRESULT hr = S_OK;
  88. m_slPrivateData.ShareLock();
  89. hr = m_dnt.HrIterateOverSubDomains(pstrDomain, pfn, pvContext);
  90. m_slPrivateData.ShareUnlock();
  91. return hr;
  92. };
  93. DWORD dwGetCurrentVersion() {return m_dwCurrentConfigVersion;};
  94. void StartConfigUpdate();
  95. void FinishConfigUpdate();
  96. enum _DomainConfigTableFlags
  97. {
  98. DOMCFG_DOMAIN_NAME_TABLE_INIT = 0x00000001,
  99. DOMCFG_FINISH_UPDATE_PENDING = 0x00000002, //StartConfig update has been called
  100. DOMCFG_MULTIPLE_STAR_DOMAINS = 0x00000004, //There have been more that one
  101. // "*" domain configured
  102. };
  103. };
  104. #endif //__DOMCFG_H__