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.

226 lines
5.0 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. Nds.h
  5. Abstract:
  6. This defines the necessary NDS data structures and
  7. symbolic constants for both kernel and user mode
  8. components.
  9. Author:
  10. Cory West [CoryWest] 08-Jan-1996
  11. Revision History:
  12. --*/
  13. //
  14. // NDS Actions.
  15. //
  16. #define NDS_REQUEST 104 // NCP Function Number.
  17. #define NDS_PING 1 // Subfunction code for ping.
  18. #define NDS_ACTION 2 // Subfunction code for action.
  19. //
  20. // NDS Verb Numbers.
  21. //
  22. #define NDSV_RESOLVE_NAME 1
  23. #define NDSV_READ_ENTRY_INFO 2
  24. #define NDSV_READ 3
  25. #define NDSV_LIST 5
  26. #define NDSV_OPEN_STREAM 27
  27. #define NDSV_GET_SERVER_ADDRESS 53
  28. #define NDSV_CHANGE_PASSWORD 55
  29. #define NDSV_BEGIN_LOGIN 57
  30. #define NDSV_FINISH_LOGIN 58
  31. #define NDSV_BEGIN_AUTHENTICATE 59
  32. #define NDSV_FINISH_AUTHENTICATE 60
  33. #define NDSV_LOGOUT 61
  34. //
  35. // Rounding Macros.
  36. //
  37. #define ROUNDUP4(x) ( ( (x) + 3 ) & ( ~3 ) )
  38. #define ROUNDUP2(x) ( ( (x) + 1 ) & ( ~1 ) )
  39. //
  40. // Context Flags.
  41. //
  42. #define FLAGS_DEREF_ALIASES 0x1
  43. #define FLAGS_XLATE_STRINGS 0x2
  44. #define FLAGS_TYPELESS_NAMES 0x4
  45. #define FLAGS_ASYNC_MODE 0x8 // Not supported.
  46. #define FLAGS_CANONICALIZE_NAMES 0x10
  47. #define FLAGS_ALL_PUBLIC 0x1f
  48. //
  49. // values for RESOLVE_NAME request flags
  50. //
  51. #define RSLV_DEREF_ALIASES 0x40
  52. #define RSLV_READABLE 0x02
  53. #define RSLV_WRITABLE 0x04
  54. #define RSLV_WALK_TREE 0x20
  55. #define RSLV_CREATE_ID 0x10
  56. #define RSLV_ENTRY_ID 0x1
  57. #define RESOLVE_NAME_ACCEPT_REMOTE 1
  58. #define RESOLVE_NAME_REFER_REMOTE 2
  59. //
  60. // Confidence Levels.
  61. //
  62. #define LOW_CONF 0
  63. #define MED_CONF 1
  64. #define HIGH_CONF 2
  65. //
  66. // Referral Scopes.
  67. //
  68. #define ANY_SCOPE 0
  69. #define COUNTRY_SCOPE 1
  70. #define ORGANIZATION_SCOPE 2
  71. #define LOCAL_SCOPE 3
  72. //
  73. // Max name sizes.
  74. //
  75. #define MAX_NDS_SCHEMA_NAME_CHARS 32
  76. #define MAX_NDS_NAME_CHARS 256
  77. #define MAX_NDS_NAME_SIZE ( MAX_NDS_NAME_CHARS * 2 )
  78. #define MAX_NDS_TREE_NAME_LEN 32
  79. //
  80. // For an NDS exchange, we use buffers of this size to hold the send
  81. // and receive data. These sizes come from the Win95 implementation.
  82. //
  83. #define NDS_BUFFER_SIZE 2048
  84. #define DUMMY_ITER_HANDLE ( ( unsigned long ) 0xffffffff )
  85. #define INITIAL_ITERATION ( ( unsigned long ) 0xffffffff )
  86. #define ENTRY_INFO_NAME_VALUE 1
  87. //
  88. // Various server responses.
  89. //
  90. typedef struct {
  91. DWORD CompletionCode;
  92. DWORD RemoteEntry;
  93. DWORD EntryId;
  94. DWORD ServerNameLength;
  95. WCHAR ReferredServer[1];
  96. //
  97. // If RemoteEntry is set to RESOLVE_NAME_REFER_REMOTE,
  98. // Then the tree server doesn't know the information
  99. // about the object in question and has referred us to
  100. // the server named in ReferredServer.
  101. //
  102. } NDS_RESPONSE_RESOLVE_NAME, *PNDS_RESPONSE_RESOLVE_NAME;
  103. typedef struct {
  104. DWORD CompletionCode;
  105. DWORD EntryFlags;
  106. DWORD SubordinateCount;
  107. DWORD ModificationTime;
  108. //
  109. // Two UNICODE strings follow in standard NDS format:
  110. //
  111. // DWORD BaseClassLen;
  112. // WCHAR BaseClass[BaseClassLen];
  113. // DWORD EntryNameLen;
  114. // WCHAR EntryName[EntryNameLen];
  115. //
  116. } NDS_RESPONSE_GET_OBJECT_INFO, *PNDS_RESPONSE_GET_OBJECT_INFO;
  117. typedef struct {
  118. DWORD EntryId;
  119. DWORD Flags;
  120. DWORD SubordinateCount;
  121. DWORD ModificationTime;
  122. //
  123. // Two UNICODE strings follow in standard NDS format:
  124. //
  125. // DWORD BaseClassLen;
  126. // WCHAR BaseClass[BaseClassLen];
  127. // DWORD EntryNameLen;
  128. // WCHAR EntryName[EntryNameLen];
  129. //
  130. } NDS_RESPONSE_SUBORDINATE_ENTRY, *PNDS_RESPONSE_SUBORDINATE_ENTRY;
  131. typedef struct {
  132. DWORD CompletionCode;
  133. DWORD IterationHandle;
  134. DWORD SubordinateEntries;
  135. //
  136. // Followed by an array of NDS_SUBORDINATE_ENTRY
  137. // structures that is SubordinateEntries long.
  138. //
  139. } NDS_RESPONSE_SUBORDINATE_LIST, *PNDS_RESPONSE_SUBORDINATE_LIST;
  140. typedef struct {
  141. DWORD SyntaxID;
  142. DWORD AttribNameLength;
  143. WCHAR AttribName[1];
  144. //
  145. // AttribName is of length
  146. // AttribNameLength, of course.
  147. //
  148. DWORD NumValues;
  149. //
  150. // Followed by an array of NumValues
  151. // Attrib structures.
  152. //
  153. } NDS_ATTRIBUTE, *PNDS_ATTRIBUTE;
  154. typedef struct {
  155. DWORD CompletionCode;
  156. DWORD IterationHandle;
  157. DWORD InfoType;
  158. DWORD NumAttributes;
  159. //
  160. // Followed by an array of
  161. // NDS_ATTRIBUTE structures.
  162. //
  163. } NDS_RESPONSE_READ_ATTRIBUTE, *PNDS_RESPONSE_READ_ATTRIBUTE;
  164. typedef struct {
  165. DWORD dwLength;
  166. WCHAR Buffer[1];
  167. } NDS_STRING, *PNDS_STRING;