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
2.5 KiB

  1. //+-----------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (c) Microsoft Corporation 1992 - 1996
  6. //
  7. // File: bndcache.h
  8. //
  9. // Contents: Prototypes and types for binding handle cache
  10. //
  11. //
  12. // History: 13-August-1996 Created MikeSw
  13. //
  14. //------------------------------------------------------------------------
  15. #ifndef __BNDCACHE_H__
  16. #define __BNDCACHE_H__
  17. //
  18. // All global variables declared as EXTERN will be allocated in the file
  19. // that defines TKTCACHE_ALLOCATE
  20. //
  21. #ifdef EXTERN
  22. #undef EXTERN
  23. #endif
  24. #ifdef BNDCACHE_ALLOCATE
  25. #define EXTERN
  26. #else
  27. #define EXTERN extern
  28. #endif
  29. EXTERN BOOLEAN KerberosBindingCacheInitialized;
  30. EXTERN KERBEROS_LIST KerbBindingCache;
  31. typedef struct _KERB_BINDING_CACHE_ENTRY {
  32. KERBEROS_LIST_ENTRY ListEntry;
  33. TimeStamp DiscoveryTime;
  34. UNICODE_STRING RealmName;
  35. UNICODE_STRING KdcAddress;
  36. ULONG AddressType;
  37. ULONG Flags; // These are requested flags for DsGetDcName
  38. ULONG DcFlags; // These are flags returned by DsGetDcName
  39. ULONG CacheFlags; // Valid CacheFlags are listed below
  40. } KERB_BINDING_CACHE_ENTRY, *PKERB_BINDING_CACHE_ENTRY;
  41. // Valid CacheFlags
  42. #define KERB_BINDING_LOCAL 0x80000000
  43. #define KERB_BINDING_NO_TCP 0x40000000
  44. #define KERB_BINDING_NEGATIVE_ENTRY 0x20000000
  45. #define KERB_NO_DC_FLAGS 0x10000000
  46. VOID
  47. KerbDereferenceBindingCacheEntry(
  48. IN PKERB_BINDING_CACHE_ENTRY BindingCacheEntry
  49. );
  50. VOID
  51. KerbReferenceBindingCacheEntry(
  52. IN PKERB_BINDING_CACHE_ENTRY BindingCacheEntry,
  53. IN BOOLEAN RemoveFromList
  54. );
  55. NTSTATUS
  56. KerbInitBindingCache(
  57. VOID
  58. );
  59. VOID
  60. KerbCleanupBindingCache(
  61. BOOLEAN FreeList
  62. );
  63. PKERB_BINDING_CACHE_ENTRY
  64. KerbLocateBindingCacheEntry(
  65. IN PUNICODE_STRING RealmName,
  66. IN ULONG DesiredFlags,
  67. IN BOOLEAN RemoveFromCache
  68. );
  69. VOID
  70. KerbFreeBindingCacheEntry(
  71. IN PKERB_BINDING_CACHE_ENTRY BindingCacheEntry
  72. );
  73. VOID
  74. KerbRemoveBindingCacheEntry(
  75. IN PKERB_BINDING_CACHE_ENTRY CacheEntry
  76. );
  77. NTSTATUS
  78. KerbCacheBinding(
  79. IN PUNICODE_STRING RealmName,
  80. IN PUNICODE_STRING KdcAddress,
  81. IN ULONG AddressType,
  82. IN ULONG Flags,
  83. IN ULONG DcFlags,
  84. IN ULONG CacheFlags,
  85. OUT PKERB_BINDING_CACHE_ENTRY * NewCacheEntry
  86. );
  87. NTSTATUS
  88. KerbRefreshBindingCacheEntry(
  89. IN PKERB_BINDING_CACHE_ENTRY CacheEntry
  90. );
  91. #endif // __TKTCACHE_H__