Source code of Windows XP (NT5)
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.

127 lines
2.3 KiB

  1. typedef struct _ADS_LDP {
  2. LIST_ENTRY List ;
  3. LPWSTR Server ;
  4. ULONG RefCount ;
  5. LUID Luid ;
  6. LUID ModifiedId;
  7. DWORD Flags ;
  8. LDAP *LdapHandle ;
  9. CCredentials *pCredentials;
  10. DWORD PortNumber;
  11. DWORD TickCount ;
  12. _ADS_LDP **ReferralEntries;
  13. DWORD nReferralEntries;
  14. BOOL fKeepAround;
  15. DWORD dwLastUsed;
  16. LIST_ENTRY ReferralList;
  17. } ADS_LDP, *PADS_LDP, *PADSLDP ;
  18. extern LUID ReservedLuid ;
  19. #define MAX_BIND_CACHE_SIZE 100
  20. #define MAX_REFERRAL_ENTRIES 32
  21. #define ENTER_BIND_CRITSECT() EnterCriticalSection(&BindCacheCritSect)
  22. #define LEAVE_BIND_CRITSECT() LeaveCriticalSection(&BindCacheCritSect)
  23. #define LDP_CACHE_INVALID (0x00000001)
  24. //
  25. // The following is used to specify ADS_AUTHENTICATION_ENUM flags
  26. // which are to be ignored when deciding whether a cached connection
  27. // can be reused. Set the bits corresponding to the flags to be ignored
  28. // to 1.
  29. //
  30. #define BIND_CACHE_IGNORED_FLAGS (ADS_FAST_BIND \
  31. | ADS_SERVER_BIND \
  32. | ADS_AUTH_RESERVED \
  33. )
  34. DWORD
  35. BindCacheAllocEntry(
  36. ADS_LDP **ppCacheEntry
  37. ) ;
  38. VOID
  39. BindCacheInvalidateEntry(
  40. ADS_LDP *pCacheEntry
  41. ) ;
  42. PADS_LDP
  43. BindCacheLookup(
  44. LPWSTR Address,
  45. LUID Luid,
  46. LUID ModifiedId,
  47. CCredentials& Credentials,
  48. DWORD dwPort
  49. ) ;
  50. BOOL
  51. CanCredentialsBeReused(
  52. CCredentials *pCachedCreds,
  53. CCredentials *pIncomingCreds
  54. );
  55. PADS_LDP
  56. GetCacheEntry(
  57. PLDAP pLdap
  58. ) ;
  59. DWORD
  60. BindCacheAdd(
  61. LPWSTR Address,
  62. LUID Luid,
  63. LUID ModifiedId,
  64. CCredentials& Credentials,
  65. DWORD dwPort,
  66. ADS_LDP *pCacheEntry
  67. ) ;
  68. DWORD
  69. BindCacheDeref(
  70. ADS_LDP *pCacheEntry
  71. ) ;
  72. DWORD
  73. BindCacheDerefHelper(
  74. ADS_LDP *pCacheEntry,
  75. LIST_ENTRY* DeleteListEntry
  76. ) ;
  77. DWORD
  78. BindCacheGetLuid(
  79. LUID *Luid,
  80. LUID *ModifiedId
  81. ) ;
  82. VOID
  83. BindCacheInit(
  84. VOID
  85. );
  86. VOID
  87. BindCacheCleanup(
  88. VOID
  89. );
  90. BOOL
  91. AddReferralLink(
  92. PADS_LDP pPrimaryEntry,
  93. PADS_LDP pNewEntry
  94. );
  95. BOOL
  96. BindCacheAddRef(
  97. ADS_LDP *pCacheEntry
  98. );
  99. //
  100. // Mark handle so that we keep it around for 5 min after
  101. // last usage and only then delete it.
  102. //
  103. HRESULT
  104. LdapcKeepHandleAround(
  105. ADS_LDP *ld
  106. );