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.

145 lines
2.6 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Copyright (C) 1997, Microsoft Corporation.
  4. //
  5. // File: sitesup.h
  6. //
  7. // Contents: Declarations for DFS_SITE lookup support functions.
  8. //
  9. // History: 11 Nov 1997 Jharper Created
  10. //
  11. //--------------------------------------------------------------------------
  12. #ifndef __SITESUP_H_
  13. #define __SITESUP_H_
  14. //
  15. // For machine names we associate a list of sites
  16. //
  17. typedef struct _DFS_SITE_INFO {
  18. //
  19. // Type and size of this record (must be DFS_NTC_SITEINFO)
  20. //
  21. NODE_TYPE_CODE NodeTypeCode;
  22. NODE_BYTE_SIZE NodeByteSize;
  23. //
  24. // A list entry for the hash table chain.
  25. //
  26. LIST_ENTRY HashChain;
  27. //
  28. // Count (for multi-threading)
  29. // Uses ExInterlockedIncrementLong()/ExInterlockedDecrementLong
  30. //
  31. ULONG UseCount;
  32. //
  33. // Flags
  34. //
  35. ULONG Flags;
  36. //
  37. // The server name
  38. //
  39. UNICODE_STRING ServerName;
  40. //
  41. // Number of SiteNames associated with this server
  42. //
  43. ULONG SiteCount;
  44. //
  45. // The site names themselves. There are actually N of these
  46. // where N is stored in SiteCount
  47. //
  48. UNICODE_STRING SiteName[1];
  49. } DFS_SITE_INFO, *PDFS_SITE_INFO;
  50. #define SITE_INFO_DELETE_PENDING 0x00000001 // DFS_SITE_INFO should be freed
  51. //
  52. //
  53. // Declaration of the hash table. The hash table can be variably
  54. // sized, with the hash table size being a parameter of the hash
  55. // function.
  56. //
  57. typedef struct _SITE_HASH_TABLE {
  58. //
  59. // The type and size of this record (must be DFS_NTC_SITE_HASH)
  60. //
  61. NODE_TYPE_CODE NodeTypeCode;
  62. NODE_BYTE_SIZE NodeByteSize;
  63. //
  64. // Mask value for the hash function. The hash table size is
  65. // assumed to be a power of two; the mask is the size - 1.
  66. //
  67. ULONG HashMask;
  68. //
  69. // A mutex to protect access to the hash bucket chains
  70. //
  71. FAST_MUTEX HashListMutex;
  72. //
  73. // An array of list heads for the hash table chains. There
  74. // are actually N of these where N is the hash table size.
  75. //
  76. LIST_ENTRY HashBuckets[1];
  77. } SITE_HASH_TABLE, *PSITE_HASH_TABLE;
  78. NTSTATUS
  79. DfsInitSites(
  80. IN ULONG cHash
  81. );
  82. VOID
  83. DfsUninitSites(
  84. VOID
  85. );
  86. PDFS_SITE_INFO
  87. DfsLookupSiteInfo(
  88. IN PUNICODE_STRING Servername
  89. );
  90. VOID
  91. DfsReleaseSiteInfo(
  92. IN PDFS_SITE_INFO SiteInfo
  93. );
  94. NTSTATUS
  95. DfsFsctrlCreateSiteInfo(
  96. IN PIRP Irp,
  97. IN PVOID InputBuffer,
  98. IN ULONG InputBufferLength
  99. );
  100. NTSTATUS
  101. DfsFsctrlDeleteSiteInfo(
  102. IN PIRP Irp,
  103. IN PVOID InputBuffer,
  104. IN ULONG InputBufferLength
  105. );
  106. #endif // __SITESUP_H_