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.

1766 lines
60 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. Nds32.h
  5. Abstract:
  6. This module defines functions to access and manage Novell NDS Directory
  7. objects and attributes using the Microsoft NT Netware redirector.
  8. ---- NDS Object functions ----
  9. NwNdsAddObject
  10. NwNdsCloseObject
  11. NwNdsGetEffectiveRights
  12. NwNdsListSubObjects
  13. NwNdsModifyObject
  14. NwNdsMoveObject
  15. NwNdsOpenObject
  16. NwNdsReadObject
  17. NwNdsRemoveObject
  18. NwNdsRenameObject
  19. ---- NDS Buffer functions ----
  20. NwNdsCreateBuffer
  21. NwNdsFreeBuffer
  22. ---- NDS Marshaling functions to prepare or read data buffers ----
  23. NwNdsGetAttrDefListFromBuffer
  24. NwNdsGetAttrListFromBuffer
  25. NwNdsGetClassDefListFromBuffer
  26. NwNdsGetObjectListFromBuffer
  27. NwNdsPutInBuffer
  28. ---- NDS Schema functions ----
  29. NwNdsAddAttributeToClass
  30. NwNdsDefineAttribute
  31. NwNdsDefineClass
  32. NwNdsDeleteAttrDef
  33. NwNdsDeleteClassDef
  34. NwNdsGetSyntaxID
  35. NwNdsReadAttrDef
  36. NwNdsReadClassDef
  37. ---- NDS Schema functions under investigation ----
  38. NwNdsListContainableClasses(IN ParentObjectHandle,OUT ListOfClassNames);
  39. ---- NDS Search functions ----
  40. NwNdsCreateQueryNode
  41. NwNdsDeleteQueryNode
  42. NwNdsDeleteQueryTree
  43. NwNdsSearch
  44. ---- NDS Special functions ----
  45. NwNdsChangeUserPassword
  46. ---- NDS File functions under investigation ----
  47. NwNdsAddTrusteeToFile
  48. NwNdsAllocateFileHandle
  49. NwNdsDeallocateFileHandle
  50. NwNdsGetEffectiveDirectoryRights
  51. NwNdsGetObjectEffectiveRights
  52. NwNdsRemoveTrusteeFromFile
  53. Author:
  54. Glenn Curtis [GlennC] 15-Dec-1995
  55. Glenn Curtis [GlennC] 04-Apr-1996 - Added Schema APIs
  56. --*/
  57. #ifndef __NDSOBJ32_H
  58. #define __NDSOBJ32_H
  59. #ifdef __cplusplus
  60. extern "C" {
  61. #endif /* __cplusplus */
  62. #include "ndssntx.h"
  63. #include "ndsattr.h"
  64. #include "ndsclass.h"
  65. /* Netware NDS general definitions */
  66. #define NDS_MAX_NAME_CHARS 256
  67. #define NDS_MAX_NAME_SIZE ( NDS_MAX_NAME_CHARS * 2 )
  68. #define NDS_MAX_SCHEMA_NAME_CHARS 32
  69. #define NDS_MAX_SCHEMA_NAME_BYTES ( 2 * ( NDS_MAX_SCHEMA_NAME_CHARS + 1 ) )
  70. #define NDS_MAX_TREE_NAME_LEN 32
  71. #define NDS_MAX_ASN1_NAME_LEN 32
  72. #define NDS_NO_MORE_ITERATIONS 0xFFFFFFFF
  73. #define NDS_INITIAL_SEARCH 0xFFFFFFFF
  74. /* Netware NDS create buffer operations */
  75. #define NDS_OBJECT_ADD 0
  76. #define NDS_OBJECT_MODIFY 1
  77. #define NDS_OBJECT_READ 2
  78. #define NDS_OBJECT_LIST_SUBORDINATES 3
  79. #define NDS_SCHEMA_DEFINE_CLASS 4
  80. #define NDS_SCHEMA_READ_ATTR_DEF 5
  81. #define NDS_SCHEMA_READ_CLASS_DEF 6
  82. #define NDS_SEARCH 7
  83. /* Netware NDS attribute modification operations */
  84. #define NDS_ATTR_ADD 0 /* Add first value to an attribute,
  85. error if it already exists */
  86. #define NDS_ATTR_REMOVE 1 /* Remove all values from an attribute,
  87. error if attribute doesn't exist */
  88. #define NDS_ATTR_ADD_VALUE 2 /* Add first or additional value to
  89. an attribute, error if duplicate */
  90. #define NDS_ATTR_REMOVE_VALUE 3 /* Remove a value from an attribute,
  91. error if it doesn't exist */
  92. #define NDS_ATTR_ADDITIONAL_VALUE 4 /* Add additional value to an attribute,
  93. error if duplicate or first value */
  94. #define NDS_ATTR_OVERWRITE_VALUE 5 /* Add first or additional value to an
  95. attribute, overwrite if duplicate */
  96. #define NDS_ATTR_CLEAR 6 /* Remove all values from an attribute,
  97. no error if attribute doesn't exist */
  98. #define NDS_ATTR_CLEAR_VALUE 7 /* Remove a value from an attribute,
  99. no error if it doesn't exist */
  100. /* Netware NDS schema attribute definition flags */
  101. #define NDS_SINGLE_VALUED_ATTR 0x0001
  102. #define NDS_SIZED_ATTR 0x0002
  103. #define NDS_NONREMOVABLE_ATTR 0x0004 // Only for NwNDSReadAttributeDef
  104. #define NDS_READ_ONLY_ATTR 0x0008 // Only for NwNDSReadAttributeDef
  105. #define NDS_HIDDEN_ATTR 0x0010 // Only for NwNDSReadAttributeDef
  106. #define NDS_STRING_ATTR 0x0020 // Only for NwNDSReadAttributeDef
  107. #define NDS_SYNC_IMMEDIATE 0x0040
  108. #define NDS_PUBLIC_READ 0x0080
  109. #define NDS_SERVER_READ 0x0100 // Only for NwNDSReadAttributeDef
  110. #define NDS_WRITE_MANAGED 0x0200
  111. #define NDS_PER_REPLICA 0x0400
  112. /* Netware NDS schema class definition flags */
  113. #define NDS_CONTAINER_CLASS 0x01
  114. #define NDS_EFFECTIVE_CLASS 0x02
  115. #define NDS_NONREMOVABLE_CLASS 0x04
  116. #define NDS_AMBIGUOUS_NAMING 0x08
  117. #define NDS_AMBIGUOUS_CONTAINMENT 0x10
  118. /* Netware NDS information flags */
  119. #define NDS_INFO_NAMES 0 // Search and Read operations
  120. #define NDS_INFO_ATTR_NAMES_VALUES 1 // Search operations
  121. #define NDS_INFO_NAMES_DEFS 1 // Read operations
  122. #define NDS_CLASS_INFO_EXPANDED_DEFS 2 // Schema class definition only
  123. /* Netware NDS information flags - NOT YET SUPPORTED */
  124. #define NDS_CLASS_INFO 3 // Schema class definition only
  125. /* Netware NDS attribute right definitions */
  126. #define NDS_RIGHT_COMPARE_ATTR 0x00000001L
  127. #define NDS_RIGHT_READ_ATTR 0x00000002L
  128. #define NDS_RIGHT_WRITE_ATTR 0x00000004L
  129. #define NDS_RIGHT_ADD_SELF_ATTR 0x00000008L
  130. #define NDS_RIGHT_SUPERVISE_ATTR 0x00000020L
  131. /* Netware NDS object right definitions */
  132. #define NDS_RIGHT_BROWSE_OBJECT 0x00000001L
  133. #define NDS_RIGHT_CREATE_OBJECT 0x00000002L
  134. #define NDS_RIGHT_DELETE_OBJECT 0x00000004L
  135. #define NDS_RIGHT_RENAME_OBJECT 0x00000008L
  136. #define NDS_RIGHT_SUPERVISE_OBJECT 0x00000010L
  137. /* Netware file right definitions */
  138. #define NW_RIGHTS WORD
  139. #define NW_RIGHT_NONE 0x0000
  140. #define NW_RIGHT_READ_FROM_FILE 0x0001
  141. #define NW_RIGHT_WRITE_TO_FILE 0x0002
  142. #define NW_RIGHT_CREATE_DIR_OR_FILE 0x0008
  143. #define NW_RIGHT_ERASE_DIR_OR_FILE 0x0010
  144. #define NW_RIGHT_ACCESS_CONTROL 0x0020
  145. #define NW_RIGHT_FILE_SCAN 0x0040
  146. #define NW_RIGHT_MODIFY_DIR_OR_FILE 0x0080
  147. #define NW_RIGHT_SUPERVISOR 0x0100
  148. #define NW_RIGHT_ALL NW_RIGHT_READ_FROM_FILE | \
  149. NW_RIGHT_WRITE_TO_FILE | \
  150. NW_RIGHT_CREATE_DIR_OR_FILE | \
  151. NW_RIGHT_ERASE_DIR_OR_FILE | \
  152. NW_RIGHT_ACCESS_CONTROL | \
  153. NW_RIGHT_FILE_SCAN | \
  154. NW_RIGHT_MODIFY_DIR_OR_FILE
  155. /* Netware NDS query node operations for building a search query */
  156. #define NDS_QUERY_OR 0x00000001L
  157. #define NDS_QUERY_AND 0x00000002L
  158. #define NDS_QUERY_NOT 0x00000003L
  159. #define NDS_QUERY_EQUAL 0x00000007L
  160. #define NDS_QUERY_GE 0x00000008L
  161. #define NDS_QUERY_LE 0x00000009L
  162. #define NDS_QUERY_APPROX 0x0000000AL
  163. #define NDS_QUERY_PRESENT 0x0000000FL
  164. /* Netware NDS search query scopes */
  165. #define NDS_SCOPE_ONE_LEVEL 0x00000000L
  166. #define NDS_SCOPE_SUB_TREE 0x00000001L
  167. #define NDS_SCOPE_BASE_LEVEL 0x00000002L
  168. /* Netware NDS function return codes */
  169. #define NDS_ERR_SUCCESS 0x00000000
  170. #define NDS_ERR_NO_SUCH_ENTRY 0xFFFFFDA7
  171. #define NDS_ERR_NO_SUCH_VALUE 0xFFFFFDA6
  172. #define NDS_ERR_NO_SUCH_ATTRIBUTE 0xFFFFFDA5
  173. #define NDS_ERR_NO_SUCH_CLASS 0xFFFFFDA4
  174. #define NDS_ERR_NO_SUCH_PARTITION 0xFFFFFDA3
  175. #define NDS_ERR_ENTRY_ALREADY_EXISTS 0xFFFFFDA2
  176. #define NDS_ERR_NOT_EFFECTIVE_CLASS 0xFFFFFDA1
  177. #define NDS_ERR_ILLEGAL_ATTRIBUTE 0xFFFFFDA0
  178. #define NDS_ERR_MISSING_MANDATORY 0xFFFFFD9F
  179. #define NDS_ERR_ILLEGAL_DS_NAME 0xFFFFFD9E
  180. #define NDS_ERR_ILLEGAL_CONTAINMENT 0xFFFFFD9D
  181. #define NDS_ERR_CANT_HAVE_MULTIPLE_VALUES 0xFFFFFD9C
  182. #define NDS_ERR_SYNTAX_VIOLATION 0xFFFFFD9B
  183. #define NDS_ERR_DUPLICATE_VALUE 0xFFFFFD9A
  184. #define NDS_ERR_ATTRIBUTE_ALREADY_EXISTS 0xFFFFFD99
  185. #define NDS_ERR_MAXIMUM_ENTRIES_EXIST 0xFFFFFD98
  186. #define NDS_ERR_DATABASE_FORMAT 0xFFFFFD97
  187. #define NDS_ERR_INCONSISTANT_DATABASE 0xFFFFFD96
  188. #define NDS_ERR_INVALID_COMPARISON 0xFFFFFD95
  189. #define NDS_ERR_COMPARISON_FAILED 0xFFFFFD94
  190. #define NDS_ERR_TRANSACTIONS_DISABLED 0xFFFFFD93
  191. #define NDS_ERR_INVALID_TRANSPORT 0xFFFFFD92
  192. #define NDS_ERR_SYNTAX_INVALID_IN_NAME 0xFFFFFD91
  193. #define NDS_ERR_REPLICA_ALREADY_EXISTS 0xFFFFFD90
  194. #define NDS_ERR_TRANSPORT_FAILURE 0xFFFFFD8F
  195. #define NDS_ERR_ALL_REFERRALS_FAILED 0xFFFFFD8E
  196. #define NDS_ERR_CANT_REMOVE_NAMING_VALUE 0xFFFFFD8D
  197. #define NDS_ERR_OBJECT_CLASS_VIOLATION 0xFFFFFD8C
  198. #define NDS_ERR_ENTRY_IS_NOT_LEAF 0xFFFFFD8B
  199. #define NDS_ERR_DIFFERENT_TREE 0xFFFFFD8A
  200. #define NDS_ERR_ILLEGAL_REPLICA_TYPE 0xFFFFFD89
  201. #define NDS_ERR_SYSTEM_FAILURE 0xFFFFFD88
  202. #define NDS_ERR_INVALID_ENTRY_FOR_ROOT 0xFFFFFD87
  203. #define NDS_ERR_NO_REFERRALS 0xFFFFFD86
  204. #define NDS_ERR_REMOTE_FAILURE 0xFFFFFD85
  205. #define NDS_ERR_PREVIOUS_MOVE_IN_PROGRESS 0xFFFFFD83
  206. #define NDS_ERR_INVALID_REQUEST 0xFFFFFD7F
  207. #define NDS_ERR_INVALID_ITERATION 0xFFFFFD7E
  208. #define NDS_ERR_SCHEMA_IS_NONREMOVABLE 0xFFFFFD7D
  209. #define NDS_ERR_SCHEMA_IS_IN_USE 0xFFFFFD7C
  210. #define NDS_ERR_CLASS_ALREADY_EXISTS 0xFFFFFD7B
  211. #define NDS_ERR_BAD_NAMING_ATTRIBUTES 0xFFFFFD7A
  212. #define NDS_ERR_NOT_ROOT_PARTITION 0xFFFFFD79
  213. #define NDS_ERR_INSUFFICIENT_STACK 0xFFFFFD78
  214. #define NDS_ERR_INSUFFICIENT_BUFFER 0xFFFFFD77
  215. #define NDS_ERR_AMBIGUOUS_CONTAINMENT 0xFFFFFD76
  216. #define NDS_ERR_AMBIGUOUS_NAMING 0xFFFFFD75
  217. #define NDS_ERR_DUPLICATE_MANDATORY 0xFFFFFD74
  218. #define NDS_ERR_DUPLICATE_OPTIONAL 0xFFFFFD73
  219. #define NDS_ERR_MULTIPLE_REPLICAS 0xFFFFFD71
  220. #define NDS_ERR_CRUCIAL_REPLICA 0xFFFFFD70
  221. #define NDS_ERR_SCHEMA_SYNC_IN_PROGRESS 0xFFFFFD6F
  222. #define NDS_ERR_SKULK_IN_PROGRESS 0xFFFFFD6E
  223. #define NDS_ERR_TIME_NOT_SYNCRONIZED 0xFFFFFD6D
  224. #define NDS_ERR_RECORD_IN_USE 0xFFFFFD6C
  225. #define NDS_ERR_DS_VOLUME_NOT_MOUNTED 0xFFFFFD6B
  226. #define NDS_ERR_DS_VOLUME_IO_FAILURE 0xFFFFFD6A
  227. #define NDS_ERR_DS_LOCKED 0xFFFFFD69
  228. #define NDS_ERR_OLD_EPOCH 0xFFFFFD68
  229. #define NDS_ERR_NEW_EPOCH 0xFFFFFD67
  230. #define NDS_ERR_PARTITION_ROOT 0xFFFFFD65
  231. #define NDS_ERR_ENTRY_NOT_CONTAINER 0xFFFFFD64
  232. #define NDS_ERR_FAILED_AUTHENTICATION 0xFFFFFD63
  233. #define NDS_ERR_NO_SUCH_PARENT 0xFFFFFD61
  234. #define NDS_ERR_NO_ACCESS 0xFFFFFD60
  235. #define NDS_ERR_REPLICA_NOT_ON 0xFFFFFD5F
  236. #define NDS_ERR_DUPLICATE_ACL 0xFFFFFD5A
  237. #define NDS_ERR_PARTITION_ALREADY_EXISTS 0xFFFFFD59
  238. #define NDS_ERR_NOT_SUBREF 0xFFFFFD58
  239. #define NDS_ERR_ALIAS_OF_AN_ALIAS 0xFFFFFD57
  240. #define NDS_ERR_AUDITING_FAILED 0xFFFFFD56
  241. #define NDS_ERR_INVALID_API_VERSION 0xFFFFFD55
  242. #define NDS_ERR_SECURE_NCP_VIOLATION 0xFFFFFD54
  243. #define NDS_ERR_FATAL 0xFFFFFD45
  244. /* Structure definitions used */
  245. typedef struct _WSTR_LIST_ELEM
  246. {
  247. struct _WSTR_LIST_ELEM * Next;
  248. LPWSTR szString;
  249. } WSTR_LIST_ELEM, * LPWSTR_LIST;
  250. typedef struct
  251. {
  252. DWORD length;
  253. BYTE data[NDS_MAX_ASN1_NAME_LEN];
  254. } ASN1_ID, * LPASN1_ID;
  255. //
  256. // NDS Attribute Definition structure
  257. //
  258. typedef struct
  259. {
  260. LPWSTR szAttributeName;
  261. DWORD dwFlags;
  262. DWORD dwSyntaxID;
  263. DWORD dwLowerLimit;
  264. DWORD dwUpperLimit;
  265. ASN1_ID asn1ID;
  266. } NDS_ATTR_DEF, * LPNDS_ATTR_DEF;
  267. //
  268. // NDS Class Definition structure
  269. //
  270. typedef struct
  271. {
  272. LPWSTR szClassName;
  273. DWORD dwFlags;
  274. ASN1_ID asn1ID;
  275. DWORD dwNumberOfSuperClasses;
  276. LPWSTR_LIST lpSuperClasses;
  277. DWORD dwNumberOfContainmentClasses;
  278. LPWSTR_LIST lpContainmentClasses;
  279. DWORD dwNumberOfNamingAttributes;
  280. LPWSTR_LIST lpNamingAttributes;
  281. DWORD dwNumberOfMandatoryAttributes;
  282. LPWSTR_LIST lpMandatoryAttributes;
  283. DWORD dwNumberOfOptionalAttributes;
  284. LPWSTR_LIST lpOptionalAttributes;
  285. } NDS_CLASS_DEF, * LPNDS_CLASS_DEF;
  286. //
  287. // If read results from NwNdsReadAttrDef, or NwNdsReadClassDef
  288. // returned names only (no attribute or class definitions),
  289. // then an array of these NDS_DEF_NAME_ONLY structures is returned.
  290. //
  291. typedef struct
  292. {
  293. LPWSTR szName;
  294. } NDS_NAME_ONLY, * LPNDS_NAME_ONLY;
  295. //
  296. // NDS Attribute Information structure
  297. //
  298. typedef struct
  299. {
  300. LPWSTR szAttributeName;
  301. DWORD dwSyntaxId;
  302. DWORD dwNumberOfValues;
  303. LPBYTE lpValue;
  304. } NDS_ATTR_INFO, * LPNDS_ATTR_INFO;
  305. //
  306. // NDS Object Information structure
  307. //
  308. typedef struct
  309. {
  310. LPWSTR szObjectFullName;
  311. LPWSTR szObjectName;
  312. LPWSTR szObjectClass;
  313. DWORD dwEntryId;
  314. DWORD dwModificationTime;
  315. DWORD dwSubordinateCount;
  316. DWORD dwNumberOfAttributes; // Zero for NwNdsReadObject results.
  317. LPVOID lpAttribute; // For NwNdsSearch results, cast this
  318. // to either LPNDS_ATTR_INFO or
  319. // LPNDS_NAME_ONLY, depending on value of
  320. // lpdwAttrInformationType from call to
  321. // NwNdsGetObjectListFromBuffer.
  322. } NDS_OBJECT_INFO, * LPNDS_OBJECT_INFO;
  323. //
  324. // tommye MS bug 88021 / MCS
  325. //
  326. // Moved this structure here from nw/nwlib/nds32.c so it could be
  327. // accessed by NwNdsObjectHandleToConnHandle() in nw/nwlib/nwapi32.c.
  328. // Renamed it from NDS_OBJECT to NDS_OBJECT_PRIV to avoid conflict
  329. // with other structure of the same name.
  330. //
  331. typedef struct
  332. {
  333. DWORD Signature;
  334. HANDLE NdsTree;
  335. DWORD ObjectId;
  336. DWORD ResumeId;
  337. DWORD NdsRawDataBuffer;
  338. DWORD NdsRawDataSize;
  339. DWORD NdsRawDataId;
  340. DWORD NdsRawDataCount;
  341. WCHAR szContainerName[NDS_MAX_NAME_CHARS];
  342. WCHAR szRelativeName[NDS_MAX_NAME_CHARS];
  343. } NDS_OBJECT_PRIV, * LPNDS_OBJECT_PRIV;
  344. //
  345. // List Subordinate Objects Search Filter structures
  346. //
  347. typedef struct
  348. {
  349. LPWSTR szObjectClass;
  350. } NDS_FILTER, * LPNDS_FILTER;
  351. typedef struct
  352. {
  353. DWORD dwNumberOfFilters;
  354. NDS_FILTER Filters[1];
  355. } NDS_FILTER_LIST, * LPNDS_FILTER_LIST;
  356. //
  357. // NDS Search Query Tree structure
  358. //
  359. typedef struct _QUERY_NODE
  360. {
  361. DWORD dwOperation;
  362. DWORD dwSyntaxId;
  363. struct _QUERY_NODE * lpLVal;
  364. struct _QUERY_NODE * lpRVal;
  365. } QUERY_NODE, * LPQUERY_NODE, * LPQUERY_TREE;
  366. //
  367. // Given an NDS object handle, provides the NDS object ID
  368. //
  369. #define NwNdsGetObjectId(hObject) (((LPNDS_OBJECT_PRIV) hObject)->ObjectId)
  370. /* API definitions */
  371. DWORD
  372. NwNdsAddObject(
  373. IN HANDLE hParentObject,
  374. IN LPWSTR szObjectName,
  375. IN HANDLE hOperationData );
  376. /*
  377. NwNdsAddObject()
  378. This function is used to add a leaf object to an NDS directory tree.
  379. Arguments:
  380. HANDLE hParentObject - A handle to the parent object in
  381. the directory tree to add a new leaf to. Handle is
  382. obtained by calling NwNdsOpenObject.
  383. LPWSTR szObjectName - The directory name that the new leaf
  384. object will be known by.
  385. HANDLE hOperationData - A buffer containing a list of
  386. attributes and values to create the new object. This
  387. buffer is manipulated by the following functions:
  388. NwNdsCreateBuffer (NDS_OBJECT_ADD),
  389. NwNdsPutInBuffer, and NwNdsFreeBuffer.
  390. Returns:
  391. NO_ERROR
  392. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  393. */
  394. DWORD
  395. NwNdsAddAttributeToClass(
  396. IN HANDLE hTree,
  397. IN LPWSTR szClassName,
  398. IN LPWSTR szAttributeName );
  399. /*
  400. NwNdsAddAttributeToClass()
  401. This function is used to modify the schema definition of a class by adding
  402. an optional attribute to a particular class. Modification of existing NDS
  403. class defintions is limited to only adding additional optional attributes.
  404. NOTE: Currently this function only supports one attribute addition at a time.
  405. It is possible to provide a version of this function that can add more
  406. than one attribute at a time, although I don't think it will be
  407. neccessary. Schema manipulation is considered to be an uncommon event.
  408. Arguments:
  409. HANDLE hTree - A handle to the directory tree to be
  410. manipulated. Handle is obtained by calling
  411. NwNdsOpenObject.
  412. LPWSTR szClassName - The name of the class definition to be
  413. modified.
  414. LPWSTR szAttributeName - The name of the attribute to be added
  415. as an optional attribute to the class defintion in the
  416. schema.
  417. Returns:
  418. NO_ERROR
  419. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  420. */
  421. DWORD
  422. NwNdsChangeUserPassword(
  423. IN HANDLE hUserObject,
  424. IN LPWSTR szOldPassword,
  425. IN LPWSTR szNewPassword );
  426. /*
  427. NwNdsChangeUserPassword()
  428. This function is used to change the password for a given user object
  429. in a NDS directory tree.
  430. Arguments:
  431. HANDLE hUserObject - A handle to a specific user object in
  432. the directory tree to change the password on. Handle
  433. is obtained by calling NwNdsOpenObject.
  434. LPWSTR szOldPassword - The current password set on the user
  435. object hUserObject.
  436. - OR -
  437. If NwNdsChangeUserPassword is called from a client with
  438. administrative priveleges to the specified user object
  439. identified by hUserObject, then the szOldPassword
  440. value can be blank (L""). This way resetting the user
  441. password to szNewPassword.
  442. LPWSTR szNewPassword - The new password to be set on the user
  443. object hUserObject.
  444. Returns:
  445. NO_ERROR
  446. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  447. */
  448. DWORD
  449. NwNdsCloseObject(
  450. IN HANDLE hObject );
  451. /*
  452. NwNdsCloseObject()
  453. This function is used to close the handle used to manipulate an object
  454. in an NDS directory tree. The handle must be one Opened by NwNdsOpenObject.
  455. Arguments:
  456. HANDLE hObject - The handle of the object to be closed.
  457. Returns:
  458. NO_ERROR
  459. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  460. */
  461. DWORD
  462. NwNdsCreateBuffer(
  463. IN DWORD dwOperation,
  464. OUT HANDLE * lphOperationData );
  465. /*
  466. NwNdsCreateBuffer()
  467. This function is used to create a buffer used to describe object
  468. transactions to a specific object in an NDS directory tree. This routine
  469. allocates memory and is automatically resized as needed during calls
  470. to NwNdsPutInBuffer. This buffer must be freed with NwNdsFreeBuffer.
  471. Arguments:
  472. DWORD dwOperation - Indicates how buffer is to be utilized.
  473. Use defined values NDS_OBJECT_ADD, NDS_OBJECT_MODIFY,
  474. NDS_OBJECT_READ, NDS_SCHEMA_DEFINE_CLASS,
  475. NDS_SCHEMA_READ_ATTR_DEF, NDS_SCHEMA_READ_CLASS_DEF,
  476. or NDS_SEARCH.
  477. HANDLE * lphOperationData - Address of a HANDLE handle to
  478. receive created buffer.
  479. Returns:
  480. NO_ERROR
  481. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  482. */
  483. DWORD
  484. NwNdsCreateQueryNode(
  485. IN DWORD dwOperation,
  486. IN LPVOID lpLValue,
  487. IN DWORD dwSyntaxId,
  488. IN LPVOID lpRValue,
  489. OUT LPQUERY_NODE * lppQueryNode
  490. );
  491. /*
  492. NwNdsCreateQueryNode()
  493. This function is used to generate a tree node that is part of a query
  494. to be used with the function NwNdsSearch.
  495. Arguments:
  496. DWORD dwOperation - Indicates the type of node to create
  497. for a search query. Use one of the defined values
  498. below:
  499. NDS_QUERY_OR
  500. NDS_QUERY_AND :
  501. These operations must have both lpLValue and
  502. lpRValue pointing to a QUERY_NODE structure.
  503. In this case the dwSyntaxId value is ignored.
  504. NDS_QUERY_NOT :
  505. This operation must have lpLValue pointing to a
  506. QUERY_NODE structure and lpRValue set to NULL.
  507. In this case the dwSyntaxId value is ignored.
  508. NDS_QUERY_EQUAL
  509. NDS_QUERY_GE
  510. NDS_QUERY_LE
  511. NDS_QUERY_APPROX :
  512. These operations must have lpLValue pointing to
  513. a LPWSTR containing the name of an NDS attribute,
  514. and lpRValue pointing to an ASN1 structure defined
  515. in NdsSntx.h. dwSyntaxId must be set to the syntax
  516. identifier of the ASN1 structure pointed to by
  517. lpRValue.
  518. NDS_QUERY_PRESENT :
  519. This operation must have lpLValue pointing to a
  520. LPWSTR containing the name of an NDS attribute,
  521. and lpRValue set to NULL. In this case the
  522. dwSyntaxId value is ignored.
  523. LPVOID lpLValue - A pointer to either a QUERY_NODE structure
  524. or a LPWSTR depending on the value for dwOperation.
  525. DWORD dwSyntaxId - The syntax identifier of the ASN1
  526. structure pointed to by lpRValue for the dwOperations
  527. NDS_QUERY_EQUAL, NDS_QUERY_GE, NDS_QUERY_LE, or
  528. NDS_QUERY_APPROX. For other dwOperation values, this
  529. is ignored.
  530. LPVOID lpRValue - A pointer to either a QUERY_NODE structure,
  531. an ASN1 structure, or NULL, depending on the value for
  532. dwOperation.
  533. LPQUERY_NODE * lppQueryNode - Address of a LPQUERY_NODE to receive
  534. a pointer to created node.
  535. Returns:
  536. NO_ERROR
  537. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  538. */
  539. DWORD
  540. NwNdsDefineAttribute(
  541. IN HANDLE hTree,
  542. IN LPWSTR szAttributeName,
  543. IN DWORD dwFlags,
  544. IN DWORD dwSyntaxID,
  545. IN DWORD dwLowerLimit,
  546. IN DWORD dwUpperLimit,
  547. IN ASN1_ID asn1ID );
  548. /*
  549. NwNdsDefineAttribute()
  550. This function is used to create an attribute definition in the schema of
  551. NDS tree hTree.
  552. Arguments:
  553. HANDLE hTree - A handle to the directory tree to be
  554. manipulated. Handle is obtained by calling
  555. NwNdsOpenObject.
  556. LPWSTR szAttributeName - The name that the new attribute will
  557. be referred to by.
  558. DWORD dwFlags - Flags values to be set for new attribute
  559. definition. Definitions for flag values are found at
  560. the top of this file.
  561. DWORD dwSyntaxID - The ID of the syntax structure to be use
  562. for the new attribute. Syntax IDs and their associated
  563. structures are defined in the file NdsSntx.h. According
  564. to the NetWare NDS schema spec, there is and always will
  565. be, only 28 (0..27) different syntaxes.
  566. DWORD dwLowerLimit - The lower limit of a sized attribute
  567. (dwFlags value set to NDS_SIZED_ATTR). Can be set to
  568. zero if attribute is not sized.
  569. DWORD dwUpperLimit - The upper limit of a sized attribute
  570. (dwFlags value set to NDS_SIZED_ATTR). Can be set to
  571. zero if attribute is not sized.
  572. ASN1_ID asn1ID - The ASN.1 ID for the attribute. If no
  573. attribute identifier has been registered, a
  574. zero-length octet string is specified.
  575. Returns:
  576. NO_ERROR
  577. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  578. */
  579. DWORD
  580. NwNdsDefineClass(
  581. IN HANDLE hTree,
  582. IN LPWSTR szClassName,
  583. IN DWORD dwFlags,
  584. IN ASN1_ID asn1ID,
  585. IN HANDLE hSuperClasses,
  586. IN HANDLE hContainmentClasses,
  587. IN HANDLE hNamingAttributes,
  588. IN HANDLE hMandatoryAttributes,
  589. IN HANDLE hOptionalAttributes );
  590. /*
  591. NwNdsDefineClass()
  592. This function is used to create a class definition in the schema of
  593. NDS tree hTree.
  594. Arguments:
  595. HANDLE hTree - A handle to the directory tree to be
  596. manipulated. Handle is obtained by calling
  597. NwNdsOpenObject.
  598. LPWSTR szClassName - The name that the new class will
  599. be referred to by.
  600. DWORD dwFlags - Flags values to be set for new class
  601. definition. Definitions for flag values are found at
  602. the top of this file.
  603. ASN1_ID asn1ID - The ASN.1 ID for the class. If no
  604. class identifier has been registered, a
  605. zero-length octet string is specified.
  606. HANDLE(S) hSuperClasses,
  607. hContainmentClasses,
  608. hNamingAttributes,
  609. hMandatoryAttributes,
  610. hOptionalAttributes -
  611. Handle to buffers that contain class definition
  612. information to create new class in schema.
  613. These handles are manipulated by the following
  614. functions:
  615. NwNdsCreateBuffer (NDS_SCHEMA_DEFINE_CLASS),
  616. NwNdsPutInBuffer, and NwNdsFreeBuffer.
  617. - OR -
  618. Handles can be NULL to indicate that no list
  619. is associated with the specific class defintion
  620. item.
  621. Returns:
  622. NO_ERROR
  623. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  624. */
  625. DWORD
  626. NwNdsDeleteAttrDef(
  627. IN HANDLE hTree,
  628. IN LPWSTR szAttributeName );
  629. /*
  630. NwNdsDeleteAttrDef()
  631. This function is used to remove an attribute definition from the schema of
  632. NDS tree hTree.
  633. Arguments:
  634. HANDLE hTree - A handle to the directory tree to be
  635. manipulated. Handle is obtained by calling
  636. NwNdsOpenObject.
  637. LPWSTR szAttributeName - The name of the attribute
  638. defintion to remove.
  639. Returns:
  640. NO_ERROR
  641. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  642. */
  643. DWORD
  644. NwNdsDeleteClassDef(
  645. IN HANDLE hTree,
  646. IN LPWSTR szClassName );
  647. /*
  648. NwNdsDeleteClassDef()
  649. This function is used to remove a class definition from the schema of
  650. NDS tree hTree.
  651. Arguments:
  652. HANDLE hTree - A handle to the directory tree to be
  653. manipulated. Handle is obtained by calling
  654. NwNdsOpenObject.
  655. LPWSTR szClassName - The name of the class defintion to remove.
  656. Returns:
  657. NO_ERROR
  658. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  659. */
  660. VOID
  661. NwNdsDeleteQueryNode(
  662. IN LPQUERY_NODE lpQueryNode
  663. );
  664. /*
  665. NwNdsDeleteQueryNode()
  666. This function is used to free a tree node that was part of a query
  667. used with the function NwNdsSearch.
  668. Arguments:
  669. LPQUERY_NODE lpQueryNode - A pointer to a particular node of
  670. a query tree that defines a search.
  671. Returns:
  672. Nothing
  673. */
  674. DWORD
  675. NwNdsDeleteQueryTree(
  676. IN LPQUERY_TREE lpQueryTree
  677. );
  678. /*
  679. NwNdsDeleteQueryTree()
  680. This function is used to free a tree that describes a query that was
  681. used with the function NwNdsSearch.
  682. Arguments:
  683. LPQUERY_TREE lpQueryTree - A pointer to the root of a query
  684. tree that defines a search. The tree is created
  685. manually by the user through the function
  686. NwNdsCreateQueryNode.
  687. Returns:
  688. NO_ERROR
  689. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  690. */
  691. DWORD
  692. NwNdsFreeBuffer(
  693. IN HANDLE hOperationData );
  694. /*
  695. NwNdsFreeBuffer()
  696. This function is used to free the buffer used to describe object
  697. operations to a specific object in an NDS directory tree. The buffer must
  698. be one created by NwNdsCreateBuffer, or returned by calling NwNdsReadObject.
  699. Arguments:
  700. HANDLE hOperationData - Handle to buffer that is to be freed.
  701. Returns:
  702. NO_ERROR
  703. one of the error codes defined in the file winerror.h
  704. */
  705. DWORD
  706. NwNdsGetAttrDefListFromBuffer(
  707. IN HANDLE hOperationData,
  708. OUT LPDWORD lpdwNumberOfEntries,
  709. OUT LPDWORD lpdwInformationType,
  710. OUT LPVOID * lppEntries );
  711. /*
  712. NwNdsGetAttrDefListFromBuffer()
  713. This function is used to retrieve an array of attribute definition entries
  714. for a schema that was read with a prior call to NwNdsReadAttrDef.
  715. Arguments:
  716. HANDLE hOperationData - Buffer containing the read
  717. response from calling NwNdsReadAttrDef.
  718. LPDWORD lpdwNumberOfEntries - The address of a DWORD to
  719. receive the number of array elements pointed to by
  720. lppEntries.
  721. LPDWORD lpdwInformationType - The address of a DWORD to
  722. receive a value that indicates the type of information
  723. returned by the call to NwNdsReadAttrDef.
  724. LPVOID * lppEntries - The address of a pointer to the beginning
  725. of an array of attribute schema structures. Each
  726. structure contains the details of each attribute
  727. definition read from a given schema by calling
  728. NwNdsReadAttrDef. The lppEntries value should be
  729. cast to either a LPNDS_ATTR_DEF or LPNDS_NAME_ONLY
  730. structure depending on the value returned in
  731. lpdwInformationType.
  732. Returns:
  733. NO_ERROR
  734. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  735. */
  736. DWORD
  737. NwNdsGetAttrListFromBuffer(
  738. IN HANDLE hOperationData,
  739. OUT LPDWORD lpdwNumberOfEntries,
  740. OUT LPNDS_ATTR_INFO * lppEntries );
  741. /*
  742. NwNdsGetAttrListFromBuffer()
  743. This function is used to retrieve an array of attribute entries for an
  744. object that was read with a prior call to NwNdsReadObject.
  745. Arguments:
  746. HANDLE hOperationData - Buffer containing the read
  747. response from calling NwNdsReadObject.
  748. LPDWORD lpdwNumberOfEntries - The address of a DWORD to
  749. receive the number of array elements pointed to by
  750. lppEntries.
  751. LPNDS_ATTR_INFO *
  752. lppEntries - The address of a pointer to the beginning
  753. of an array of NDS_ATTR_INFO structures. Each
  754. structure contains the details of each attribute read
  755. from a given object by calling NwNdsReadObject.
  756. Returns:
  757. NO_ERROR
  758. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  759. */
  760. DWORD
  761. NwNdsGetClassDefListFromBuffer(
  762. IN HANDLE hOperationData,
  763. OUT LPDWORD lpdwNumberOfEntries,
  764. OUT LPDWORD lpdwInformationType,
  765. OUT LPVOID * lppEntries );
  766. /*
  767. NwNdsGetClassDefListFromBuffer()
  768. This function is used to retrieve an array of class definition entries
  769. for a schema that was read with a prior call to NwNdsReadClassDef.
  770. Arguments:
  771. HANDLE hOperationData - Buffer containing the read
  772. response from calling NwNdsReadClassDef.
  773. LPDWORD lpdwNumberOfEntries - The address of a DWORD to
  774. receive the number of array elements pointed to by
  775. lppEntries.
  776. LPDWORD lpdwInformationType - The address of a DWORD to
  777. receive a value that indicates the type of information
  778. returned by the call to NwNdsReadClassDef.
  779. LPVOID * lppEntries - The address of a pointer to the beginning
  780. of an array of schema class structures. Each
  781. structure contains the details of each class
  782. definition read from a given schema by calling
  783. NwNdsReadClassDef. The lppEntries value should be
  784. cast to either a LPNDS_CLASS_DEF or LPNDS_NAME_ONLY
  785. structure depending on the value returned in
  786. lpdwInformationType.
  787. Returns:
  788. NO_ERROR
  789. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  790. */
  791. DWORD
  792. NwNdsGetEffectiveRights(
  793. IN HANDLE hObject,
  794. IN LPWSTR szSubjectName,
  795. IN LPWSTR szAttributeName,
  796. OUT LPDWORD lpdwRights );
  797. /*
  798. NwNdsGetEffectiveRights()
  799. This function is used to determine the effective rights of a particular
  800. subject on a particular object in the NDS tree. The user needs to have
  801. appropriate priveleges to make the determination.
  802. Arguments:
  803. HANDLE hObject - A handle to the object in the directory
  804. tree to determine effective rights on. Handle is
  805. obtained by calling NwNdsOpenObject.
  806. LPWSTR szSubjectName - The distinguished name of user whose
  807. rights we're interested in determining.
  808. LPWSTR szAttributeName - Regular attribute name (i.e.
  809. L"Surname" , L"CN" ) for reading a particular
  810. attribute right, or L"[All Attributes Rights]" and
  811. L"[Entry Rights]" can be used to determine the default
  812. attribute rights and object rights respectively.
  813. LPDWORD lpdwRights - A pointer to a DWORD to receive the
  814. results. If the call is successful, lpdwRights will
  815. contain a mask representing the subject's rights:
  816. Attribute rights - NDS_RIGHT_COMPARE_ATTR,
  817. NDS_RIGHT_READ_ATTR, NDS_RIGHT_WRITE_ATTR,
  818. NDS_RIGHT_ADD_SELF_ATTR, and
  819. NDS_RIGHT_SUPERVISE_ATTR.
  820. Object rights - NDS_RIGHT_BROWSE_OBJECT,
  821. NDS_RIGHT_CREATE_OBJECT, NDS_RIGHT_DELETE_OBJECT,
  822. NDS_RIGHT_RENAME_OBJECT, and
  823. NDS_RIGHT_SUPERVISE_OBJECT.
  824. Returns:
  825. NO_ERROR
  826. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  827. */
  828. DWORD
  829. NwNdsGetObjectListFromBuffer(
  830. IN HANDLE hOperationData,
  831. OUT LPDWORD lpdwNumberOfEntries,
  832. OUT LPDWORD lpdwAttrInformationType OPTIONAL,
  833. OUT LPNDS_OBJECT_INFO * lppEntries );
  834. /*
  835. NwNdsGetObjectListFromBuffer()
  836. This function is used to retrieve an array of object entries for
  837. objects that were read with a prior call to either
  838. NwNdsListSubObjects or NwNdsSearch.
  839. Arguments:
  840. HANDLE hOperationData - Buffer containing the read
  841. response from calling NwNdsListSubObjects, or a
  842. buffer containing the search results from a call
  843. to NwNdsSearch.
  844. LPDWORD lpdwNumberOfEntries - The address of a DWORD to
  845. receive the number of array elements pointed to by
  846. lppEntries.
  847. LPDWORD lpdwAttrInformationType - The address of a DWORD to
  848. receive a value that indicates the type of attribute
  849. information returned by the call to NwNdsSearch.
  850. This attribute information type determines which
  851. buffer structure (LPNDS_ATTR_INFO or LPNDS_NAME_ONLY)
  852. should be used for the lpAttribute field found in
  853. each NDS_OBJECT_INFO structure below.
  854. - or -
  855. NULL to indicate that the callee is not interested,
  856. especially when the object list is that from a call
  857. to NwNdsListSubObjects.
  858. LPNDS_OBJECT_INFO *
  859. lppEntries - The address of a pointer to the beginning
  860. of an array of NDS_OBJECT_INFO structures. Each
  861. structure contains the details of each object returned
  862. from a call to NwNdsListSubObjects or NwNdsSearch.
  863. Returns:
  864. NO_ERROR
  865. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  866. */
  867. DWORD
  868. NwNdsGetSyntaxID(
  869. IN HANDLE hTree,
  870. IN LPWSTR szAttributeName,
  871. OUT LPDWORD lpdwSyntaxID );
  872. /*
  873. NwNdsGetObjListFromBuffer()
  874. This function is used to retrieve the Syntax ID of a given attribute name.
  875. Arguments:
  876. HANDLE hTree - A handle to the directory tree to be
  877. manipulated. Handle is obtained by calling
  878. NwNdsOpenObject.
  879. LPWSTR szAttributeName - The attribute name whose Syntax ID
  880. is requested.
  881. LPDWORD lpdwSyntaxID - The address of a DWORD to receive the
  882. SyntaxID.
  883. Returns:
  884. NO_ERROR
  885. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  886. */
  887. DWORD
  888. NwNdsListSubObjects(
  889. IN HANDLE hParentObject,
  890. IN DWORD dwEntriesRequested,
  891. OUT LPDWORD lpdwEntriesReturned,
  892. IN LPNDS_FILTER_LIST lpFilters OPTIONAL,
  893. OUT HANDLE * lphOperationData );
  894. /*
  895. NwNdsListSubObjects()
  896. This function is used to enumerate the subordinate objects for a particular
  897. parent object. A filter can be passed in to restrict enumeration to a
  898. a specific class type or list of class types.
  899. Arguments:
  900. HANDLE hParentObject - A handle to the object in the directory
  901. tree whose subordinate objects (if any) will be
  902. enumerated.
  903. DWORD dwEntriesRequested - The number of subordinate objects
  904. to list. A subsequent call to NwNdsListSubObjects will
  905. continue enumeration following the last item returned.
  906. LPDWORD lpdwEntriesReturned - A pointer to a DWORD that will
  907. contain the actual number of subobjects enumerated in
  908. the call.
  909. LPNDS_FILTER_LIST lpFilters - The caller can specify the object class
  910. names for the kinds of objects that they would like
  911. to enumerate. For example if just User and Group
  912. object classes should be enumerated, then a filter
  913. for class names NDS_CLASS_USER and NDS_CLASS_GROUP
  914. should be pass in.
  915. - or -
  916. NULL to indicate that all objects should be returned
  917. (no filter).
  918. HANDLE * lphOperationData - Address of a HANDLE handle to
  919. receive created buffer that contains the list of
  920. subordinate objects read from the object
  921. hParentObject. This handle is manipulated by the
  922. following functions:
  923. NwNdsGetObjListFromBuffer and NwNdsFreeBuffer.
  924. Returns:
  925. NO_ERROR
  926. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  927. */
  928. DWORD
  929. NwNdsModifyObject(
  930. IN HANDLE hObject,
  931. IN HANDLE hOperationData );
  932. /*
  933. NwNdsModifyObject()
  934. This function is used to modify a leaf object in an NDS directory tree.
  935. Modifying a leaf object means: changing, adding, removing, and clearing of
  936. specified attributes for a given object.
  937. Arguments:
  938. HANDLE hObject - A handle to the object in the directory
  939. tree to be manipulated. Handle is obtained by calling
  940. NwNdsOpenObject.
  941. HANDLE hOperationData - A handle to data containing a
  942. list of attribute changes to be applied to the object.
  943. This buffer is manipulated by the following functions:
  944. NwNdsCreateBuffer (NDS_OBJECT_MODIFY),
  945. NwNdsPutInBuffer, and NwNdsFreeBuffer.
  946. Returns:
  947. NO_ERROR
  948. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  949. */
  950. DWORD
  951. NwNdsMoveObject(
  952. IN HANDLE hObject,
  953. IN LPWSTR szDestObjectParentDN );
  954. /*
  955. NwNdsMoveObject()
  956. This function is used to move a leaf object in an NDS directory tree
  957. from one container to another.
  958. Arguments:
  959. HANDLE hObject - A handle to the object in the directory
  960. tree to be moved. Handle is obtained by calling
  961. NwNdsOpenObject.
  962. LPWSTR szDestObjectParentDN - The DN of the object's new
  963. parent.
  964. Returns:
  965. NO_ERROR
  966. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  967. */
  968. DWORD
  969. NwNdsOpenObject(
  970. IN LPWSTR szObjectDN,
  971. IN LPWSTR szUserName OPTIONAL,
  972. IN LPWSTR szPassword OPTIONAL,
  973. OUT HANDLE * lphObject,
  974. OUT LPWSTR szObjectName OPTIONAL,
  975. OUT LPWSTR szObjectFullName OPTIONAL,
  976. OUT LPWSTR szObjectClassName OPTIONAL,
  977. OUT LPDWORD lpdwModificationTime OPTIONAL,
  978. OUT LPDWORD lpdwSubordinateCount OPTIONAL );
  979. /*
  980. NwNdsOpenObject()
  981. Arguments:
  982. LPWSTR szObjectDN - The distinguished name of the object
  983. that we want resolved into an object handle.
  984. LPWSTR szUserName - The name of the user account to create
  985. connection to object with.
  986. - OR -
  987. NULL to use the base credentials of the callee's LUID.
  988. LPWSTR szPassword - The password of the user account to create
  989. connection to object with. If password is blank, callee
  990. should pass "".
  991. - OR -
  992. NULL to use the base credentials of the callee's LUID.
  993. HANDLE * lphObject - The address of a HANDLE to receive
  994. the handle of the object specified by
  995. szObjectDN.
  996. Optional arguments: ( Callee can pass NULL in for these parameters to
  997. indicate ignore )
  998. LPWSTR szObjectName - A LPWSTR buffer to receive
  999. the object's relative NDS name, or NULL if not
  1000. interested. The buffer for this string must be
  1001. provided by the user. Buffer should be at least
  1002. NDS_MAX_NAME_SIZE
  1003. LPWSTR szObjectFullName - A LPWSTR buffer to receive
  1004. the object's full NDS name (DN). The buffer for this
  1005. string must be provided by the user. Buffer should
  1006. be at least: (NW_MAX_NDS_NAME_LEN + 1 ) * sizeof(WCHAR)
  1007. LPWSTR szObjectClassName - A LPWSTR buffer to receive
  1008. the class name of the object opened. The buffer for this
  1009. string must be provided by the user. Buffer should
  1010. be at least: (NW_MAX_NDS_NAME_LEN + 1 ) * sizeof(WCHAR)
  1011. LPDWORD lpdwModificationTime - The address of a DWORD to
  1012. receive the last date/time the object was modified.
  1013. LPDWORD lpdwSubordinateCount - The address of a DWORD to
  1014. receive the number of subordinate objects that may
  1015. be found under szObjectDN, if it is a container object.
  1016. If szObjectDN is not a container, then the value is set
  1017. to zero. Although a value of zero does not imply
  1018. that object is not a container, it could just be empty.
  1019. Returns:
  1020. NO_ERROR
  1021. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  1022. */
  1023. DWORD
  1024. NwNdsPutInBuffer(
  1025. IN LPWSTR szAttributeName,
  1026. IN DWORD dwSyntaxID,
  1027. IN LPVOID lpAttributeValues,
  1028. IN DWORD dwValueCount,
  1029. IN DWORD dwAttrModificationOperation,
  1030. IN OUT HANDLE hOperationData );
  1031. /*
  1032. NwNdsPutInBuffer()
  1033. This function is used to add an entry to the buffer used to describe
  1034. an object attribute or change to an object attribute. The buffer must
  1035. be created using NwNdsCreateBuffer. If the buffer was created using the
  1036. operations, NDS_OBJECT_ADD, NDS_SCHEMA_DEFINE_CLASS,
  1037. NDS_SCHEMA_READ_ATTR_DEF, or NDS_SCHEMA_READ_CLASS_DEF, then
  1038. dwAttrModificationOperation is ignored. If the buffer was created using
  1039. either the operation NDS_OBJECT_READ or NDS_SEARCH, then
  1040. dwAttrModificationOperation, puAttributeType, and lpAttributeValue are
  1041. all ingnored.
  1042. Arguments:
  1043. LPWSTR szAttributeName - A NULL terminated WCHAR string
  1044. that contains name of the attribute value to be
  1045. added to the buffer. It can be a user supplied
  1046. string, or one of the many defined string macros
  1047. in NdsAttr.h.
  1048. DWORD dwSyntaxID - The ID of the syntax structure used to
  1049. represent the attribute value. Syntax IDs and their
  1050. associated structures are defined in the file
  1051. NdsSntx.h. According to the NetWare NDS schema spec,
  1052. there is and always will be, only 28 (0..27)
  1053. different syntaxes.
  1054. LPVOID lpAttributeValues - A pointer to the beginning of a
  1055. buffer containing the value(s) for a particular
  1056. object attribute with data syntax dwSyntaxID.
  1057. DWORD dwValueCount - The number of value entries found in
  1058. buffer pointed to by lpAttributeValues.
  1059. DWORD dwAttrModificationOperation - If the buffer was created
  1060. using the operation NDS_MODIFY_OBJECT, then this is
  1061. used to desribe which type of modification operation
  1062. to apply for a given attribute. These attribute
  1063. modification operations are defined near the beginning
  1064. of this file.
  1065. HANDLE hOperationData - A handle to data created by
  1066. calling NwNdsCreateBuffer. The buffer stores the
  1067. attributes used to define transactions for
  1068. NwNdsAddObject, NwNdsModifyObject, NwNdsReadAttrDef,
  1069. NwNdsReadClassDef, NwNdsReadObject or NwNdsSearch.
  1070. Returns:
  1071. NO_ERROR
  1072. ERROR_NOT_ENOUGH_MEMORY
  1073. ERROR_INVALID_PARAMETER
  1074. */
  1075. DWORD
  1076. NwNdsReadAttrDef(
  1077. IN HANDLE hTree,
  1078. IN DWORD dwInformationType, // NDS_INFO_NAMES
  1079. // or NDS_INFO_NAMES_DEFS
  1080. IN OUT HANDLE * lphOperationData OPTIONAL );
  1081. /*
  1082. NwNdsReadAttrDef()
  1083. This function is used to read attribute definitions in the schema of an
  1084. NDS directory tree.
  1085. Arguments:
  1086. HANDLE hTree - A handle to the directory tree to be
  1087. manipulated. Handle is obtained by calling
  1088. NwNdsOpenObject.
  1089. DWORD dwInformationType - Indicates whether user chooses to
  1090. read only the defined attribute name(s) in the schema or
  1091. read both the attribute name(s) and definition(s)
  1092. from the schema.
  1093. HANDLE * lphOperationData - The address of a HANDLE to data
  1094. containing a list of attribute names to be read from
  1095. the schema. This handle is manipulated by the following
  1096. functions:
  1097. NwNdsCreateBuffer (NDS_SCHEMA_READ_ATTR_DEF),
  1098. NwNdsPutInBuffer, and NwNdsFreeBuffer.
  1099. - OR -
  1100. The address of a HANDLE set to NULL, which indicates
  1101. that all attributes should be read from the schema.
  1102. If these calls are successful, this handle will also
  1103. contain the read results from the call. In the later
  1104. case, a buffer will be created to contain the read
  1105. results. Attribute values can be retrieved from the
  1106. buffer with the functions:
  1107. NwNdsGetAttrDefListFromBuffer
  1108. After the call to this function, this buffer is ONLY
  1109. manipulated by the functions:
  1110. NwNdsGetAttrDefListFromBuffer and NwNdsFreeBuffer.
  1111. Returns:
  1112. NO_ERROR
  1113. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  1114. */
  1115. DWORD
  1116. NwNdsReadClassDef(
  1117. IN HANDLE hTree,
  1118. IN DWORD dwInformationType, // NDS_INFO_NAMES,
  1119. // NDS_INFO_NAMES_DEFS,
  1120. // NDS_CLASS_INFO_EXPANDED_DEFS,
  1121. // or NDS_CLASS_INFO
  1122. IN OUT HANDLE * lphOperationData OPTIONAL );
  1123. /*
  1124. NwNdsReadClassDef()
  1125. This function is used to read class definitions in the schema of an
  1126. NDS directory tree.
  1127. Arguments:
  1128. HANDLE hTree - A handle to the directory tree to be
  1129. manipulated. Handle is obtained by calling
  1130. NwNdsOpenObject.
  1131. DWORD dwInformationType - Indicates whether user chooses to
  1132. read only the defined class name(s) in the schema or
  1133. read both the class name(s) and definition(s)
  1134. from the schema.
  1135. HANDLE * lphOperationData - The address of a HANDLE to data
  1136. containing a list of class names to be read from
  1137. the schema. This handle is manipulated by the following
  1138. functions:
  1139. NwNdsCreateBuffer (NDS_SCHEMA_READ_CLASS_DEF),
  1140. NwNdsPutInBuffer, and NwNdsFreeBuffer.
  1141. - OR -
  1142. The address of a HANDLE set to NULL, which indicates
  1143. that all classes should be read from the schema.
  1144. If these calls are successful, this handle will also
  1145. contain the read results from the call. In the later
  1146. case, a buffer will be created to contain the read
  1147. results. Class read results can be retrieved from the
  1148. buffer with the functions:
  1149. NwNdsGetClassDefListFromBuffer
  1150. After the call to this function, this buffer is ONLY
  1151. manipulated by the functions:
  1152. NwNdsGetClassDefListFromBuffer and NwNdsFreeBuffer.
  1153. Returns:
  1154. NO_ERROR
  1155. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  1156. */
  1157. DWORD
  1158. NwNdsReadObject(
  1159. IN HANDLE hObject,
  1160. IN DWORD dwInformationType, // NDS_INFO_NAMES
  1161. // or NDS_INFO_ATTR_NAMES_VALUES
  1162. IN OUT HANDLE * lphOperationData );
  1163. /*
  1164. NwNdsReadObject()
  1165. This function is used to read attributes about an object of an NDS
  1166. directory tree.
  1167. Arguments:
  1168. HANDLE hObject - A handle to the object in the directory
  1169. tree to be manipulated. Handle is obtained by calling
  1170. NwNdsOpenObject.
  1171. DWORD dwInformationType - Indicates whether user chooses to
  1172. read only the attribute name(s) on the object or
  1173. read both the attribute name(s) and value(s)
  1174. from the object.
  1175. HANDLE * lphOperationData - The address of a HANDLE to data
  1176. containing a list of attributes to be read from the
  1177. object hObject. This handle is manipulated by the
  1178. following functions:
  1179. NwNdsCreateBuffer (NDS_OBJECT_READ),
  1180. NwNdsPutInBuffer, and NwNdsFreeBuffer.
  1181. - OR -
  1182. The address of a HANDLE set to NULL, which indicates
  1183. that all object attributes should be read from object
  1184. hObject.
  1185. If these calls are successful, this handle will also
  1186. contain the read results from the call. In the later
  1187. case, a buffer will be created to contain the read
  1188. results. Attribute values can be retrieved from the
  1189. buffer with the functions:
  1190. NwNdsGetAttrListFromBuffer.
  1191. After the call to this function, this buffer is ONLY
  1192. manipulated by the functions:
  1193. NwNdsGetAttrListFromBuffer and NwNdsFreeBuffer.
  1194. Returns:
  1195. NO_ERROR
  1196. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  1197. */
  1198. DWORD
  1199. NwNdsRemoveObject(
  1200. IN HANDLE hParentObject,
  1201. IN LPWSTR szObjectName );
  1202. /*
  1203. NwNdsRemoveObject()
  1204. This function is used to remove a leaf object from an NDS directory tree.
  1205. Arguments:
  1206. HANDLE hParentObject - A handle to the parent object container
  1207. in the directory tree to remove leaf object from.
  1208. Handle is obtained by calling NwNdsOpenObject.
  1209. LPWSTR szObjectName - The directory name of the leaf object
  1210. to be removed.
  1211. Returns:
  1212. NO_ERROR
  1213. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  1214. */
  1215. DWORD
  1216. NwNdsRenameObject(
  1217. IN HANDLE hParentObject,
  1218. IN LPWSTR szObjectName,
  1219. IN LPWSTR szNewObjectName,
  1220. IN BOOL fDeleteOldName );
  1221. /*
  1222. NwNdsRenameObject()
  1223. This function is used to rename an object in a NDS directory tree.
  1224. Arguments:
  1225. HANDLE hParentObject - A handle to the parent object container
  1226. in the directory tree to rename leaf object in.
  1227. Handle is obtained by calling NwNdsOpenObject.
  1228. LPWSTR szObjectName - The directory name of the object to be
  1229. renamed.
  1230. LPWSTR szNewObjectName - The new directory name of the object.
  1231. BOOL fDeleteOldName - If true, the old name is discarded;
  1232. Otherwise, the old name is retained as an additional
  1233. attribute.
  1234. Returns:
  1235. NO_ERROR
  1236. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  1237. */
  1238. DWORD
  1239. NwNdsSearch(
  1240. IN HANDLE hStartFromObject,
  1241. IN DWORD dwInformationType, // NDS_INFO_NAMES
  1242. // or NDS_INFO_ATTR_NAMES_VALUES
  1243. IN DWORD dwScope,
  1244. IN BOOL fDerefAliases,
  1245. IN LPQUERY_TREE lpQueryTree,
  1246. IN OUT LPDWORD lpdwIterHandle,
  1247. IN OUT HANDLE * lphOperationData );
  1248. /*
  1249. NwNdsSearch()
  1250. This function is used to query an NDS directory tree to find objects of
  1251. a certain object type that match a specified search filter.
  1252. Arguments:
  1253. HANDLE hStartFromObject - A HANDLE to an object in the
  1254. directory tree to start search from. Handle is
  1255. obtained by calling NwNdsOpenObject.
  1256. DWORD dwScope -
  1257. NDS_SCOPE_ONE_LEVEL - Search subordinates from given
  1258. object, one level only
  1259. NDS_SCOPE_SUB_TREE - Search from given object on down
  1260. NDS_SCOPE_BASE_LEVEL - Applies search to an object
  1261. BOOL fDerefAliases - If TRUE the search will dereference
  1262. aliased objects to the real objects and continue
  1263. to search in the aliased objects subtree. If FALSE
  1264. the search will not dereference aliases.
  1265. LPQUERY_TREE lpQueryTree - A pointer to the root of a search
  1266. tree which defines a query. This tree is manipulated
  1267. by the following functions:
  1268. NwNdsCreateQueryNode, NwNdsDeleteQueryNode,
  1269. and NwNdsDeleteQueryTree.
  1270. LPDWORD lpdwIterHandle - A pointer to a DWORD that has the
  1271. iteration handle value. On input, the handle value
  1272. is set to NDS_INITIAL_SEARCH or to a value previously
  1273. returned from a prior call to NwNdsSearch. On ouput,
  1274. the handle value is set to NDS_NO_MORE_ITERATIONS if
  1275. search is complete, or to some other value otherwise.
  1276. HANDLE * lphOperationData - The address of a HANDLE to data
  1277. containing a list of attributes to be read from the
  1278. objects that meet the search query. This handle is
  1279. manipulated by the following functions:
  1280. NwNdsCreateBuffer (NDS_SEARCH),
  1281. NwNdsPutInBuffer, and NwNdsFreeBuffer.
  1282. - OR -
  1283. The address of a HANDLE set to NULL, which indicates
  1284. that all object attributes should be read from the
  1285. search objects found.
  1286. If these calls are successful, this handle will also
  1287. contain the read results from the call. In the later
  1288. case, a buffer will be created to contain the read
  1289. results. Object information with attribute information
  1290. can be retrieved from the buffer with the function:
  1291. NwNdsGetObjectListFromBuffer.
  1292. After the call to this function, this buffer is ONLY
  1293. manipulated by the functions:
  1294. NwNdsGetObjectListFromBuffer,
  1295. and NwNdsFreeBuffer.
  1296. Returns:
  1297. NO_ERROR
  1298. UNSUCCESSFUL - Call GetLastError for Win32 error code.
  1299. */
  1300. #ifndef NWCONN_HANDLE
  1301. #define NWCONN_HANDLE HANDLE
  1302. #endif
  1303. NWCONN_HANDLE
  1304. NwNdsObjectHandleToConnHandle(
  1305. IN HANDLE ObjectHandle);
  1306. /*
  1307. NwNdsObjectHandleToConnHandle()
  1308. This function is used to get the NWCONN_HANDLE for a ObjectHandle
  1309. (like that returned from NwNdsOpenObject).
  1310. Arguments:
  1311. HANDLE ObjectHandle - the handle to use to retrieve the NWCONN_HANDLE.
  1312. Returns:
  1313. NULL - Call GetLastError for Win32 error code.
  1314. Otherwise - NWCONN_HANDLE - this MUST be freed by the caller by the
  1315. NwNdsConnHandleFree routine.
  1316. */
  1317. VOID
  1318. NwNdsConnHandleFree(
  1319. IN NWCONN_HANDLE hConn);
  1320. /*
  1321. NwNdsConnHandleFree()
  1322. Frees the NWCONN_HANDLE returned from NwNdsObjectHandleToConnHandle().
  1323. Arguments:
  1324. IN NWCONN_HANDLE Handle to free.
  1325. Returns:
  1326. Nothing
  1327. */
  1328. #ifdef __cplusplus
  1329. }
  1330. #endif /* __cplusplus */
  1331. #endif