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.

337 lines
12 KiB

  1. /* Structure definitions used */
  2. #include <ndssntx.h>
  3. #include <ndsattr.h>
  4. #include <ndsclass.h>
  5. /* Netware NDS general definitions */
  6. #define NDS_MAX_NAME_CHARS 256
  7. #define NDS_MAX_NAME_SIZE ( NDS_MAX_NAME_CHARS * 2 )
  8. #define NDS_MAX_SCHEMA_NAME_CHARS 32
  9. #define NDS_MAX_SCHEMA_NAME_BYTES ( 2 * ( NDS_MAX_SCHEMA_NAME_CHARS + 1 ) )
  10. #define NDS_MAX_TREE_NAME_LEN 32
  11. #define NDS_MAX_ASN1_NAME_LEN 32
  12. #define NDS_NO_MORE_ITERATIONS 0xFFFFFFFF
  13. #define NDS_INITIAL_SEARCH 0xFFFFFFFF
  14. /* Netware NDS create buffer operations */
  15. #define NDS_OBJECT_ADD 0
  16. #define NDS_OBJECT_MODIFY 1
  17. #define NDS_OBJECT_READ 2
  18. #define NDS_OBJECT_LIST_SUBORDINATES 3
  19. #define NDS_SCHEMA_DEFINE_CLASS 4
  20. #define NDS_SCHEMA_READ_ATTR_DEF 5
  21. #define NDS_SCHEMA_READ_CLASS_DEF 6
  22. #define NDS_SEARCH 7
  23. /* Netware NDS attribute modification operations */
  24. #define NDS_ATTR_ADD 0 /* Add attribute to object */
  25. #define NDS_ATTR_REMOVE 1 /* Remove attribute from object */
  26. #define NDS_ATTR_CLEAR 6 /* Remove all values from an attribute */
  27. /* Other Netware NDS attribute modification operation - NOT YET SUPPORTED */
  28. #define NDS_ATTR_ADD_VALUE 2 /* Add a value to an attribute */
  29. #define NDS_ATTR_REMOVE_VALUE 3 /* Remove a value from an attribute */
  30. #define NDS_ATTR_ADDITIONAL_VALUE 4 /* Add additional value to an attribute */
  31. #define NDS_ATTR_OVERWRITE_VALUE 5 /* Overwrite a value to an attribute */
  32. #define NDS_ATTR_CLEAR_VALUE 7 /* Remove a value from an attribute */
  33. /* Netware NDS schema attribute definition flags */
  34. #define NDS_SINGLE_VALUED_ATTR 0x0001
  35. #define NDS_SIZED_ATTR 0x0002
  36. #define NDS_NONREMOVABLE_ATTR 0x0004 // Only for NwNDSReadAttributeDef
  37. #define NDS_READ_ONLY_ATTR 0x0008 // Only for NwNDSReadAttributeDef
  38. #define NDS_HIDDEN_ATTR 0x0010 // Only for NwNDSReadAttributeDef
  39. #define NDS_STRING_ATTR 0x0020 // Only for NwNDSReadAttributeDef
  40. #define NDS_SYNC_IMMEDIATE 0x0040
  41. #define NDS_PUBLIC_READ 0x0080
  42. #define NDS_SERVER_READ 0x0100 // Only for NwNDSReadAttributeDef
  43. #define NDS_WRITE_MANAGED 0x0200
  44. #define NDS_PER_REPLICA 0x0400
  45. /* Netware NDS schema class definition flags */
  46. #define NDS_CONTAINER_CLASS 0x01
  47. #define NDS_EFFECTIVE_CLASS 0x02
  48. #define NDS_NONREMOVABLE_CLASS 0x04
  49. #define NDS_AMBIGUOUS_NAMING 0x08
  50. #define NDS_AMBIGUOUS_CONTAINMENT 0x10
  51. /* Netware NDS information flags */
  52. #define NDS_INFO_NAMES 0 // Search and Read operations
  53. #define NDS_INFO_ATTR_NAMES_VALUES 1 // Search operations
  54. #define NDS_INFO_NAMES_DEFS 1 // Read operations
  55. #define NDS_CLASS_INFO_EXPANDED_DEFS 2 // Schema class definition only
  56. /* Netware NDS information flags - NOT YET SUPPORTED */
  57. #define NDS_CLASS_INFO 3 // Schema class definition only
  58. /* Netware NDS attribute right definitions */
  59. #define NDS_RIGHT_COMPARE_ATTR 0x00000001L
  60. #define NDS_RIGHT_READ_ATTR 0x00000002L
  61. #define NDS_RIGHT_WRITE_ATTR 0x00000004L
  62. #define NDS_RIGHT_ADD_SELF_ATTR 0x00000008L
  63. #define NDS_RIGHT_SUPERVISE_ATTR 0x00000020L
  64. /* Netware NDS object right definitions */
  65. #define NDS_RIGHT_BROWSE_OBJECT 0x00000001L
  66. #define NDS_RIGHT_CREATE_OBJECT 0x00000002L
  67. #define NDS_RIGHT_DELETE_OBJECT 0x00000004L
  68. #define NDS_RIGHT_RENAME_OBJECT 0x00000008L
  69. #define NDS_RIGHT_SUPERVISE_OBJECT 0x00000010L
  70. /* Netware file right definitions */
  71. #define NW_RIGHTS WORD
  72. #define NW_RIGHT_NONE 0x0000
  73. #define NW_RIGHT_READ_FROM_FILE 0x0001
  74. #define NW_RIGHT_WRITE_TO_FILE 0x0002
  75. #define NW_RIGHT_CREATE_DIR_OR_FILE 0x0008
  76. #define NW_RIGHT_ERASE_DIR_OR_FILE 0x0010
  77. #define NW_RIGHT_ACCESS_CONTROL 0x0020
  78. #define NW_RIGHT_FILE_SCAN 0x0040
  79. #define NW_RIGHT_MODIFY_DIR_OR_FILE 0x0080
  80. #define NW_RIGHT_SUPERVISOR 0x0100
  81. #define NW_RIGHT_ALL NW_RIGHT_READ_FROM_FILE | \
  82. NW_RIGHT_WRITE_TO_FILE | \
  83. NW_RIGHT_CREATE_DIR_OR_FILE | \
  84. NW_RIGHT_ERASE_DIR_OR_FILE | \
  85. NW_RIGHT_ACCESS_CONTROL | \
  86. NW_RIGHT_FILE_SCAN | \
  87. NW_RIGHT_MODIFY_DIR_OR_FILE
  88. /* Netware NDS query node operations for building a search query */
  89. #define NDS_QUERY_OR 0x00000001L
  90. #define NDS_QUERY_AND 0x00000002L
  91. #define NDS_QUERY_NOT 0x00000003L
  92. #define NDS_QUERY_EQUAL 0x00000007L
  93. #define NDS_QUERY_GE 0x00000008L
  94. #define NDS_QUERY_LE 0x00000009L
  95. #define NDS_QUERY_APPROX 0x0000000AL
  96. #define NDS_QUERY_PRESENT 0x0000000FL
  97. /* Netware NDS function return codes */
  98. #define NDS_ERR_SUCCESS 0x00000000
  99. #define NDS_ERR_NO_SUCH_ENTRY 0xFFFFFDA7
  100. #define NDS_ERR_NO_SUCH_VALUE 0xFFFFFDA6
  101. #define NDS_ERR_NO_SUCH_ATTRIBUTE 0xFFFFFDA5
  102. #define NDS_ERR_NO_SUCH_CLASS 0xFFFFFDA4
  103. #define NDS_ERR_NO_SUCH_PARTITION 0xFFFFFDA3
  104. #define NDS_ERR_ENTRY_ALREADY_EXISTS 0xFFFFFDA2
  105. #define NDS_ERR_NOT_EFFECTIVE_CLASS 0xFFFFFDA1
  106. #define NDS_ERR_ILLEGAL_ATTRIBUTE 0xFFFFFDA0
  107. #define NDS_ERR_MISSING_MANDATORY 0xFFFFFD9F
  108. #define NDS_ERR_ILLEGAL_DS_NAME 0xFFFFFD9E
  109. #define NDS_ERR_ILLEGAL_CONTAINMENT 0xFFFFFD9D
  110. #define NDS_ERR_CANT_HAVE_MULTIPLE_VALUES 0xFFFFFD9C
  111. #define NDS_ERR_SYNTAX_VIOLATION 0xFFFFFD9B
  112. #define NDS_ERR_DUPLICATE_VALUE 0xFFFFFD9A
  113. #define NDS_ERR_ATTRIBUTE_ALREADY_EXISTS 0xFFFFFD99
  114. #define NDS_ERR_MAXIMUM_ENTRIES_EXIST 0xFFFFFD98
  115. #define NDS_ERR_DATABASE_FORMAT 0xFFFFFD97
  116. #define NDS_ERR_INCONSISTANT_DATABASE 0xFFFFFD96
  117. #define NDS_ERR_INVALID_COMPARISON 0xFFFFFD95
  118. #define NDS_ERR_COMPARISON_FAILED 0xFFFFFD94
  119. #define NDS_ERR_TRANSACTIONS_DISABLED 0xFFFFFD93
  120. #define NDS_ERR_INVALID_TRANSPORT 0xFFFFFD92
  121. #define NDS_ERR_SYNTAX_INVALID_IN_NAME 0xFFFFFD91
  122. #define NDS_ERR_REPLICA_ALREADY_EXISTS 0xFFFFFD90
  123. #define NDS_ERR_TRANSPORT_FAILURE 0xFFFFFD8F
  124. #define NDS_ERR_ALL_REFERRALS_FAILED 0xFFFFFD8E
  125. #define NDS_ERR_CANT_REMOVE_NAMING_VALUE 0xFFFFFD8D
  126. #define NDS_ERR_OBJECT_CLASS_VIOLATION 0xFFFFFD8C
  127. #define NDS_ERR_ENTRY_IS_NOT_LEAF 0xFFFFFD8B
  128. #define NDS_ERR_DIFFERENT_TREE 0xFFFFFD8A
  129. #define NDS_ERR_ILLEGAL_REPLICA_TYPE 0xFFFFFD89
  130. #define NDS_ERR_SYSTEM_FAILURE 0xFFFFFD88
  131. #define NDS_ERR_INVALID_ENTRY_FOR_ROOT 0xFFFFFD87
  132. #define NDS_ERR_NO_REFERRALS 0xFFFFFD86
  133. #define NDS_ERR_REMOTE_FAILURE 0xFFFFFD85
  134. #define NDS_ERR_PREVIOUS_MOVE_IN_PROGRESS 0xFFFFFD83
  135. #define NDS_ERR_INVALID_REQUEST 0xFFFFFD7F
  136. #define NDS_ERR_INVALID_ITERATION 0xFFFFFD7E
  137. #define NDS_ERR_SCHEMA_IS_NONREMOVABLE 0xFFFFFD7D
  138. #define NDS_ERR_SCHEMA_IS_IN_USE 0xFFFFFD7C
  139. #define NDS_ERR_CLASS_ALREADY_EXISTS 0xFFFFFD7B
  140. #define NDS_ERR_BAD_NAMING_ATTRIBUTES 0xFFFFFD7A
  141. #define NDS_ERR_NOT_ROOT_PARTITION 0xFFFFFD79
  142. #define NDS_ERR_INSUFFICIENT_STACK 0xFFFFFD78
  143. #define NDS_ERR_INSUFFICIENT_BUFFER 0xFFFFFD77
  144. #define NDS_ERR_AMBIGUOUS_CONTAINMENT 0xFFFFFD76
  145. #define NDS_ERR_AMBIGUOUS_NAMING 0xFFFFFD75
  146. #define NDS_ERR_DUPLICATE_MANDATORY 0xFFFFFD74
  147. #define NDS_ERR_DUPLICATE_OPTIONAL 0xFFFFFD73
  148. #define NDS_ERR_MULTIPLE_REPLICAS 0xFFFFFD71
  149. #define NDS_ERR_CRUCIAL_REPLICA 0xFFFFFD70
  150. #define NDS_ERR_SCHEMA_SYNC_IN_PROGRESS 0xFFFFFD6F
  151. #define NDS_ERR_SKULK_IN_PROGRESS 0xFFFFFD6E
  152. #define NDS_ERR_TIME_NOT_SYNCRONIZED 0xFFFFFD6D
  153. #define NDS_ERR_RECORD_IN_USE 0xFFFFFD6C
  154. #define NDS_ERR_DS_VOLUME_NOT_MOUNTED 0xFFFFFD6B
  155. #define NDS_ERR_DS_VOLUME_IO_FAILURE 0xFFFFFD6A
  156. #define NDS_ERR_DS_LOCKED 0xFFFFFD69
  157. #define NDS_ERR_OLD_EPOCH 0xFFFFFD68
  158. #define NDS_ERR_NEW_EPOCH 0xFFFFFD67
  159. #define NDS_ERR_PARTITION_ROOT 0xFFFFFD65
  160. #define NDS_ERR_ENTRY_NOT_CONTAINER 0xFFFFFD64
  161. #define NDS_ERR_FAILED_AUTHENTICATION 0xFFFFFD63
  162. #define NDS_ERR_NO_SUCH_PARENT 0xFFFFFD61
  163. #define NDS_ERR_NO_ACCESS 0xFFFFFD60
  164. #define NDS_ERR_REPLICA_NOT_ON 0xFFFFFD5F
  165. #define NDS_ERR_DUPLICATE_ACL 0xFFFFFD5A
  166. #define NDS_ERR_PARTITION_ALREADY_EXISTS 0xFFFFFD59
  167. #define NDS_ERR_NOT_SUBREF 0xFFFFFD58
  168. #define NDS_ERR_ALIAS_OF_AN_ALIAS 0xFFFFFD57
  169. #define NDS_ERR_AUDITING_FAILED 0xFFFFFD56
  170. #define NDS_ERR_INVALID_API_VERSION 0xFFFFFD55
  171. #define NDS_ERR_SECURE_NCP_VIOLATION 0xFFFFFD54
  172. #define NDS_ERR_FATAL 0xFFFFFD45
  173. typedef struct _WSTR_LIST_ELEM
  174. {
  175. struct _WSTR_LIST_ELEM * Next;
  176. LPWSTR szString;
  177. } WSTR_LIST_ELEM, * LPWSTR_LIST;
  178. typedef struct
  179. {
  180. DWORD length;
  181. BYTE data[256];
  182. } ASN1_ID, * LPASN1_ID;
  183. //
  184. // NDS Attribute Definition structure
  185. //
  186. typedef struct
  187. {
  188. LPWSTR szAttributeName;
  189. DWORD dwFlags;
  190. DWORD dwSyntaxID;
  191. DWORD dwLowerLimit;
  192. DWORD dwUpperLimit;
  193. Asn1ID_T asn1ID;
  194. } NDS_ATTR_DEF, * PNDS_ATTR_DEF, * LPNDS_ATTR_DEF;
  195. //
  196. // NDS Class Definition structure
  197. //
  198. typedef struct
  199. {
  200. LPWSTR szClassName;
  201. DWORD dwFlags;
  202. Asn1ID_T asn1ID;
  203. DWORD dwNumberOfSuperClasses;
  204. LPWSTR_LIST lpSuperClasses;
  205. DWORD dwNumberOfContainmentClasses;
  206. LPWSTR_LIST lpContainmentClasses;
  207. DWORD dwNumberOfNamingAttributes;
  208. LPWSTR_LIST lpNamingAttributes;
  209. DWORD dwNumberOfMandatoryAttributes;
  210. LPWSTR_LIST lpMandatoryAttributes;
  211. DWORD dwNumberOfOptionalAttributes;
  212. LPWSTR_LIST lpOptionalAttributes;
  213. } NDS_CLASS_DEF, *PNDS_CLASS_DEF, *LPNDS_CLASS_DEF;
  214. //
  215. // If read results from NwNdsReadAttrDef, or NwNdsReadClassDef
  216. // returned names only (no attribute or class definitions),
  217. // then an array of these NDS_DEF_NAME_ONLY structures is returned.
  218. //
  219. typedef struct
  220. {
  221. LPWSTR szName;
  222. } NDS_NAME_ONLY, * PNDS_NAME_ONLY, * LPNDS_NAME_ONLY;
  223. //
  224. // NDS Attribute Information structure
  225. //
  226. typedef struct
  227. {
  228. LPWSTR szAttributeName;
  229. DWORD dwSyntaxId;
  230. DWORD dwNumberOfValues;
  231. PNDSOBJECT lpValue;
  232. } NDS_ATTR_INFO, * PNDS_ATTR_INFO, * LPNDS_ATTR_INFO;
  233. //
  234. // NDS Object Information structure
  235. //
  236. typedef struct
  237. {
  238. LPWSTR szObjectFullName;
  239. LPWSTR szObjectName;
  240. LPWSTR szObjectClass;
  241. DWORD dwEntryId;
  242. DWORD dwModificationTime;
  243. DWORD dwSubordinateCount;
  244. DWORD dwNumberOfAttributes; // Zero for NwNdsReadObject results.
  245. LPVOID lpAttribute; // For NwNdsSearch results, cast this
  246. // to either LPNDS_ATTR_INFO or
  247. // LPNDS_NAME_ONLY, depending on value of
  248. // lpdwAttrInformationType from call to
  249. // NwNdsGetObjectListFromBuffer.
  250. } NDS_OBJECT_INFO, * LPNDS_OBJECT_INFO;
  251. //
  252. // List Subordinate Objects Search Filter structures
  253. //
  254. typedef struct
  255. {
  256. LPWSTR szObjectClass;
  257. } NDS_FILTER, * LPNDS_FILTER;
  258. typedef struct
  259. {
  260. DWORD dwNumberOfFilters;
  261. NDS_FILTER Filters[1];
  262. } NDS_FILTER_LIST, * LPNDS_FILTER_LIST;
  263. //
  264. // NDS Search Query Tree structure
  265. //
  266. typedef struct _QUERY_NODE
  267. {
  268. DWORD dwOperation;
  269. DWORD dwSyntaxId;
  270. struct _QUERY_NODE * lpLVal;
  271. struct _QUERY_NODE * lpRVal;
  272. } QUERY_NODE, * LPQUERY_NODE, * LPQUERY_TREE;