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.

143 lines
3.5 KiB

  1. /*++
  2. Microsoft Windows NT RPC Name Service
  3. Copyright (C) Microsoft Corporation, 1995 - 1999
  4. Module Name:
  5. locquery.h
  6. Abstract:
  7. This module contains definitions of data structures and constants used for
  8. all mailslot broadcast activity.
  9. Author:
  10. Satish Thatte (SatishT) 08/16/95 Created all the code below except where
  11. otherwise indicated.
  12. --*/
  13. #ifndef __LOCATORQUERYDEF__
  14. #define __LOCATORQUERYDEF__
  15. #include <lmcons.h> // LAN Manager common definitions
  16. #ifndef NTENV
  17. typedef unsigned short UICHAR;
  18. #endif
  19. // The following are the formats for a query on the net with mailslots.
  20. // These are mostly copied from the old locator and modified only when
  21. // absolutely necessary to avoid pulling in lots of old code, and to
  22. // avoid name clashes with the new code
  23. typedef enum {
  24. MailslotServerEntryType = 1,
  25. MailslotGroupEntryType,
  26. MailslotProfileEntryType,
  27. MailslotAnyEntryType,
  28. MailslotLastEntryType
  29. } MAILSLOT_ENTRY_TYPE ;
  30. typedef struct {
  31. GUID id;
  32. unsigned short major;
  33. unsigned short minor;
  34. } GUIDandVersion;
  35. typedef struct {
  36. RPC_SYNTAX_IDENTIFIER Interface; // inteface that we are looking for
  37. GUID Object; // Object that we are interested in
  38. WCHAR WkstaName[MAX_DOMAIN_NAME_LENGTH]; // buffer for machine name
  39. WCHAR EntryName[MAX_ENTRY_NAME_LENGTH]; // buffer for entry name
  40. } QueryPacket;
  41. typedef struct { // format of the PS back on the net
  42. WCHAR Domain[MAX_DOMAIN_NAME_LENGTH]; // buffer for domain name
  43. char Buffer[NET_REPLY_BUFFER_SIZE];
  44. } QueryReply;
  45. typedef struct {
  46. /* ENTRY_SERVER_ITEM part */
  47. /* Steve seems to marshall TYPE_ENTRY_ITEM here but the numerical
  48. value for LocalItemType happens to be the same as the value
  49. for ServerEntryType so it works most of the time !! */
  50. MAILSLOT_ENTRY_TYPE type;
  51. /* the dummy fields correspond to stuff that gets marshalled
  52. gratuitously bebause of code like Copy(&buffer,this,sizeof(*this)) */
  53. DWORD dummy1[5]; // these were pointers in x86.
  54. ULONG dummy2, dummy3; // these structs unfortunately gets sent on the wire
  55. // Making it dwords for win64
  56. RPC_SYNTAX_IDENTIFIER Interface;
  57. RPC_SYNTAX_IDENTIFIER XferSyntax;
  58. unsigned long BindingLength; /* wcslen + 1 */
  59. DWORD dummy4; // no idea why [5], don't ask me, DWORD
  60. /* ENTRY_KEY part */
  61. unsigned long EntryNameLength; /* wcslen + 1 */
  62. DWORD dummy5; // DWORD
  63. } fixed_part_of_reply;
  64. /* we aren't ready for the following yet */
  65. typedef struct {
  66. unsigned long MessageType;
  67. unsigned long SenderOsType;
  68. WCHAR RequesterName[UNCLEN+1];
  69. } QUERYLOCATOR;
  70. typedef QUERYLOCATOR * PQUERYLOCATOR;
  71. typedef struct {
  72. unsigned long MessageSenderType; // never used
  73. unsigned long Hint;
  74. unsigned long Uptime;
  75. UICHAR SenderName[UNCLEN+1];
  76. } QUERYLOCATORREPLY;
  77. typedef QUERYLOCATORREPLY * PQUERYLOCATORREPLY;
  78. /*
  79. Some Manifests
  80. */
  81. #define QUERY_MASTER_LOCATOR 0x01
  82. #define QUERY_BOUND_LOCATOR 0x02 // never used
  83. #define QUERY_DC_LOCATOR 0x04
  84. #define QUERY_ANY_LOCATOR 0x08
  85. #define OS_WIN31DOS 0x01
  86. #define OS_WFW 0x02
  87. #define OS_NTWKGRP 0x04
  88. #define OS_NTDOMAIN 0x08
  89. #define REPLY_MASTER_LOCATOR 0x01
  90. #define REPLY_BOUND_LOCATOR 0x02 // never used
  91. #define REPLY_DC_LOCATOR 0x04
  92. #define REPLY_OTHER_LOCATOR 0x08
  93. #endif