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.

190 lines
4.8 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. announce.h
  5. Abstract:
  6. This module defines the structures for the bowsers server announcement
  7. table
  8. Author:
  9. Larry Osterman (larryo) 18-Oct-1991
  10. Revision History:
  11. 18-Oct-1991 larryo
  12. Created
  13. --*/
  14. #ifndef _ANNOUNCE_
  15. #define _ANNOUNCE_
  16. //
  17. // The ANNOUNCE_ENTRY structure is used to hold a server announcement
  18. // inside the bowser FSP announcement database. This structure is allocated
  19. // out of paged pool.
  20. //
  21. //
  22. // Note that text strings are kept internally as unicode, not ANSI in the
  23. // announcement database.
  24. //
  25. #define ANNOUNCE_OLD_BACKUP 0x00000001
  26. typedef struct _ANNOUNCE_ENTRY {
  27. CSHORT Signature;
  28. CSHORT Size;
  29. ULONG ExpirationTime; // Time server was last seen.
  30. ULONG SerialId; // Serial resume key.
  31. LIST_ENTRY BackupLink; // Link if backup browser.
  32. PBOWSER_NAME Name; // The domain this is on.
  33. USHORT ServerBrowserVersion; // Browser version of server.
  34. WCHAR ServerName[NETBIOS_NAME_LEN+1]; // Server's name (UNICODE)
  35. ULONG ServerType; // Bitmask of server type
  36. UCHAR ServerVersionMajor; // Server's software version.
  37. UCHAR ServerVersionMinor; // Server's software version II
  38. USHORT ServerPeriodicity; // Server's announcement frequency in sec.
  39. ULONG Flags; // Flags for server.
  40. ULONG NumberOfPromotionAttempts; // Number of times we tried to promote.
  41. WCHAR ServerComment[LM20_MAXCOMMENTSZ+1]; // Servers comment (UNICODE).
  42. } ANNOUNCE_ENTRY, *PANNOUNCE_ENTRY;
  43. //
  44. // The VIEWBUFFER structure is a structure that is used to hold the contents
  45. // of a server announcement between the announcement being received in the
  46. // bowser's receive datagram indication routine and the announcement being
  47. // actually being placed into the announcement database.
  48. //
  49. typedef struct _VIEW_BUFFER {
  50. CSHORT Signature;
  51. CSHORT Size;
  52. union {
  53. LIST_ENTRY NextBuffer; // Pointer to next buffer.
  54. WORK_QUEUE_ITEM WorkHeader; // Executive worker item header.
  55. } Overlay;
  56. PTRANSPORT_NAME TransportName;
  57. BOOLEAN IsMasterAnnouncement;
  58. UCHAR ServerName[NETBIOS_NAME_LEN+1]; // Server's name (ANSI).
  59. USHORT ServerBrowserVersion; // Browser version of server.
  60. UCHAR ServerVersionMajor; // Server's software version.
  61. UCHAR ServerVersionMinor; // Server's software version II
  62. USHORT ServerPeriodicity; // Announcement freq. in sec.
  63. ULONG ServerType; // Bitmask of server type
  64. UCHAR ServerComment[LM20_MAXCOMMENTSZ+1]; // Servers comment (ANSI).
  65. } VIEW_BUFFER, *PVIEW_BUFFER;
  66. //
  67. // Specify the maximum number of threads that will be used to
  68. // process server announcements.
  69. //
  70. //
  71. // Since there is never any parallelism that can be gained from having
  72. // multiple threads, we limit this to 1 thread.
  73. //
  74. #define BOWSER_MAX_ANNOUNCE_THREADS 1
  75. DATAGRAM_HANDLER(
  76. BowserHandleServerAnnouncement);
  77. DATAGRAM_HANDLER(
  78. BowserHandleDomainAnnouncement);
  79. RTL_GENERIC_COMPARE_RESULTS
  80. BowserCompareAnnouncement(
  81. IN PRTL_GENERIC_TABLE Table,
  82. IN PVOID FirstStruct,
  83. IN PVOID SecondStruct
  84. );
  85. PVOID
  86. BowserAllocateAnnouncement(
  87. IN PRTL_GENERIC_TABLE Table,
  88. IN CLONG ByteSize
  89. );
  90. VOID
  91. BowserFreeAnnouncement (
  92. IN PRTL_GENERIC_TABLE Table,
  93. IN PVOID Buffer
  94. );
  95. PVIEW_BUFFER
  96. BowserAllocateViewBuffer(
  97. VOID
  98. );
  99. VOID
  100. BowserFreeViewBuffer(
  101. IN PVIEW_BUFFER Buffer
  102. );
  103. VOID
  104. BowserProcessHostAnnouncement(
  105. IN PVOID Context
  106. );
  107. VOID
  108. BowserProcessDomainAnnouncement(
  109. IN PVOID Context
  110. );
  111. VOID
  112. BowserAgeServerAnnouncements(
  113. VOID
  114. );
  115. NTSTATUS
  116. BowserEnumerateServers(
  117. IN ULONG Level,
  118. IN PLUID LogonId OPTIONAL,
  119. IN OUT PULONG ResumeKey,
  120. IN ULONG ServerTypeMask,
  121. IN PUNICODE_STRING TransportName OPTIONAL,
  122. IN PUNICODE_STRING EmulatedDomainName,
  123. IN PUNICODE_STRING DomainName OPTIONAL,
  124. OUT PVOID OutputBuffer,
  125. IN ULONG OutputBufferSize,
  126. OUT PULONG EntriesRead,
  127. OUT PULONG TotalEntries,
  128. OUT PULONG TotalBytesNeeded,
  129. IN ULONG_PTR OutputBufferDisplacement
  130. );
  131. VOID
  132. BowserAnnouncementDispatch (
  133. PVOID Context
  134. );
  135. VOID
  136. BowserDeleteGenericTable(
  137. IN PRTL_GENERIC_TABLE GenericTable
  138. );
  139. NTSTATUS
  140. BowserpInitializeAnnounceTable(
  141. VOID
  142. );
  143. NTSTATUS
  144. BowserpUninitializeAnnounceTable(
  145. VOID
  146. );
  147. #endif