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.

656 lines
27 KiB

  1. /*++ BUILD Version: 0005 // Increment this if a change has global effects
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. ntddbrow.h
  5. Abstract:
  6. This is the include file that defines all constants and types for
  7. accessing the datagram receiver device driver, better know as the
  8. Browser.
  9. Authors:
  10. Larry Osterman (larryo) & Rita Wong (ritaw) 25-Mar-1991
  11. Revision History:
  12. --*/
  13. #ifndef _NTDDBROW_
  14. #define _NTDDBROW_
  15. #if _MSC_VER > 1000
  16. #pragma once
  17. #endif
  18. #include <windef.h>
  19. #include <lmcons.h>
  20. #include <lmwksta.h>
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. //
  25. // Device Name - this string is the name of the device. It is the name
  26. // that should be passed to NtOpenFile when accessing the device.
  27. //
  28. // Note: For devices that support multiple units, it should be suffixed
  29. // with the Ascii representation of the unit number.
  30. //
  31. #define DD_BROWSER_DEVICE_NAME "\\Device\\LanmanDatagramReceiver"
  32. #define DD_BROWSER_DEVICE_NAME_U L"\\Device\\LanmanDatagramReceiver"
  33. //
  34. // The file system name as returned by
  35. // NtQueryInformationVolume(FileFsAttributeInformation)
  36. //
  37. #define DD_BROWSER_NAME "LMBROWSER"
  38. //
  39. // Name of the event used to force the scavenger thread to announce the
  40. // server.
  41. //
  42. #define SERVER_ANNOUNCE_EVENT_W L"\\LanmanServerAnnounceEvent"
  43. #define BOWSER_CONFIG_PARAMETERS L"Parameters"
  44. #define BOWSER_CONFIG_IRP_STACK_SIZE L"IrpStackSize"
  45. #define BOWSER_CONFIG_MAILSLOT_THRESHOLD L"MailslotDatagramThreshold"
  46. #define BOWSER_CONFIG_GETBLIST_THRESHOLD L"GetBrowserListThreshold"
  47. #define BOWSER_CONFIG_SERVER_DELETION_THRESHOLD L"BrowserServerDeletionThreshold"
  48. #define BOWSER_CONFIG_DOMAIN_DELETION_THRESHOLD L"BrowserDomainDeletionThreshold"
  49. #define BOWSER_CONFIG_FIND_MASTER_TIMEOUT L"BrowserFindMasterTimeout"
  50. #define BOWSER_CONFIG_MINIMUM_CONFIGURED_BROWSER L"BrowserMinimumConfiguredBrowsers"
  51. #define BROWSER_CONFIG_BACKUP_RECOVERY_TIME L"BackupBrowserRecoveryTime"
  52. #define BROWSER_CONFIG_MAXIMUM_BROWSE_ENTRIES L"MaximumBrowseEntries"
  53. #define BROWSER_CONFIG_REFUSE_RESET L"RefuseReset"
  54. //
  55. // This defines the revision of the NT browser.
  56. //
  57. // To guarantee that a newer browser is preferred over an older version, bump
  58. // this version number.
  59. //
  60. #define BROWSER_ELECTION_VERSION 0x0001
  61. #define BROWSER_VERSION_MAJOR 0x01
  62. #define BROWSER_VERSION_MINOR 0x0F
  63. //
  64. // Number of seconds a GetBrowserServerList request will wait until it forces
  65. // an election.
  66. //
  67. #define BOWSER_GETBROWSERLIST_TIMEOUT 1
  68. //
  69. // Number of retries of the GetBrowserServerList request we will issue before we
  70. // give up.
  71. //
  72. #define BOWSER_GETBROWSERLIST_RETRY_COUNT 3
  73. //
  74. // The browser service on a master browser will query the driver with this
  75. // frequency.
  76. //
  77. #define BROWSER_QUERY_DRIVER_FREQUENCY 30
  78. //
  79. // NtDeviceIoControlFile IoControlCode values for this device.
  80. //
  81. // Warning: Remember that the low two bits of the code specify how the
  82. // buffers are passed to the driver!
  83. //
  84. //
  85. // Method = 00 - Buffer both input and output buffers for the request
  86. // Method = 01 - Buffer input, map output buffer to an MDL as an IN buff
  87. // Method = 10 - Buffer input, map output buffer to an MDL as an OUT buff
  88. // Method = 11 - Do not buffer either the input or output
  89. //
  90. #define IOCTL_DGR_BASE FILE_DEVICE_NETWORK_BROWSER
  91. #define _BROWSER_CONTROL_CODE(request, method, access) \
  92. CTL_CODE(IOCTL_DGR_BASE, request, method, access)
  93. #define IOCTL_LMDR_START _BROWSER_CONTROL_CODE(0x001, METHOD_NEITHER, FILE_ANY_ACCESS)
  94. #define IOCTL_LMDR_STOP _BROWSER_CONTROL_CODE(0x002, METHOD_NEITHER, FILE_ANY_ACCESS)
  95. #define IOCTL_LMDR_ADD_NAME _BROWSER_CONTROL_CODE(0x003, METHOD_BUFFERED, FILE_ANY_ACCESS)
  96. #define IOCTL_LMDR_DELETE_NAME _BROWSER_CONTROL_CODE(0x004, METHOD_BUFFERED, FILE_ANY_ACCESS)
  97. #define IOCTL_LMDR_ADD_NAME_DOM _BROWSER_CONTROL_CODE(0x003, METHOD_NEITHER, FILE_ANY_ACCESS)
  98. #define IOCTL_LMDR_DELETE_NAME_DOM _BROWSER_CONTROL_CODE(0x004, METHOD_NEITHER, FILE_ANY_ACCESS)
  99. #define IOCTL_LMDR_ENUMERATE_NAMES _BROWSER_CONTROL_CODE(0x005, METHOD_NEITHER, FILE_ANY_ACCESS)
  100. #define IOCTL_LMDR_ENUMERATE_SERVERS _BROWSER_CONTROL_CODE(0x006, METHOD_NEITHER, FILE_ANY_ACCESS)
  101. #define IOCTL_LMDR_BIND_TO_TRANSPORT _BROWSER_CONTROL_CODE(0x007, METHOD_BUFFERED, FILE_ANY_ACCESS)
  102. #define IOCTL_LMDR_BIND_TO_TRANSPORT_DOM _BROWSER_CONTROL_CODE(0x007, METHOD_NEITHER, FILE_ANY_ACCESS)
  103. #define IOCTL_LMDR_ENUMERATE_TRANSPORTS _BROWSER_CONTROL_CODE(0x008, METHOD_NEITHER, FILE_ANY_ACCESS)
  104. #define IOCTL_LMDR_UNBIND_FROM_TRANSPORT _BROWSER_CONTROL_CODE(0x008, METHOD_BUFFERED, FILE_ANY_ACCESS)
  105. #define IOCTL_LMDR_UNBIND_FROM_TRANSPORT_DOM _BROWSER_CONTROL_CODE(0x009, METHOD_NEITHER, FILE_ANY_ACCESS)
  106. #define IOCTL_LMDR_RENAME_DOMAIN _BROWSER_CONTROL_CODE(0x00A, METHOD_NEITHER, FILE_ANY_ACCESS)
  107. #define IOCTL_LMDR_GET_BROWSER_SERVER_LIST _BROWSER_CONTROL_CODE(0x00C, METHOD_NEITHER, FILE_ANY_ACCESS)
  108. #define IOCTL_LMDR_GET_MASTER_NAME _BROWSER_CONTROL_CODE(0x00D, METHOD_BUFFERED, FILE_ANY_ACCESS)
  109. #define IOCTL_LMDR_BECOME_BACKUP _BROWSER_CONTROL_CODE(0x00E, METHOD_BUFFERED, FILE_ANY_ACCESS)
  110. #define IOCTL_LMDR_BECOME_MASTER _BROWSER_CONTROL_CODE(0x00F, METHOD_BUFFERED, FILE_ANY_ACCESS)
  111. #define IOCTL_LMDR_WAIT_FOR_MASTER_ANNOUNCE _BROWSER_CONTROL_CODE(0x011, METHOD_BUFFERED, FILE_ANY_ACCESS)
  112. #define IOCTL_LMDR_WRITE_MAILSLOT _BROWSER_CONTROL_CODE(0x012, METHOD_NEITHER, FILE_ANY_ACCESS)
  113. #define IOCTL_LMDR_UPDATE_STATUS _BROWSER_CONTROL_CODE(0x013, METHOD_NEITHER, FILE_ANY_ACCESS)
  114. #define IOCTL_LMDR_CHANGE_ROLE _BROWSER_CONTROL_CODE(0x014, METHOD_BUFFERED, FILE_ANY_ACCESS)
  115. #define IOCTL_LMDR_NEW_MASTER_NAME _BROWSER_CONTROL_CODE(0x015, METHOD_BUFFERED, FILE_ANY_ACCESS)
  116. #define IOCTL_LMDR_QUERY_STATISTICS _BROWSER_CONTROL_CODE(0x016, METHOD_BUFFERED, FILE_ANY_ACCESS)
  117. #define IOCTL_LMDR_RESET_STATISTICS _BROWSER_CONTROL_CODE(0x017, METHOD_BUFFERED, FILE_ANY_ACCESS)
  118. #define IOCTL_LMDR_DEBUG_CALL _BROWSER_CONTROL_CODE(0x018, METHOD_BUFFERED, FILE_ANY_ACCESS)
  119. #define IOCTL_LMDR_NETLOGON_MAILSLOT_READ _BROWSER_CONTROL_CODE(0x019, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
  120. #define IOCTL_LMDR_NETLOGON_MAILSLOT_ENABLE _BROWSER_CONTROL_CODE(0x020, METHOD_BUFFERED, FILE_ANY_ACCESS)
  121. #define IOCTL_LMDR_IP_ADDRESS_CHANGED _BROWSER_CONTROL_CODE(0x021, METHOD_BUFFERED, FILE_ANY_ACCESS)
  122. #define IOCTL_LMDR_ENABLE_DISABLE_TRANSPORT _BROWSER_CONTROL_CODE(0x022, METHOD_BUFFERED, FILE_ANY_ACCESS)
  123. #define IOCTL_LMDR_BROWSER_PNP_READ _BROWSER_CONTROL_CODE(0x023, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
  124. #define IOCTL_LMDR_BROWSER_PNP_ENABLE _BROWSER_CONTROL_CODE(0x024, METHOD_BUFFERED, FILE_ANY_ACCESS)
  125. #define IOCTL_LMDR_WRITE_MAILSLOT_ASYNC _BROWSER_CONTROL_CODE(0x025, METHOD_NEITHER, FILE_ANY_ACCESS)
  126. //
  127. // Identifies the data structure type for Buffer 2 of each IoCtl
  128. //
  129. typedef enum _IOCTL_LMDR_STRUCTURES {
  130. EnumerateNames, // IOCTL_LMDR_ENUMERATE_NAMES
  131. EnumerateServers, // IOCTL_LMDR_ENUMERATE_SERVERS
  132. EnumerateXports, // IOCTL_LMDR_ENUMERATE_TRANSPORTS
  133. Datagram
  134. } IOCTL_LMDR_STRUCTURES;
  135. typedef enum _DGRECEIVER_NAME_TYPE {
  136. ComputerName = 1, // 1: Computer name (signature 0), unique
  137. PrimaryDomain, // 2: Primary domain (signature 0), group
  138. LogonDomain, // 3: Logon domain (signature 0), group
  139. OtherDomain, // 4: Other domain (signature 0), group
  140. DomainAnnouncement, // 5: domain announce (__MSBROWSE__), group
  141. MasterBrowser, // 6: Master browser (domain name, signature 1d), unique
  142. BrowserElection, // 7: Election name (domain name, signature 1e), group
  143. BrowserServer, // 8: Server name (signature 20)
  144. DomainName, // 9: DC Domain name (domain name, signature 1c)
  145. PrimaryDomainBrowser, // a: PDC Browser name (domain name, signature 1b), unique
  146. AlternateComputerName, // b: Computer name (signature 0), unique
  147. } DGRECEIVER_NAME_TYPE, *PDGRECEIVER_NAME_TYPE;
  148. #ifdef ENABLE_PSEUDO_BROWSER
  149. //
  150. // Pseudo Browser Server
  151. // - pseudo level definition:
  152. // 0: Default. normal browser server.
  153. // 1: Semi Pseudo. Regular server but w/ no DMB communications.
  154. // 2: Fully Pseudo server. Black hole functionality.
  155. //
  156. #define BROWSER_NON_PSEUDO 0
  157. #define BROWSER_SEMI_PSEUDO_NO_DMB 1
  158. #define BROWSER_PSEUDO 2
  159. #endif
  160. //
  161. // LAN Man Redirector Request Packet used by the Workstation service
  162. // to pass parameters to the Redirector through Buffer 1 of
  163. // NtDeviceIoControlFile.
  164. //
  165. // Additional input or output of each IoCtl is found in Buffer 2.
  166. //
  167. #define LMDR_REQUEST_PACKET_VERSION_DOM 0x00000007L // Structure version.
  168. #define LMDR_REQUEST_PACKET_VERSION 0x00000006L // Structure version.
  169. typedef struct _LMDR_REQUEST_PACKET {
  170. IOCTL_LMDR_STRUCTURES Type; // Type of structure in Buffer 2
  171. ULONG Version; // Version of structure in Buffer 2
  172. ULONG Level; // Level of information or force level
  173. LUID LogonId; // User logon session identifier
  174. UNICODE_STRING TransportName;
  175. UNICODE_STRING EmulatedDomainName;
  176. union {
  177. struct {
  178. ULONG NumberOfMailslotBuffers;
  179. ULONG NumberOfServerAnnounceBuffers;
  180. ULONG IllegalDatagramThreshold;
  181. ULONG EventLogResetFrequency;
  182. BOOLEAN LogElectionPackets;
  183. BOOLEAN IsLanManNt;
  184. } Start; // IN
  185. struct {
  186. DGRECEIVER_NAME_TYPE Type; // Type of name
  187. ULONG DgReceiverNameLength; // Length of datagram receiver name
  188. WCHAR Name[1]; // Null terminated datagram receiver name.
  189. } AddDelName;
  190. struct {
  191. ULONG EntriesRead; // OUT Number of entries returned
  192. ULONG TotalEntries; // OUT Total entries available.
  193. ULONG TotalBytesNeeded; // OUT Number of bytes needed for API
  194. ULONG ResumeHandle; // IN OUT Resume handle
  195. } EnumerateNames; // OUT Buffer2 is an array of DGRECEIVE
  196. struct {
  197. ULONG EntriesRead; // OUT Number of entries returned
  198. ULONG TotalEntries; // OUT Total entries available
  199. ULONG TotalBytesNeeded; // OUT Total bytes needed to read all
  200. // entries
  201. ULONG ResumeHandle; // IN OUT Resume handle
  202. ULONG ServerType; // IN Type of servers to enumerate
  203. // (defined in lmserver.h)
  204. ULONG DomainNameLength; // IN Length of domain name
  205. WCHAR DomainName[1]; // IN Name of domain to enumerate servers
  206. // from
  207. } EnumerateServers; // OUT Buffer2 contains array of
  208. // ServerInfo structures
  209. struct {
  210. ULONG EntriesRead; // OUT Number of entries returned
  211. ULONG TotalEntries; // OUT Total entries available
  212. ULONG TotalBytesNeeded; // OUT Total bytes needed to read all
  213. // entries
  214. ULONG ResumeHandle; // IN OUT Resume handle
  215. } EnumerateTransports; // OUT Buffer2 contains array of
  216. struct {
  217. ULONG TransportNameLength; // not including terminator
  218. WCHAR TransportName[1]; // Name of transport provider
  219. } Bind; // IN
  220. struct {
  221. ULONG TransportNameLength; // not including terminator
  222. WCHAR TransportName[1]; // Name of transport provider
  223. } Unbind; // IN
  224. struct {
  225. ULONG EntriesRead; // OUT Number of entries returned
  226. ULONG TotalEntries; // OUT Total entries available.
  227. ULONG TotalBytesNeeded; // OUT Number of bytes needed for API
  228. ULONG ResumeHandle; // IN OUT Resume handle (Ignored)
  229. USHORT DomainNameLength; // IN Length of domain name.
  230. BOOLEAN ForceRescan; // IN Discard internal list and re-query.
  231. BOOLEAN UseBrowseList; // IN TRUE if use server list (not net)
  232. WCHAR DomainName[1]; // IN Name of domain to retreive domain for
  233. } GetBrowserServerList;
  234. // Begin Never Used (But don't delete it since it is largest branch of union)
  235. struct {
  236. LARGE_INTEGER TimeReceived; // Time request was received.
  237. LARGE_INTEGER TimeQueued; // Time request was queued.
  238. LARGE_INTEGER TimeQueuedToBrowserThread; // Time request was queued.
  239. ULONG RequestorNameLength; // Length of name requesting list
  240. ULONG Token; // Client token.
  241. USHORT RequestedCount; // Number of entries requested.
  242. WCHAR Name[1]; // IN Name of transport, OUT name of requestor
  243. } WaitForBrowserServerRequest;
  244. // End Never Used
  245. struct {
  246. ULONG MasterNameLength; // Length of name requesting list
  247. WCHAR Name[1]; // IN Name of transport, OUT name of master
  248. } WaitForMasterAnnouncement;
  249. struct {
  250. ULONG MasterNameLength; // OUT Length of master for domain
  251. WCHAR Name[1]; // IN Name of transport, OUT name of master
  252. } GetMasterName;
  253. struct {
  254. DGRECEIVER_NAME_TYPE DestinationNameType; // IN Name type of name to send.
  255. ULONG MailslotNameLength; // IN Length of mailslot name.
  256. // If 0, use default (\MAILSLOT\BROWSE)
  257. ULONG NameLength; // IN Destination name length.
  258. WCHAR Name[1]; // IN Name of destination
  259. } SendDatagram;
  260. struct {
  261. ULONG NewStatus;
  262. ULONG NumberOfServersInTable;
  263. BOOLEAN IsLanmanNt;
  264. #ifdef ENABLE_PSEUDO_BROWSER
  265. BOOLEAN PseudoServerLevel; // Warning: multi-level value. We're using
  266. // BOOLEAN size var due to back compatibility
  267. // w/ older structs. It shouldn't matter since
  268. // we're dealing w/ just very few levels.
  269. // Begin Never Used
  270. BOOLEAN NeverUsed1;
  271. BOOLEAN NeverUsed2;
  272. // End Never Used
  273. #else
  274. // Begin Never Used
  275. BOOLEAN NeverUsed1;
  276. BOOLEAN NeverUsed2;
  277. BOOLEAN NeverUsed3;
  278. // End Never Used
  279. #endif
  280. BOOLEAN MaintainServerList;
  281. } UpdateStatus;
  282. struct {
  283. UCHAR RoleModification;
  284. } ChangeRole;
  285. struct {
  286. DWORD DebugTraceBits; // IN New debug trace bits.
  287. BOOL OpenLog; // IN True if we should open log file
  288. BOOL CloseLog; // IN True if we should close log file
  289. BOOL TruncateLog; // IN True if we should truncate log
  290. WCHAR TraceFileName[1]; // IN If OpenLog, LogFileName (NT file)
  291. } Debug;
  292. struct {
  293. DWORD MaxMessageCount; // IN number of netlogon messages to queue
  294. } NetlogonMailslotEnable; // Use 0 to disable queuing
  295. struct {
  296. BOOL EnableTransport; // IN True if we should enable transport
  297. BOOL PreviouslyEnabled; // Returns if the transport was previously enabled
  298. } EnableDisableTransport;
  299. struct {
  300. BOOL ValidateOnly; // True if new name is to be validated
  301. ULONG DomainNameLength; // not including terminator
  302. WCHAR DomainName[1]; // New name of domain
  303. } DomainRename; // IN
  304. } Parameters;
  305. } LMDR_REQUEST_PACKET, *PLMDR_REQUEST_PACKET;
  306. //
  307. // Wow64: 32 bit compatibility (bug 454130)
  308. //
  309. typedef struct _LMDR_REQUEST_PACKET32 {
  310. IOCTL_LMDR_STRUCTURES Type; // Type of structure in Buffer 2
  311. ULONG Version; // Version of structure in Buffer 2
  312. ULONG Level; // Level of information or force level
  313. LUID LogonId; // User logon session identifier
  314. // 32 bit replace: UNICODE_STRING TransportName;
  315. UNICODE_STRING32 TransportName;
  316. // 32 bit replace: UNICODE_STRING EmulatedDomainName;
  317. UNICODE_STRING32 EmulatedDomainName;
  318. union {
  319. struct {
  320. ULONG NumberOfMailslotBuffers;
  321. ULONG NumberOfServerAnnounceBuffers;
  322. ULONG IllegalDatagramThreshold;
  323. ULONG EventLogResetFrequency;
  324. BOOLEAN LogElectionPackets;
  325. BOOLEAN IsLanManNt;
  326. } Start; // IN
  327. struct {
  328. DGRECEIVER_NAME_TYPE Type; // Type of name
  329. ULONG DgReceiverNameLength; // Length of datagram receiver name
  330. WCHAR Name[1]; // Null terminated datagram receiver name.
  331. } AddDelName;
  332. struct {
  333. ULONG EntriesRead; // OUT Number of entries returned
  334. ULONG TotalEntries; // OUT Total entries available.
  335. ULONG TotalBytesNeeded; // OUT Number of bytes needed for API
  336. ULONG ResumeHandle; // IN OUT Resume handle
  337. } EnumerateNames; // OUT Buffer2 is an array of DGRECEIVE
  338. struct {
  339. ULONG EntriesRead; // OUT Number of entries returned
  340. ULONG TotalEntries; // OUT Total entries available
  341. ULONG TotalBytesNeeded; // OUT Total bytes needed to read all
  342. // entries
  343. ULONG ResumeHandle; // IN OUT Resume handle
  344. ULONG ServerType; // IN Type of servers to enumerate
  345. // (defined in lmserver.h)
  346. ULONG DomainNameLength; // IN Length of domain name
  347. WCHAR DomainName[1]; // IN Name of domain to enumerate servers
  348. // from
  349. } EnumerateServers; // OUT Buffer2 contains array of
  350. // ServerInfo structures
  351. struct {
  352. ULONG EntriesRead; // OUT Number of entries returned
  353. ULONG TotalEntries; // OUT Total entries available
  354. ULONG TotalBytesNeeded; // OUT Total bytes needed to read all
  355. // entries
  356. ULONG ResumeHandle; // IN OUT Resume handle
  357. } EnumerateTransports; // OUT Buffer2 contains array of
  358. struct {
  359. ULONG TransportNameLength; // not including terminator
  360. WCHAR TransportName[1]; // Name of transport provider
  361. } Bind; // IN
  362. struct {
  363. ULONG TransportNameLength; // not including terminator
  364. WCHAR TransportName[1]; // Name of transport provider
  365. } Unbind; // IN
  366. struct {
  367. ULONG EntriesRead; // OUT Number of entries returned
  368. ULONG TotalEntries; // OUT Total entries available.
  369. ULONG TotalBytesNeeded; // OUT Number of bytes needed for API
  370. ULONG ResumeHandle; // IN OUT Resume handle (Ignored)
  371. USHORT DomainNameLength; // IN Length of domain name.
  372. BOOLEAN ForceRescan; // IN Discard internal list and re-query.
  373. BOOLEAN UseBrowseList; // IN TRUE if use server list (not net)
  374. WCHAR DomainName[1]; // IN Name of domain to retreive domain for
  375. } GetBrowserServerList;
  376. // Begin Never Used (But don't delete it since it is largest branch of union)
  377. struct {
  378. LARGE_INTEGER TimeReceived; // Time request was received.
  379. LARGE_INTEGER TimeQueued; // Time request was queued.
  380. LARGE_INTEGER TimeQueuedToBrowserThread; // Time request was queued.
  381. ULONG RequestorNameLength; // Length of name requesting list
  382. ULONG Token; // Client token.
  383. USHORT RequestedCount; // Number of entries requested.
  384. WCHAR Name[1]; // IN Name of transport, OUT name of requestor
  385. } WaitForBrowserServerRequest;
  386. // End Never Used
  387. struct {
  388. ULONG MasterNameLength; // Length of name requesting list
  389. WCHAR Name[1]; // IN Name of transport, OUT name of master
  390. } WaitForMasterAnnouncement;
  391. struct {
  392. ULONG MasterNameLength; // OUT Length of master for domain
  393. WCHAR Name[1]; // IN Name of transport, OUT name of master
  394. } GetMasterName;
  395. struct {
  396. DGRECEIVER_NAME_TYPE DestinationNameType; // IN Name type of name to send.
  397. ULONG MailslotNameLength; // IN Length of mailslot name.
  398. // If 0, use default (\MAILSLOT\BROWSE)
  399. ULONG NameLength; // IN Destination name length.
  400. WCHAR Name[1]; // IN Name of destination
  401. } SendDatagram;
  402. struct {
  403. ULONG NewStatus;
  404. ULONG NumberOfServersInTable;
  405. BOOLEAN IsLanmanNt;
  406. #ifdef ENABLE_PSEUDO_BROWSER
  407. BOOLEAN PseudoServerLevel; // Warning: multi-level value. We're using
  408. // BOOLEAN size var due to back compatibility
  409. // w/ older structs. It shouldn't matter since
  410. // we're dealing w/ just very few levels.
  411. // Begin Never Used
  412. BOOLEAN NeverUsed1;
  413. BOOLEAN NeverUsed2;
  414. // End Never Used
  415. #else
  416. // Begin Never Used
  417. BOOLEAN NeverUsed1;
  418. BOOLEAN NeverUsed2;
  419. BOOLEAN NeverUsed3;
  420. // End Never Used
  421. #endif
  422. BOOLEAN MaintainServerList;
  423. } UpdateStatus;
  424. struct {
  425. UCHAR RoleModification;
  426. } ChangeRole;
  427. struct {
  428. DWORD DebugTraceBits; // IN New debug trace bits.
  429. BOOL OpenLog; // IN True if we should open log file
  430. BOOL CloseLog; // IN True if we should close log file
  431. BOOL TruncateLog; // IN True if we should truncate log
  432. WCHAR TraceFileName[1]; // IN If OpenLog, LogFileName (NT file)
  433. } Debug;
  434. struct {
  435. DWORD MaxMessageCount; // IN number of netlogon messages to queue
  436. } NetlogonMailslotEnable; // Use 0 to disable queuing
  437. struct {
  438. BOOL EnableTransport; // IN True if we should enable transport
  439. BOOL PreviouslyEnabled; // Returns if the transport was previously enabled
  440. } EnableDisableTransport;
  441. struct {
  442. BOOL ValidateOnly; // True if new name is to be validated
  443. ULONG DomainNameLength; // not including terminator
  444. WCHAR DomainName[1]; // New name of domain
  445. } DomainRename; // IN
  446. } Parameters;
  447. } LMDR_REQUEST_PACKET32, *PLMDR_REQUEST_PACKET32;
  448. //
  449. // The NETLOGON_MAILSLOT structure describes a mailslot messages received by
  450. // the browser's IOCTL_LMDR_NETLOGON_MAILSLOT_READ
  451. //
  452. // A NETLOGON_MAILSLOT message is also returned to Netlogon when an
  453. // interesting PNP event occurs. In that case, the fields will be set as
  454. // follows:
  455. //
  456. // MailslotNameSize: 0 indicating this is a PNP event.
  457. // MailslotNameOffset: One of the NETLOGON_PNP_OPCODEs indicating the
  458. // event being notified.
  459. // TransportName*: Name of transport being affected.
  460. // DestinationName*: Name of the hosted domain being affected
  461. //
  462. typedef enum _NETLOGON_PNP_OPCODE {
  463. NlPnpMailslotMessage,
  464. NlPnpTransportBind,
  465. NlPnpTransportUnbind,
  466. NlPnpNewIpAddress,
  467. NlPnpDomainRename,
  468. NlPnpNewRole
  469. } NETLOGON_PNP_OPCODE, *PNETLOGON_PNP_OPCODE;
  470. typedef struct {
  471. LARGE_INTEGER TimeReceived;
  472. DWORD MailslotNameSize; // Unicode name of mailslot message was received on
  473. DWORD MailslotNameOffset;
  474. DWORD TransportNameSize; // Unicode name of transport message was received on
  475. DWORD TransportNameOffset;
  476. DWORD MailslotMessageSize;// Actual mailslot message
  477. DWORD MailslotMessageOffset;
  478. DWORD DestinationNameSize;// Unicode name of computer or domain message was received on
  479. DWORD DestinationNameOffset;
  480. DWORD ClientSockAddrSize; // IP Address (Sockaddr) (Network byte order) of the sender
  481. // 0: if not an IP transport
  482. DWORD ClientSockAddrOffset;
  483. } NETLOGON_MAILSLOT, *PNETLOGON_MAILSLOT;
  484. //
  485. // The DGRECEIVE structure describes the list of names that have been
  486. // added to the datagram browser.
  487. //
  488. typedef struct _DGRECEIVE_NAMES {
  489. UNICODE_STRING DGReceiverName;
  490. DGRECEIVER_NAME_TYPE Type;
  491. } DGRECEIVE_NAMES, *PDGRECEIVE_NAMES;
  492. typedef struct _LMDR_TRANSPORT_LIST {
  493. ULONG NextEntryOffset; // Offset of next entry (dword aligned)
  494. ULONG TransportNameLength;
  495. ULONG Flags; // Flags for transport
  496. WCHAR TransportName[1];
  497. } LMDR_TRANSPORT_LIST, *PLMDR_TRANSPORT_LIST;
  498. #define LMDR_TRANSPORT_WANNISH 0x00000001 // If set, Xport is wannish.
  499. #define LMDR_TRANSPORT_RAS 0x00000002 // If set, Xport is RAS.
  500. #define LMDR_TRANSPORT_IPX 0x00000004 // If set, Xport is direct host IPX.
  501. #define LMDR_TRANSPORT_PDC 0x00000008 // If set, Xport has <Domain>[1B] registered
  502. //
  503. // Browser statistics.
  504. //
  505. typedef struct _BOWSER_STATISTICS {
  506. LARGE_INTEGER StartTime;
  507. LARGE_INTEGER NumberOfServerAnnouncements;
  508. LARGE_INTEGER NumberOfDomainAnnouncements;
  509. ULONG NumberOfElectionPackets;
  510. ULONG NumberOfMailslotWrites;
  511. ULONG NumberOfGetBrowserServerListRequests;
  512. ULONG NumberOfMissedServerAnnouncements;
  513. ULONG NumberOfMissedMailslotDatagrams;
  514. ULONG NumberOfMissedGetBrowserServerListRequests;
  515. ULONG NumberOfFailedServerAnnounceAllocations;
  516. ULONG NumberOfFailedMailslotAllocations;
  517. ULONG NumberOfFailedMailslotReceives;
  518. ULONG NumberOfFailedMailslotWrites;
  519. ULONG NumberOfFailedMailslotOpens;
  520. ULONG NumberOfDuplicateMasterAnnouncements;
  521. LARGE_INTEGER NumberOfIllegalDatagrams;
  522. } BOWSER_STATISTICS, *PBOWSER_STATISTICS;
  523. #ifdef __cplusplus
  524. }
  525. #endif
  526. #endif // ifndef _NTDDBROW_