Leaked source code of windows server 2003

146 lines
3.4 KiB

  1. //+-----------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (c) Microsoft Corporation 1992 - 1996
  6. //
  7. // File: refer.h
  8. //
  9. // Contents: Structurs and prototypes for interdomain referrals
  10. //
  11. //
  12. // History: 26-Mar-1997 MikeSw Created
  13. //
  14. //------------------------------------------------------------------------
  15. #ifndef __REFER_H__
  16. #define __REFER_H__
  17. extern LIST_ENTRY KdcDomainList;
  18. extern LIST_ENTRY KdcReferralCache;
  19. extern RTL_CRITICAL_SECTION KdcDomainListLock;
  20. #define KdcLockDomainList() (RtlEnterCriticalSection(&KdcDomainListLock))
  21. #define KdcUnlockDomainList() (RtlLeaveCriticalSection(&KdcDomainListLock))
  22. //
  23. // For NT5 domains in the enterprise the dns name will contain the
  24. // real DNS name. For non- tree domains it will contain the name from
  25. // the trusted domain object
  26. //
  27. #define KDC_DOMAIN_US 0x0001
  28. #define KDC_DOMAIN_TREE_ROOT 0x0002
  29. #define KDC_TRUST_INBOUND 0x0004
  30. // cache flags
  31. #define KDC_NO_ENTRY 0x0000
  32. #define KDC_UNTRUSTED_REALM 0x0001
  33. #define KDC_TRUSTED_REALM 0x0002
  34. typedef struct _KDC_DOMAIN_INFO {
  35. LIST_ENTRY Next;
  36. UNICODE_STRING DnsName;
  37. UNICODE_STRING NetbiosName;
  38. struct _KDC_DOMAIN_INFO * ClosestRoute; // Points to referral target for this domain or NULL if unreachable
  39. ULONG Flags;
  40. ULONG Attributes;
  41. ULONG Type;
  42. LONG References;
  43. //
  44. // Types used during building the tree
  45. //
  46. struct _KDC_DOMAIN_INFO * Parent;
  47. ULONG Touched;
  48. PSID Sid;
  49. } KDC_DOMAIN_INFO, *PKDC_DOMAIN_INFO;
  50. typedef struct _REFERRAL_CACHE_ENTRY {
  51. LIST_ENTRY ListEntry;
  52. LONG References;
  53. TimeStamp EndTime;
  54. UNICODE_STRING RealmName;
  55. ULONG CacheFlags;
  56. } REFERRAL_CACHE_ENTRY, *PREFERRAL_CACHE_ENTRY;
  57. VOID
  58. KdcFreeReferralCache(
  59. IN PLIST_ENTRY ReferralCache
  60. );
  61. KERBERR
  62. KdcCheckForCrossForestReferral(
  63. OUT PKDC_TICKET_INFO ReferralTarget,
  64. OUT OPTIONAL PUNICODE_STRING ReferralRealm,
  65. OUT PKERB_EXT_ERROR pExtendedError,
  66. IN PUNICODE_STRING DestinationDomain,
  67. IN ULONG NameFlags
  68. );
  69. KERBERR
  70. KdcFindReferralTarget(
  71. OUT PKDC_TICKET_INFO ReferralTarget,
  72. OUT OPTIONAL PUNICODE_STRING ReferralRealm,
  73. OUT PKERB_EXT_ERROR pExtendedError,
  74. IN PUNICODE_STRING DestinationDomain,
  75. IN BOOLEAN ExactMatch,
  76. IN ULONG NameFlags
  77. );
  78. KERBERR
  79. KdcGetTicketInfoForDomain(
  80. OUT PKDC_TICKET_INFO TicketInfo,
  81. OUT PKERB_EXT_ERROR pExtendedError,
  82. IN PKDC_DOMAIN_INFO DomainInfo,
  83. IN KDC_DOMAIN_INFO_DIRECTION Direction
  84. );
  85. KERBERR
  86. KdcLookupDomainName(
  87. OUT PKDC_DOMAIN_INFO * DomainInfo,
  88. IN PUNICODE_STRING DomainName,
  89. IN PLIST_ENTRY DomainList
  90. );
  91. KERBERR
  92. KdcLookupDomainRoute(
  93. OUT PKDC_DOMAIN_INFO * DomainInfo,
  94. OUT PKDC_DOMAIN_INFO * ClosestRoute,
  95. IN PUNICODE_STRING DomainName,
  96. IN PLIST_ENTRY DomainList
  97. );
  98. NTSTATUS
  99. KdcBuildDomainTree(
  100. );
  101. ULONG __stdcall
  102. KdcReloadDomainTree(
  103. PVOID Dummy
  104. );
  105. fLsaTrustChangeNotificationCallback KdcTrustChangeCallback;
  106. VOID
  107. KdcFreeDomainList(
  108. IN PLIST_ENTRY DomainList
  109. );
  110. VOID
  111. KdcDereferenceDomainInfo(
  112. IN PKDC_DOMAIN_INFO DomainInfo
  113. );
  114. VOID
  115. KdcLockDomainListFn(
  116. );
  117. VOID
  118. KdcUnlockDomainListFn(
  119. );
  120. #endif // __REFER_H__