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.

107 lines
2.4 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // Copyright (C) 2001, Microsoft Corporation
  4. //
  5. // File: DfsDomainInformation.hxx
  6. //
  7. // Contents: the Dfs domain info class
  8. //
  9. // Classes: DfsDomainInformation
  10. //
  11. // History: apr. 8 2001, Author: udayh
  12. //
  13. //-----------------------------------------------------------------------------
  14. #ifndef __DFS_DOMAIN_INFORMATION__
  15. #define __DFS_DOMAIN_INFORMATION__
  16. #include "DfsGeneric.hxx"
  17. #include "Align.h"
  18. #include "dsgetdc.h"
  19. #include "DfsTrustedDomain.hxx"
  20. #include "DfsReferralData.h"
  21. class DfsDomainInformation: public DfsGeneric
  22. {
  23. private:
  24. DfsTrustedDomain *_pTrustedDomains;
  25. ULONG _DomainCount;
  26. BOOL _fCritInit;
  27. PCRITICAL_SECTION _pLock;
  28. ULONG _DomainReferralLength;
  29. ULONG _SkippedDomainCount;
  30. public:
  31. DfsDomainInformation( DFSSTATUS *pStatus, DFSSTATUS *pXforestStatus);
  32. virtual
  33. ~DfsDomainInformation()
  34. {
  35. if (_pTrustedDomains != NULL)
  36. {
  37. delete [] _pTrustedDomains;
  38. }
  39. if (_pLock != NULL)
  40. {
  41. if(_fCritInit)
  42. {
  43. DeleteCriticalSection(_pLock);
  44. }
  45. delete _pLock;
  46. }
  47. }
  48. #if defined (TESTING)
  49. ULONG
  50. GetDomainCount()
  51. {
  52. return _DomainCount;
  53. }
  54. DfsTrustedDomain *
  55. GetTrustedDomainForIndex(
  56. ULONG Index )
  57. {
  58. return (&_pTrustedDomains[Index]);
  59. }
  60. #endif
  61. DFSSTATUS
  62. GetDomainDcReferralInfo(
  63. PUNICODE_STRING pDomain,
  64. DfsReferralData **ppReferralData,
  65. PBOOLEAN pCacheHit )
  66. {
  67. DFSSTATUS Status = ERROR_NOT_FOUND;
  68. ULONG Index;
  69. for (Index = 0; Index < _DomainCount; Index++)
  70. {
  71. if ((&_pTrustedDomains[Index])->IsMatchingDomainName( pDomain) == TRUE)
  72. {
  73. Status = (&_pTrustedDomains[Index])->GetDcReferralData( ppReferralData,
  74. pCacheHit );
  75. break;
  76. }
  77. }
  78. return Status;
  79. }
  80. DFSSTATUS
  81. GenerateDomainReferral(
  82. REFERRAL_HEADER ** ppReferralHeader);
  83. VOID
  84. PurgeDCReferrals();
  85. };
  86. #endif // __DFS_DOMAIN_INFORMATION__