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.

751 lines
20 KiB

  1. /*****************************************************************/
  2. /** Microsoft Windows 4.00 **/
  3. /** Copyright (C) Microsoft Corp., 1994-1995 **/
  4. /*****************************************************************/
  5. /*
  6. * Internal NetWare access API definitions for use by Windows components
  7. *
  8. * History
  9. *
  10. * vlads 12/15/94 Created
  11. * vlads 12/28/94 Added connection management and authentication prototypes
  12. *
  13. *
  14. *
  15. */
  16. #ifndef _INC_MSNWAPI
  17. #define _INC_MSNWAPI
  18. #include <msnwdef.h>
  19. #include <msnwerr.h>
  20. //
  21. // We default to byte-packing
  22. //
  23. #include <pshpack1.h>
  24. #ifdef __cplusplus
  25. extern "C" { /* Assume C declarations for C++ */
  26. #endif /* __cplusplus */
  27. #ifndef IS_32
  28. #define API_PREFNAME(name) WINAPI Thk##name
  29. #else
  30. #ifdef DEFINE_INTERNAL_PREFIXES
  31. #define API_PREFNAME(name) I_##name
  32. #else
  33. #define API_PREFNAME(name) WINAPI name
  34. #endif
  35. #endif
  36. /*
  37. * Manifest constants
  38. *
  39. */
  40. #define MAX_NDS_NAME_CHARS 256 // object names
  41. #define MAX_NDS_NAME_BYTES (2*(MAX_NDS_NAME_CHARS+1))
  42. #define MAX_NDS_RDN_CHARS 128 // relative name component
  43. #define MAX_NDS_RDN_BYTES (2*(MAX_RDN_CHARS + 1))
  44. #define MAX_NDS_TREE_CHARS 32 // tree name
  45. #define MAX_NDS_SCHEMA_NAME_CHARS 32 // class, property names
  46. #define MAX_NDS_SCHEMA_NAME_BYTES (2*(MAX_NDS_SCHEMA_NAME_CHARS+1))
  47. /*
  48. * Miscellaneous APIs
  49. *
  50. */
  51. NW_STATUS NetWGetRequesterVersion(OUT LPBYTE majorVersion,
  52. OUT LPBYTE minorVersion,
  53. OUT LPBYTE revision);
  54. /*
  55. * Global directory services context management
  56. *
  57. */
  58. NW_STATUS NDSSetNameContext(IN LPSTR NameContext, BOOL fGlobal);
  59. NW_STATUS NDSGetNameContext(OUT LPSTR NameContext, BOOL fGlobal);
  60. /*
  61. * Connection management
  62. * ---------------------
  63. *
  64. * NetWGetPreferredName Get/Set preferred connection name, according to type
  65. * NetWSetPreferredName parameter.
  66. *
  67. * NetWGetPreferredConnID Establishes default connection to network resource and
  68. * returns created connection handle
  69. *
  70. * NetWAttachByName Attach to resource by given name. For the tree this is equivalent
  71. * to combination ofr SetPreferredName\GetPreferredConnID, but atomic
  72. *
  73. * NetWAttachByAddress Attaches to server by given address.
  74. *
  75. */
  76. typedef enum _NETWARE_CONNECTION_TYPE {
  77. NETW_AnyType = 0,
  78. NETW_BinderyServer,
  79. NETW_DirectoryServer
  80. } NETWARE_CONNECTION_TYPE, *PNETWARE_CONNECTION_TYPE;
  81. typedef struct _NETWARE_CONNECTION_INFO {
  82. NETWARE_CONNECTION_TYPE ConnType;
  83. WORD ConnFlags; // see below
  84. WORD ServerConnNum;
  85. BYTE MajVer;
  86. BYTE MinVer;
  87. BYTE ServerAddress[12]; // IPX address of server
  88. } NETWARE_CONNECTION_INFO, *PNETWARE_CONNECTION_INFO;
  89. // ConnFlags values
  90. #define CONN_AUTH_BIT 0
  91. #define CONN_AUTH_FLAG (1 << CONN_AUTH_BIT )
  92. #define CONN_LOCKED_BIT 1
  93. #define CONN_LOCKED_FLAG (1 << CONN_LOCKED_BIT)
  94. #define CONN_NDS_NAME_BIT 2
  95. #define CONN_NDS_NAME_FLAG (1 << CONN_NDS_NAME_BIT)
  96. // TBD
  97. typedef struct _NETWARE_CONNECTION_REMOTE_INFO {
  98. DWORD dwF;
  99. } NETWARE_CONNECTION_REMOTE_INFO, *PNETWARE_CONNECTION_REMOTE_INFO;
  100. UINT
  101. NetWGetNumConnEntries(
  102. VOID
  103. );
  104. NW_STATUS
  105. NetWGetPreferredName(
  106. IN NETWARE_CONNECTION_TYPE ConnectionType,
  107. OUT LPSTR pszBuf
  108. );
  109. NW_STATUS
  110. NetWSetPreferredName(
  111. IN NETWARE_CONNECTION_TYPE ConnectionType,
  112. IN LPSTR pszBuf
  113. );
  114. NW_STATUS
  115. NetWGetPreferredConnID(
  116. IN NETWARE_CONNECTION_TYPE ConnectionType,
  117. OUT NWCONN_HANDLE *phConn
  118. );
  119. NW_STATUS
  120. NetWGetPrimaryConnection(
  121. OUT NWCONN_HANDLE *phConn
  122. );
  123. NW_STATUS WINAPI
  124. NetWSetPrimaryConnection(
  125. IN NWCONN_HANDLE hConn
  126. );
  127. NW_STATUS
  128. NetWAttachByName(
  129. IN UINT ConnFlags, // if CONN_NDS_NAME_FLAG, try NDS
  130. IN LPSTR pszResourceName,
  131. OUT PNWCONN_HANDLE phConn
  132. );
  133. NW_STATUS
  134. NetWAttachByAddress(
  135. IN PBYTE pbAddress,
  136. OUT PNWCONN_HANDLE phConn
  137. );
  138. NW_STATUS
  139. NetWLookupConnection(
  140. IN NETWARE_CONNECTION_TYPE ConnectionType,
  141. IN OUT NWCONN_HANDLE *phConn
  142. );
  143. NW_STATUS
  144. NetWGetConnectionLocalStatus(
  145. IN NWCONN_HANDLE hConn,
  146. OUT PNETWARE_CONNECTION_INFO pConnInfo,
  147. OUT LPSTR pszResourceName
  148. );
  149. NW_STATUS
  150. NetWGetConnectionRemoteInformation(
  151. IN NWCONN_HANDLE hConn,
  152. OUT PNETWARE_CONNECTION_REMOTE_INFO pConnInfo,
  153. OUT LPSTR pszResourceName
  154. );
  155. NWCONN_HANDLE
  156. NWREDIRToVLMHandle(BYTE connId);
  157. BYTE
  158. VLMToNWREDIRHandle(NWCONN_HANDLE hConn);
  159. // returns 12 byte local net address
  160. NW_STATUS
  161. NetWGetLocalAddress(
  162. BYTE *buffer // 12 bytes
  163. );
  164. //
  165. // For tree - cleans up all NDS connections , for server - just this one
  166. //
  167. NW_STATUS
  168. NetWDetachResource(
  169. IN NETWARE_CONNECTION_TYPE ConnectionType,
  170. IN NWCONN_HANDLE hConn
  171. );
  172. NW_STATUS
  173. NetWLicenseConnection(
  174. IN NWCONN_HANDLE hConn
  175. );
  176. NW_STATUS
  177. NetWUnLicenseConnection(
  178. IN NWCONN_HANDLE hConn
  179. );
  180. /*
  181. * Authetication APIs
  182. * ------------------
  183. *
  184. *
  185. */
  186. NW_STATUS
  187. NDSIsLoggedIn(
  188. OUT LPSTR pszUserName
  189. );
  190. NW_STATUS
  191. NDSLogin(
  192. OUT LPSTR pszUserName,
  193. OUT LPSTR pszPassword
  194. );
  195. NW_STATUS
  196. NDSLogout(
  197. VOID
  198. );
  199. NW_STATUS
  200. NDSAuthenticateToServer(
  201. IN NWCONN_HANDLE hConn
  202. );
  203. NW_STATUS WINAPI
  204. NDSChangePassword(LPSTR pszUser, LPSTR pszOldPasswd, LPSTR pszNewPasswd);
  205. // Bindery keyed change password
  206. NW_STATUS WINAPI
  207. NWChangeBinderyObjectPassword(
  208. NWCONN_HANDLE hConn,
  209. LPCSTR pObjectName,
  210. USHORT ObjectType, // 0x100 for User
  211. LPCSTR pOldPassword, // upper-cased
  212. LPCSTR pNewPassword // upper-cased
  213. );
  214. NW_STATUS WINAPI
  215. NWChangeBinderyConnectionPassword(
  216. LPCSTR pszResourceName,
  217. LPCSTR pszLoggedInUser,
  218. LPCSTR pszOldPassword,
  219. LPCSTR pszNewPassword
  220. );
  221. NW_STATUS
  222. NDSCanonicalizeName(
  223. IN UINT flags, // see below
  224. IN LPSTR pszName,
  225. OUT LPSTR pszCanonicalName
  226. );
  227. #define FLAGS_TYPED_NAMES 1 // add/remove name component types (e.g. CN=)
  228. #define FLAGS_NO_CONTEXT 2 // dont append/remove context
  229. #define FLAGS_LOCAL_CONTEXT 4 // use local name context (not global)
  230. NW_STATUS
  231. NDSAbbreviateName(
  232. IN UINT flags,
  233. IN LPSTR pszCanonicalName,
  234. OUT LPSTR pszAbbreviatedName
  235. );
  236. /*
  237. * Netware Directory Syntax IDs
  238. */
  239. #define NDSI_DIST_NAME 1 // Distinguished Name
  240. #define NDSI_CS_STRING 2 // Case sensitive string
  241. #define NDSI_CI_STRING 3 // Case ignore string
  242. #define NDSI_PRINT_STRING 4 // Printable string (subset of ASCII)
  243. #define NDSI_NUM_STRING 5 // numeric string ('0' - '9' and space)
  244. #define NDSI_CI_STRINGLIST 6 // list of case ignore strings
  245. #define NDSI_BOOLEAN 7 // 0 or 1
  246. #define NDSI_INTEGER 8 // signed 32 bit int
  247. #define NDSI_BYTE_STRING 9 // raw octet string
  248. #define NDSI_PHONE_NUMBER 10
  249. #define NDSI_FAX_NUMBER 11
  250. #define NDSI_NET_ADDRESS 12 // typed network address
  251. #define NDSI_BYTE_STRINGLIST 13 // list of octet strings
  252. #define NDSI_EMAIL_ADDRESS 14
  253. #define NDSI_FILE_PATH 15
  254. #define NDSI_ACL_ENTRY 17 // NDS access control list
  255. #define NDSI_POST_ADDRESS 18 // upto 5 lines
  256. #define NDSI_TIME_STAMP 19
  257. #define NDSI_CLASS_NAME 20 // Object Class
  258. #define NDSI_STREAM 21 // read using file i/o
  259. #define NDSI_COUNTER 22 // similar to INTEGER
  260. #define NDSI_TIME 24 // time in secs since 0hrs 1/1/80
  261. /*
  262. * Directory syntax types
  263. */
  264. typedef DWORD OBJ_ID;
  265. // Use PSTR for :NDSI_DIST_NAME, NDSI_CS_STRING, NDSI_CI_STRING, NDSI_PRINT_STRING, NDSI_NUM_STRING
  266. typedef unsigned char DS_BOOLEAN; //NDSI_BOOLEAN
  267. typedef long DS_INT; //NDSI_INTEGER, NDSI_COUNTER (32 bit signed int)
  268. typedef unsigned long DS_TIME; //NDSI_TIME (32 bit unsigned)
  269. // NDSI_NET_ADDRESS
  270. typedef struct {
  271. UINT addrType; // see below
  272. UINT addrLen;
  273. BYTE *addr; // addrLength bytes of data
  274. } DS_NET_ADDRESS;
  275. // values for addrType
  276. #define NETADDR_IPX 0
  277. #define NETADDR_IP 1
  278. #define NETADDR_SDLC 2
  279. #define NETADDR_ETHERNET_TOKENRING 3
  280. #define NETADDR_OSI 4
  281. // NDSI_EMAIL_ADDRESS
  282. typedef struct {
  283. UINT addrType;
  284. LPSTR addr; // e-mail address
  285. } DS_EMAIL_ADDRESS;
  286. // NDSI_CI_STRINGLIST
  287. typedef struct {
  288. struct _dsStringList *next;
  289. LPSTR string;
  290. } DS_CI_STRINGLIST;
  291. //NDSI_BYTE_STRING
  292. typedef struct {
  293. UINT strLen;
  294. BYTE *data; // strLen bytes
  295. } DS_BYTE_STRING;
  296. // NDSI_FILE_PATH
  297. typedef struct {
  298. UINT nameSpace;
  299. LPSTR volume;
  300. LPSTR path;
  301. } DS_FILE_PATH;
  302. //NDSI_FAX_NUMBER
  303. typedef struct {
  304. LPSTR number;
  305. UINT bitCount;
  306. UINT parameters;
  307. } DS_FAX_NUMBER;
  308. // values for nameSpace:
  309. //
  310. #define NAMESPACE_DOS 0
  311. #define NAMESPACE_MAC 1
  312. #define NAMESPACE_UNIX 2
  313. #define NAMESPACE_FTAM 3
  314. #define NAMESPACE_OS2 4
  315. typedef struct {
  316. CHAR objectName[MAX_NDS_NAME_CHARS+1]; // canonical name of object
  317. OBJ_ID entryId; // NDS internal object Id
  318. ULONG flags; // see below
  319. UINT subordinateCount; // number of children (if this is a container)
  320. char className[MAX_NDS_SCHEMA_NAME_CHARS+1]; // e.g. "User"
  321. } DS_OBJ_INFO;
  322. // values for DS_OBJ_INFO flags:
  323. //
  324. //
  325. // Object flags
  326. //
  327. #define DS_CONTAINER 0x4
  328. #define DS_ALIAS 0x1
  329. #define NDSOBJ_ALIAS_FLAG 0x1
  330. #define NDSOBJ_PARTITION_FLAG 0x2 // partition root
  331. #define NDSOBJ_CONTAINER_FLAG 0x4 // container object
  332. //
  333. // NDS Class and attributes names
  334. //
  335. #define DSCL_TOP "Top"
  336. #define DSCL_ALIAS "Alias"
  337. #define DSCL_COMPUTER "Computer"
  338. #define DSCL_COUNTRY "Country"
  339. #define DSCL_DIRECTORY_MAP "Directory Map"
  340. #define DSCL_GROUP "Group"
  341. #define DSCL_NCP_SERVER "NCP Server"
  342. #define DSCL_ORGANIZATION "Organization"
  343. #define DSCL_ORGANIZATIONAL_PERSON "Organizational Person"
  344. #define DSCL_ORGANIZATIONAL_ROLE "Organizational Role"
  345. #define DSCL_ORGANIZATIONAL_UNIT "Organizational Unit"
  346. #define DSCL_PRINTER "Printer"
  347. #define DSCL_PRINT_SERVER "Print Server"
  348. #define DSCL_PROFILE "Profile"
  349. #define DSCL_QUEUE "Queue"
  350. #define DSCL_SERVER "Server"
  351. #define DSCL_UNKNOWN "Unknown"
  352. #define DSCL_USER "User"
  353. #define DSCL_VOLUME "Volume"
  354. #define DSAT_ALIASED_OBJECT_NAME "Aliased Object Name"
  355. #define DSAT_BINDERY_PROPERTY "Bindery Property"
  356. #define DSAT_BINDERY_OBJECT_RESTRICTION "Bindery Object Restriction"
  357. #define DSAT_BINDERY_TYPE "Bindery Type"
  358. #define DSAT_COMMON_NAME "CN"
  359. #define DSAT_COUNTRY_NAME "C"
  360. #define DSAT_DEFAULT_QUEUE "Default Queue"
  361. #define DSAT_DESCRIPTION "Description"
  362. #define DSAT_HOME_DIRECTORY "Home Directory"
  363. #define DSAT_HOST_DEVICE "Host Device"
  364. #define DSAT_HOST_RESOURCE_NAME "Host Resource Name"
  365. #define DSAT_HOST_SERVER "Host Server"
  366. #define DSAT_LOGIN_ALLOWED_TIME_MAP "Login Allowed Time Map"
  367. #define DSAT_LOGIN_DISABLED "Login Disabled"
  368. #define DSAT_LOGIN_EXPIRATION_TIME "Login Expiration Time"
  369. #define DSAT_LOGIN_GRACE_LIMIT "Login Grace Limit"
  370. #define DSAT_LOGIN_GRACE_REMAINING "Login Grace Remaining"
  371. #define DSAT_LOGIN_INTRUDER_ADDRESS "Login Intruder Address"
  372. #define DSAT_LOGIN_INTRUDER_ATTEMPTS "Login Intruder Attempts"
  373. #define DSAT_LOGIN_INTRUDER_LIMIT "Login Intruder Limit"
  374. #define DSAT_INTRUDER_ATTEMPT_RESET_INTRVL "Intruder Attempt Reset Interval"
  375. #define DSAT_LOGIN_INTRUDER_RESET_TIME "Login Intruder Reset Time"
  376. #define DSAT_LOGIN_MAXIMUM_SIMULTANEOUS "Login Maximum Simultaneous"
  377. #define DSAT_LOGIN_SCRIPT "Login Script"
  378. #define DSAT_LOGIN_TIME "Login Time"
  379. #define DSAT_MINIMUM_ACCOUNT_BALANCE "Minimum Account Balance"
  380. #define DSAT_MEMBER "Member"
  381. #define DSAT_EMAIL_ADDRESS "EMail Address"
  382. #define DSAT_NETWORK_ADDRESS "Network Address"
  383. #define DSAT_NETWORK_ADDRESS_RESTRICTION "Network Address Restriction"
  384. #define DSAT_OBJECT_CLASS "Object Class"
  385. #define DSAT_OPERATOR "Operator"
  386. #define DSAT_ORGANIZATIONAL_UNIT_NAME "OU"
  387. #define DSAT_ORGANIZATION_NAME "O"
  388. #define DSAT_OWNER "Owner"
  389. #define DSAT_PASSWORDS_USED "Passwords Used"
  390. #define DSAT_PASSWORD_ALLOW_CHANGE "Password Allow Change"
  391. #define DSAT_PASSWORD_EXPIRATION_INTERVAL "Password Expiration Interval"
  392. #define DSAT_PASSWORD_EXPIRATION_TIME "Password Expiration Time"
  393. #define DSAT_PASSWORD_MINIMUM_LENGTH "Password Minimum Length"
  394. #define DSAT_PASSWORD_REQUIRED "Password Required"
  395. #define DSAT_PASSWORD_UNIQUE_REQUIRED "Password Unique Required"
  396. #define DSAT_PATH "Path"
  397. #define DSAT_PRINT_JOB_CONFIGURATION "Print Job Configuration"
  398. #define DSAT_PRINTER_CONTROL "Printer Control"
  399. #define DSAT_PROFILE "Profile"
  400. #define DSAT_QUEUE "Queue"
  401. #define DSAT_QUEUE_DIRECTORY "Queue Directory"
  402. #define DSAT_SERVER "Server"
  403. #define DSAT_STATE_OR_PROVINCE_NAME "S"
  404. #define DSAT_STATUS "Status"
  405. #define DSAT_UNKNOWN "Unknown"
  406. #define DSAT_USER "User"
  407. #define DSAT_VERSION "Version"
  408. #define DSAT_GROUP_MEMBERSHIP "Group Membership"
  409. #define DSAT_DEVICE "Device"
  410. #define DSAT_MESSAGE_SERVER "Message Server"
  411. #define DSAT_LANGUAGE "Language"
  412. #define DSAT_QUEUE_TYPE "Queue Type"
  413. #define DSAT_SUPPORTED_CONNECTIONS "Supported Connections"
  414. #define DSAT_UNKNOWN_OBJECT_RESTRICTION "Unknown Object Restriction"
  415. #define DSAT_LOCKED_BY_INTRUDER "Locked By Intruder"
  416. #define DSAT_PRINTER "Printer"
  417. #define DSAT_DETECT_INTRUDER "Detect Intruder"
  418. #define DSAT_LOCKOUT_AFTER_DETECTION "Lockout After Detection"
  419. #define DSAT_INTRUDER_LOCKOUT_RESET_INTRVL "Intruder Lockout Reset Interval"
  420. #define DSAT_SERVER_HOLDS "Server Holds"
  421. #define DSAT_SAP_NAME "SAP Name"
  422. #define DSAT_VOLUME "Volume"
  423. #define DSAT_LAST_LOGIN_TIME "Last Login Time"
  424. #define DSAT_PRINT_SERVER "Print Server"
  425. #define DSAT_ACCOUNT_BALANCE "Account Balance"
  426. #define DSAT_ALLOW_UNLIMITED_CREDIT "Allow Unlimited Credit"
  427. #define DSAT_LOCALE "L"
  428. #define DSAT_POSTAL_CODE "Postal Code"
  429. #define DSAT_POSTAL_OFFICE_BOX "Postal Office Box"
  430. #define DSAT_SECURITY_EQUALS "Security Equals"
  431. #define DSAT_SURNAME "Surname"
  432. #define DSAT_FULL_NAME "Full Name"
  433. #define DSAT_TITLE "Title"
  434. #define DSAT_TELEPHONE_NUMBER "Telephone Number"
  435. #define DSAT_ADMIN_ASSISTANT "Administrative Assistant"
  436. #define DSAT_EMPLOYEE_ID "Employee ID"
  437. #define DSAT_FAX_NUMBER "Facsimile Telephone Number"
  438. #define DSAT_HIGHER_PRIVILEGES "Higher Privileges"
  439. #define DSAT_INITIALS "Initials"
  440. #define DSAT_LOCKED_BY_INTRUDER "Locked By Intruder"
  441. #define DSAT_LOGIN_DISABLED "Login Disabled"
  442. #define DSAT_LOGIN_GRACE_LIMIT "Login Grace Limit"
  443. #define DSAT_LOGIN_GRACE_REMAINING "Login Grace Remaining"
  444. #define DSAT_LOGIN_MAXIMUM_SIMULTANEOUS "Login Maximum Simultaneous"
  445. #define DSAT_MAILSTOP "Mailstop"
  446. #define DSAT_MINIMUM_ACCOUNT_BALANCE "Minimum Account Balance"
  447. #define DSAT_OBJECT_CLASS "Object Class"
  448. #define DSAT_OU "OU"
  449. #define DSAT_PASSWORDS_USED "Passwords Used"
  450. #define DSAT_PHYSICAL_DELIVERY_OFFICE_NAME "Physical Delivery Office Name"
  451. #define DSAT_POSTAL_ADDRESS "Postal Address"
  452. #define DSAT_PRIVATE_KEY "Private Key"
  453. #define DSAT_REVISION "Revision"
  454. #define DSAT_SECURITY_FLAGS "Security Flags"
  455. #define DSAT_SEE_ALSO "See Also"
  456. #define DSAT_SERVER_HOLDS "Server Holds"
  457. #define DSAT_SUPERVISOR "Supervisor"
  458. #define DSAT_SA "SA"
  459. #define DSAT_S "S"
  460. #define DSAT_VALIDITY_INTERVAL "Certificate Validity Interval"
  461. #define DSAT_EQUIVALENT_TO_ME "Equivalent To Me"
  462. #define DSAT_GENERATIONAL_QUALIFIER "Generational Qualifier"
  463. #define DSAT_GIVEN_NAME "Given Name"
  464. #define DSAT_MAILBOX_ID "Mailbox ID"
  465. #define DSAT_MAILBOX_LOCATION "Mailbox Location"
  466. #define DSAT_PROFILE_MEMBERSHIP "Profile Membership"
  467. #define DSAT_MS_SYS_FLAGS "MS System Flags"
  468. #define DSAT_MS_SYSPOLICIES_PATH "MS System Policies"
  469. #define DSAT_RIGHTS_QUERYSTRING "[Entry Rights]"
  470. #define MSSYS_NDS_ENABLED_POLICIES 0x0001
  471. //
  472. // Object rights
  473. //
  474. #define NDS_BROWSE_OBJ 0x1
  475. #define NDS_CREATE_OBJ 0x2
  476. #define NDS_DELETE_OBJ 0x4
  477. #define NDS_RENAME_OBJ 0x8
  478. #define NDS_SUPERVISE_OBJ 0x10
  479. //
  480. // Attribute rights
  481. //
  482. #define NDS_COMPARE_ATTR 0x1
  483. #define NDS_READ_ATTR 0x2
  484. #define NDS_WRITE_ATTR 0x4
  485. #define NDS_ADD_SELF_ATTR 0x8
  486. #define NDS_MANAGED_ATTR 0x10
  487. #define NDS_SUPERVISE_ATTR 0x20
  488. /*
  489. * Directory browsing APIs
  490. * -----------------------
  491. *
  492. */
  493. NW_STATUS
  494. NDSGetObjectInfo(
  495. IN LPCSTR lpszObjectName,
  496. IN OUT DS_OBJ_INFO *pObjInfo
  497. );
  498. NW_STATUS
  499. NDSGetObjectInfoWithId(
  500. IN NWCONN_HANDLE hConn, // server to query
  501. IN DWORD dwObjectId, // objectId
  502. IN OUT DS_OBJ_INFO *pObjInfo);
  503. NW_STATUS
  504. NDSGetObjectId(
  505. IN NWCONN_HANDLE hConn, // server to query
  506. IN LPCSTR szName, // DS object name
  507. OUT DWORD *pObjId); // objectId
  508. NW_STATUS
  509. NDSListSubordinates(
  510. IN LPCSTR ParentName, // canonical name of parent object
  511. OUT PVOID ReplyBuf, // user supplied buffer
  512. IN UINT ReplyBufLength, // buffer length
  513. IN OUT PUINT phIteration, // returned value used for subsequent requests
  514. OUT PUINT pNumObjects // number of objects returned
  515. );
  516. NW_STATUS
  517. NDSListNextObject(
  518. IN PVOID ReplyBuf, // filled in by NDSListSubordinates
  519. OUT DS_OBJ_INFO *pObjInfo // fields describe the object
  520. );
  521. NW_STATUS
  522. NDSSearch(
  523. IN LPCSTR ParentName, // context of search
  524. IN UINT depth, // scope
  525. IN LPCSTR srchString, // matching condition
  526. IN LPVOID *pArgList, // list of parameters referenced by srchString
  527. IN UINT numArgs,
  528. OUT PVOID ReplyBuf, // user supplied buffer
  529. IN UINT ReplyBufLength, // buffer length
  530. IN OUT UINT *pIterationHandle, // returned value used for subsequent requests
  531. OUT PUINT pNumObjects // number of objects returned
  532. );
  533. NW_STATUS
  534. NDSReadAttributes(
  535. IN LPCSTR ObjectName, // canonical name of object
  536. IN LPCSTR AttribName, // attribute Name e.g. "Surname"
  537. IN PVOID ReplyBuf, // user supplied buffer
  538. IN UINT ReplyBufLength, // length of buffer
  539. IN OUT PUINT phIteration, // returned value used for subsequent requests
  540. OUT PUINT pNumValues, // number of values read (on exit)
  541. OUT PUINT pSyntaxId // syntax id of value (on exit)
  542. );
  543. NW_STATUS
  544. NDSReadNextValue(
  545. IN PVOID ReplyBuf, // filled in earlier by NDSReadAttributes
  546. OUT PVOID pValue, // user allocated buffer, typed according to syntax id
  547. IN UINT ValueLength // size of memory pointed to by pValue
  548. );
  549. typedef enum {
  550. SA_Read = 1,
  551. SA_Write,
  552. SA_Read_Write
  553. } STREAM_ACCESS;
  554. NW_STATUS
  555. NDSOpenStream(
  556. IN LPCSTR ObjectName,
  557. IN LPCSTR AttribName,
  558. IN STREAM_ACCESS Access,
  559. OUT HANDLE *pFileHandle,
  560. OUT PUINT pFileLength
  561. );
  562. NW_STATUS
  563. NDSGetEffectiveRights(
  564. IN LPCSTR SubjectName,
  565. IN LPCSTR ObjectName,
  566. IN LPCSTR AttribName,
  567. OUT UINT *pRights
  568. );
  569. NW_STATUS NDSModifyAttribute(
  570. IN LPCSTR ObjectName,
  571. IN LPCSTR AttribName,
  572. IN UINT operation, // see below
  573. IN UINT syntaxId, // of attribute
  574. IN PVOID pValueList, // list of arguments (PSTRs, DS_INTs, DS_BYTE_STRINGs etc.)
  575. IN UINT numValues // # of values
  576. );
  577. // Modify attribute operations
  578. #define ADD_ATTRIB 0
  579. #define REMOVE_ATTRIB 1
  580. #define ADD_ATTRIB_VALUE 2
  581. #define REMOVE_ATTRIB_VALUE 3
  582. #define APPEND_ATTRIB_VALUE 4
  583. #define OVERWRITE_ATTRIB_VALUE 5
  584. #define CLEAR_ATTRIB 6
  585. #define CLEAR_ATTRIB_VALUE 7
  586. NW_STATUS NDSDefineAttribute(
  587. IN LPCSTR AttribName,
  588. IN UINT syntaxId,
  589. IN UINT flags, // see Attribute flags
  590. IN LONG lowerLimit,
  591. IN LONG upperLimit,
  592. IN PVOID asn1Id // NULL for now
  593. );
  594. // Attribute flags
  595. #define ATTRIB_ENTRY_ID 0x1
  596. #define ATTRIB_SIZED 0x2
  597. #define ATTRIB_PERMANENT 0x4
  598. #define ATTRIB_READ_ONLY 0x8
  599. #define ATTRIB_HIDDEN 0x10
  600. #define ATTRIB_STRING 0x20
  601. #define ATTRIB_SYNC_IMMED 0x40
  602. #define ATTRIB_PUBLIC_READ 0x80
  603. #define ATTRIB_SERVER_ONLY 0x100
  604. #define ATTRIB_WRITE_MANAGED 0x200
  605. #define ATTRIB_PER_REPLICA 0x400
  606. NW_STATUS NDSAddAttributeToClass(
  607. IN LPCSTR ClassName,
  608. IN LPCSTR AttribName
  609. );
  610. //
  611. // System NetWare notification codes . Those are used to inform NP about various
  612. // NetWare related events ( like completion of login script processing)
  613. //
  614. typedef UINT NW_SYS_EVENT;
  615. typedef DWORD WINAPI F_NPNotifyNetworkEvent(HWND,NW_SYS_EVENT,DWORD);
  616. typedef F_NPNotifyNetworkEvent *PF_NPNotifyNetworkEvent;
  617. BOOL PrepareNetWareRunTime(HWND hWnd);
  618. BOOL FreeNetWareRunTime(VOID);
  619. NW_STATUS
  620. NWMakeRunTimeInitCalls(VOID);
  621. NW_STATUS
  622. NWMakeRunTimeTerminateCalls(VOID);
  623. #define NW_SE_SCRIPTS_COMPLETED 0x0001
  624. #ifdef __cplusplus
  625. }
  626. #endif /* __cplusplus */
  627. //
  628. // Restore packing setup
  629. //
  630. #include <poppack.h>
  631. #endif /* !_INC_MSNWAPI */