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.

109 lines
2.2 KiB

  1. //+-----------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (c) Microsoft Corporation 1992 - 1996
  6. //
  7. // File: spncache.h
  8. //
  9. // Contents: Prototypes and types for SPN cache
  10. //
  11. //
  12. // History: 29-August-2000 Created MikeSw
  13. //
  14. //------------------------------------------------------------------------
  15. #ifndef __SPNCACHE_H__
  16. #define __SPNCACHE_H__
  17. extern BOOLEAN KerberosSpnCacheInitialized;
  18. extern KERBEROS_LIST KerbSpnCache;
  19. //
  20. // The below value tells us when to start scavenging
  21. // our cache
  22. //
  23. #define MAX_CACHE_ENTRIES 350
  24. typedef struct _SPN_CACHE_RESULT {
  25. UNICODE_STRING AccountRealm;
  26. UNICODE_STRING TargetRealm;
  27. ULONG CacheFlags;
  28. TimeStamp CacheStartTime;
  29. } SPN_CACHE_RESULT, *PSPN_CACHE_RESULT;
  30. #define MAX_RESULTS 16
  31. typedef struct _KERB_SPN_CACHE_ENTRY {
  32. KERBEROS_LIST_ENTRY ListEntry;
  33. PKERB_INTERNAL_NAME Spn;
  34. RTL_RESOURCE ResultLock;
  35. ULONG ResultCount;
  36. SPN_CACHE_RESULT Results[MAX_RESULTS];
  37. } KERB_SPN_CACHE_ENTRY, *PKERB_SPN_CACHE_ENTRY;
  38. //
  39. // Valid CacheFlags
  40. //
  41. #define KERB_SPN_UNKNOWN 0x1
  42. #define KERB_SPN_KNOWN 0x2
  43. #define KERB_SPNCACHE_KEY L"System\\CurrentControlSet\\Control\\Lsa\\Kerberos\\SpnCache"
  44. #define KERB_REALM_STRING L"Realm"
  45. //
  46. NTSTATUS
  47. KerbGetSpnCacheStatus(
  48. IN PKERB_SPN_CACHE_ENTRY CacheEntry,
  49. IN PKERB_PRIMARY_CREDENTIAL Credential,
  50. IN OUT PUNICODE_STRING SpnRealm
  51. );
  52. VOID
  53. KerbCleanupSpnCache(
  54. VOID
  55. );
  56. VOID
  57. KerbFreeSpnCacheEntry(
  58. IN PKERB_SPN_CACHE_ENTRY SpnCacheEntry
  59. );
  60. NTSTATUS
  61. KerbInitSpnCache(
  62. VOID
  63. );
  64. NTSTATUS
  65. KerbInsertSpnCacheEntry(
  66. IN PKERB_SPN_CACHE_ENTRY CacheEntry
  67. );
  68. VOID
  69. KerbDereferenceSpnCacheEntry(
  70. IN PKERB_SPN_CACHE_ENTRY SpnCacheEntry
  71. );
  72. PKERB_SPN_CACHE_ENTRY
  73. KerbLocateSpnCacheEntry(
  74. IN PKERB_INTERNAL_NAME Spn
  75. );
  76. NTSTATUS
  77. KerbUpdateSpnCacheEntry(
  78. IN OPTIONAL PKERB_SPN_CACHE_ENTRY ExistingCacheEntry,
  79. IN PKERB_INTERNAL_NAME Spn,
  80. IN PKERB_PRIMARY_CREDENTIAL AccountCredential,
  81. IN ULONG UpdateFlags,
  82. IN OPTIONAL PUNICODE_STRING NewRealm
  83. );
  84. #endif // __TKTCACHE_H__