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.

945 lines
34 KiB

  1. /********************************************************************/
  2. /** Microsoft Windows **/
  3. /** Copyright(c) Microsoft Corp., 1994 **/
  4. /********************************************************************/
  5. /********************************************************************
  6. * *
  7. * About this file ... SVRAPI.H *
  8. * *
  9. * This file contains information about the NetAccess, *
  10. * NetConnection, NetFile, NetServer, NetSession and NetShare APIs.*
  11. * There is a section for each set of APIs. *
  12. * Each section contains: *
  13. * *
  14. * Function prototypes. *
  15. * *
  16. * Data structure templates. *
  17. * *
  18. * Definition of special values. *
  19. * *
  20. ********************************************************************/
  21. /*
  22. * NOTE: Lengths of ASCIIZ strings are given as the maximum
  23. * strlen() value. This does not include space for the
  24. * terminating 0-byte. When allocating space for such an item,
  25. * use the form:
  26. *
  27. * char username[LM20_UNLEN+1];
  28. *
  29. * An exception to this is the PATHLEN manifest, which does
  30. * include space for the terminating 0-byte.
  31. */
  32. /*NOINC*/
  33. #ifndef SVRAPI_INCLUDED
  34. #define SVRAPI_INCLUDED
  35. #include <lmcons.h>
  36. #include <lmerr.h>
  37. #ifndef RC_INVOKED
  38. #pragma pack(1) /* Assume byte packing throughout */
  39. #endif
  40. #ifdef __cplusplus
  41. extern "C" { /* Assume C declarations for C++ */
  42. #endif /* __cplusplus */
  43. #if !defined(_SVRAPI_)
  44. #define API_FUNCTION DECLSPEC_IMPORT API_RET_TYPE APIENTRY
  45. #else
  46. #define API_FUNCTION API_RET_TYPE APIENTRY
  47. #endif
  48. /*INC*/
  49. /****************************************************************
  50. * *
  51. * Access Class *
  52. * *
  53. ****************************************************************/
  54. /****************************************************************
  55. * *
  56. * Function prototypes - ACCESS *
  57. * *
  58. ****************************************************************/
  59. extern API_FUNCTION
  60. NetAccessAdd ( const char FAR * pszServer,
  61. short sLevel,
  62. char FAR * pbBuffer,
  63. unsigned short cbBuffer );
  64. extern API_FUNCTION
  65. NetAccessCheck ( char FAR * pszReserved,
  66. char FAR * pszUserName,
  67. char FAR * pszResource,
  68. unsigned short usOperation,
  69. unsigned short FAR * pusResult );
  70. extern API_FUNCTION
  71. NetAccessDel ( const char FAR * pszServer,
  72. char FAR * pszResource );
  73. extern API_FUNCTION
  74. NetAccessEnum ( const char FAR * pszServer,
  75. char FAR * pszBasePath,
  76. short fsRecursive,
  77. short sLevel,
  78. char FAR * pbBuffer,
  79. unsigned short cbBuffer,
  80. unsigned short FAR * pcEntriesRead,
  81. unsigned short FAR * pcTotalAvail );
  82. extern API_FUNCTION
  83. NetAccessGetInfo ( const char FAR * pszServer,
  84. char FAR * pszResource,
  85. short sLevel,
  86. char FAR * pbBuffer,
  87. unsigned short cbBuffer,
  88. unsigned short FAR * pcbTotalAvail );
  89. extern API_FUNCTION
  90. NetAccessSetInfo ( const char FAR * pszServer,
  91. char FAR * pszResource,
  92. short sLevel,
  93. char FAR * pbBuffer,
  94. unsigned short cbBuffer,
  95. short sParmNum );
  96. extern API_FUNCTION
  97. NetAccessGetUserPerms ( char FAR * pszServer,
  98. char FAR * pszUgName,
  99. char FAR * pszResource,
  100. unsigned short FAR * pusPerms );
  101. /****************************************************************
  102. * *
  103. * Data structure templates - ACCESS *
  104. * *
  105. ****************************************************************/
  106. struct access_list {
  107. char acl_ugname[LM20_UNLEN+1];
  108. char acl_ugname_pad_1;
  109. short acl_access;
  110. }; /* access_list */
  111. struct access_list_2
  112. {
  113. char FAR * acl2_ugname;
  114. unsigned short acl2_access;
  115. }; /* access_list_2 */
  116. struct access_list_12
  117. {
  118. char FAR * acl12_ugname;
  119. unsigned short acl12_access;
  120. }; /* access_list_12 */
  121. struct access_info_0 {
  122. char FAR * acc0_resource_name;
  123. }; /* access_info_0 */
  124. struct access_info_1 {
  125. char FAR * acc1_resource_name;
  126. short acc1_attr; /* See values below */
  127. short acc1_count;
  128. }; /* access_info_1 */
  129. struct access_info_2
  130. {
  131. char FAR * acc2_resource_name;
  132. short acc2_attr;
  133. short acc2_count;
  134. }; /* access_info_2 */
  135. struct access_info_10 {
  136. char FAR * acc10_resource_name;
  137. }; /* access_info_10 */
  138. struct access_info_12
  139. {
  140. char FAR * acc12_resource_name;
  141. short acc12_attr;
  142. short acc12_count;
  143. }; /* access_info_12 */
  144. /****************************************************************
  145. * *
  146. * Special values and constants - ACCESS *
  147. * *
  148. ****************************************************************/
  149. /*
  150. * Maximum number of permission entries for each resource.
  151. */
  152. #define MAXPERMENTRIES 64
  153. /*
  154. * Bit values for the access permissions. ACCESS_ALL is a handy
  155. * way to specify maximum permissions. These are used in
  156. * acl_access field of access_list structures.
  157. */
  158. /*NOINC*/
  159. #define ACCESS_NONE 0
  160. #define ACCESS_ALL (ACCESS_READ|ACCESS_WRITE|ACCESS_CREATE|ACCESS_EXEC|ACCESS_DELETE|ACCESS_ATRIB|ACCESS_PERM|ACCESS_FINDFIRST)
  161. /*INC*/
  162. #define ACCESS_READ 0x1
  163. #define ACCESS_WRITE 0x2
  164. #define ACCESS_CREATE 0x4
  165. #define ACCESS_EXEC 0x8
  166. #define ACCESS_DELETE 0x10
  167. #define ACCESS_ATRIB 0x20
  168. #define ACCESS_PERM 0x40
  169. #define ACCESS_FINDFIRST 0x80
  170. #define ACCESS_GROUP 0x8000
  171. /*
  172. * Bit values for the acc1_attr field of the access_info_1 structure.
  173. * Only one bit is currently defined.
  174. */
  175. #define ACCESS_AUDIT 0x1
  176. /*
  177. * Parmnum value for NetAccessSetInfo.
  178. */
  179. #define ACCESS_ATTR_PARMNUM 2
  180. /*
  181. * ACCESS_LETTERS defines a letter for each bit position in
  182. * the acl_access field of struct access_list. Note that some
  183. * bits have a corresponding letter of ' ' (space).
  184. */
  185. #define ACCESS_LETTERS "RWCXDAP "
  186. /****************************************************************
  187. * *
  188. * Share Class *
  189. * *
  190. ****************************************************************/
  191. /****************************************************************
  192. * *
  193. * Function prototypes - SHARE *
  194. * *
  195. ****************************************************************/
  196. extern API_FUNCTION
  197. NetShareAdd ( const char FAR * pszServer,
  198. short sLevel,
  199. const char FAR * pbBuffer,
  200. unsigned short cbBuffer );
  201. extern API_FUNCTION
  202. NetShareDel ( const char FAR * pszServer,
  203. const char FAR * pszNetName,
  204. unsigned short usReserved );
  205. extern API_FUNCTION
  206. NetShareEnum ( const char FAR * pszServer,
  207. short sLevel,
  208. char FAR * pbBuffer,
  209. unsigned short cbBuffer,
  210. unsigned short FAR * pcEntriesRead,
  211. unsigned short FAR * pcTotalAvail );
  212. extern API_FUNCTION
  213. NetShareGetInfo ( const char FAR * pszServer,
  214. const char FAR * pszNetName,
  215. short sLevel,
  216. char FAR * pbBuffer,
  217. unsigned short cbBuffer,
  218. unsigned short FAR * pcbTotalAvail );
  219. extern API_FUNCTION
  220. NetShareSetInfo ( const char FAR * pszServer,
  221. const char FAR * pszNetName,
  222. short sLevel,
  223. const char FAR * pbBuffer,
  224. unsigned short cbBuffer,
  225. short sParmNum );
  226. /****************************************************************
  227. * *
  228. * Data structure templates - SHARE *
  229. * *
  230. ****************************************************************/
  231. struct share_info_0 {
  232. char shi0_netname[LM20_NNLEN+1];
  233. }; /* share_info_0 */
  234. struct share_info_1 {
  235. char shi1_netname[LM20_NNLEN+1];
  236. char shi1_pad1;
  237. unsigned short shi1_type;
  238. char FAR * shi1_remark;
  239. }; /* share_info_1 */
  240. struct share_info_2 {
  241. char shi2_netname[LM20_NNLEN+1];
  242. char shi2_pad1;
  243. unsigned short shi2_type;
  244. char FAR * shi2_remark;
  245. unsigned short shi2_permissions;
  246. unsigned short shi2_max_uses;
  247. unsigned short shi2_current_uses;
  248. char FAR * shi2_path;
  249. char shi2_passwd[SHPWLEN+1];
  250. char shi2_pad2;
  251. }; /* share_info_2 */
  252. struct share_info_50 {
  253. char shi50_netname[LM20_NNLEN+1];
  254. unsigned char shi50_type;
  255. unsigned short shi50_flags;
  256. char FAR * shi50_remark;
  257. char FAR * shi50_path;
  258. char shi50_rw_password[SHPWLEN+1];
  259. char shi50_ro_password[SHPWLEN+1];
  260. }; /* share_info_50 */
  261. /****************************************************************
  262. * *
  263. * Special values and constants - SHARE *
  264. * *
  265. ****************************************************************/
  266. /* Field values for shi50_flags; */
  267. #define SHI50F_RDONLY 0x0001
  268. #define SHI50F_FULL 0x0002
  269. #define SHI50F_DEPENDSON (SHI50F_RDONLY|SHI50F_FULL)
  270. #define SHI50F_ACCESSMASK (SHI50F_RDONLY|SHI50F_FULL)
  271. #define SHI50F_PERSIST 0x0100
  272. #define SHI50F_SYSTEM 0x0200
  273. /*
  274. * Values for parmnum parameter to NetShareSetInfo.
  275. */
  276. #define SHI_REMARK_PARMNUM 4
  277. #define SHI_PERMISSIONS_PARMNUM 5
  278. #define SHI_MAX_USES_PARMNUM 6
  279. #define SHI_PASSWD_PARMNUM 9
  280. #define SHI1_NUM_ELEMENTS 4
  281. #define SHI2_NUM_ELEMENTS 10
  282. /*
  283. * Share types (shi1_type and shi2_type fields).
  284. */
  285. #define STYPE_DISKTREE 0
  286. #define STYPE_PRINTQ 1
  287. #define STYPE_DEVICE 2
  288. #define STYPE_IPC 3
  289. #define SHI_USES_UNLIMITED -1
  290. /****************************************************************
  291. * *
  292. * Session Class *
  293. * *
  294. ****************************************************************/
  295. /****************************************************************
  296. * *
  297. * Function prototypes - SESSION *
  298. * *
  299. ****************************************************************/
  300. extern API_FUNCTION
  301. NetSessionDel ( const char FAR * pszServer,
  302. const char FAR * pszClientName,
  303. short sReserved );
  304. extern API_FUNCTION
  305. NetSessionEnum ( const char FAR * pszServer,
  306. short sLevel,
  307. char FAR * pbBuffer,
  308. unsigned short cbBuffer,
  309. unsigned short FAR * pcEntriesRead,
  310. unsigned short FAR * pcTotalAvail );
  311. extern API_FUNCTION
  312. NetSessionGetInfo ( const char FAR * pszServer,
  313. const char FAR * pszClientName,
  314. short sLevel,
  315. char FAR * pbBuffer,
  316. unsigned short cbBuffer,
  317. unsigned short FAR * pcbTotalAvail );
  318. /****************************************************************
  319. * *
  320. * Data structure templates - SESSION *
  321. * *
  322. ****************************************************************/
  323. struct session_info_0 {
  324. char FAR * sesi0_cname;
  325. }; /* session_info_0 */
  326. struct session_info_1 {
  327. char FAR * sesi1_cname;
  328. char FAR * sesi1_username;
  329. unsigned short sesi1_num_conns;
  330. unsigned short sesi1_num_opens;
  331. unsigned short sesi1_num_users;
  332. unsigned long sesi1_time;
  333. unsigned long sesi1_idle_time;
  334. unsigned long sesi1_user_flags;
  335. }; /* session_info_1 */
  336. struct session_info_2 {
  337. char FAR * sesi2_cname;
  338. char FAR * sesi2_username;
  339. unsigned short sesi2_num_conns;
  340. unsigned short sesi2_num_opens;
  341. unsigned short sesi2_num_users;
  342. unsigned long sesi2_time;
  343. unsigned long sesi2_idle_time;
  344. unsigned long sesi2_user_flags;
  345. char FAR * sesi2_cltype_name;
  346. }; /* session_info_2 */
  347. struct session_info_10 {
  348. char FAR * sesi10_cname;
  349. char FAR * sesi10_username;
  350. unsigned long sesi10_time;
  351. unsigned long sesi10_idle_time;
  352. }; /* session_info_10 */
  353. struct session_info_50 {
  354. char FAR * sesi50_cname;
  355. char FAR * sesi50_username;
  356. unsigned long sesi50_key;
  357. unsigned short sesi50_num_conns;
  358. unsigned short sesi50_num_opens;
  359. unsigned long sesi50_time;
  360. unsigned long sesi50_idle_time;
  361. unsigned char sesi50_protocol;
  362. unsigned char pad1;
  363. }; /* session_info_50 */
  364. /****************************************************************
  365. * *
  366. * Special values and constants - SESSION *
  367. * *
  368. ****************************************************************/
  369. /*
  370. * Bits defined in sesi1_user_flags.
  371. */
  372. #define SESS_GUEST 1 /* session is logged on as a guest */
  373. #define SESS_NOENCRYPTION 2 /* session is not using encryption */
  374. #define SESI1_NUM_ELEMENTS 8
  375. #define SESI2_NUM_ELEMENTS 9
  376. /****************************************************************
  377. * *
  378. * Connection Class *
  379. * *
  380. ****************************************************************/
  381. /****************************************************************
  382. * *
  383. * Function prototypes - CONNECTION *
  384. * *
  385. ****************************************************************/
  386. extern API_FUNCTION
  387. NetConnectionEnum ( const char FAR * pszServer,
  388. const char FAR * pszQualifier,
  389. short sLevel,
  390. char FAR * pbBuffer,
  391. unsigned short cbBuffer,
  392. unsigned short FAR * pcEntriesRead,
  393. unsigned short FAR * pcTotalAvail );
  394. /****************************************************************
  395. * *
  396. * Data structure templates - CONNECTION *
  397. * *
  398. ****************************************************************/
  399. struct connection_info_0 {
  400. unsigned short coni0_id;
  401. }; /* connection_info_0 */
  402. struct connection_info_1 {
  403. unsigned short coni1_id;
  404. unsigned short coni1_type;
  405. unsigned short coni1_num_opens;
  406. unsigned short coni1_num_users;
  407. unsigned long coni1_time;
  408. char FAR * coni1_username;
  409. char FAR * coni1_netname;
  410. }; /* connection_info_1 */
  411. struct connection_info_50 {
  412. unsigned short coni50_type;
  413. unsigned short coni50_num_opens;
  414. unsigned long coni50_time;
  415. char FAR * coni50_netname;
  416. char FAR * coni50_username;
  417. }; /* connection_info_50 */
  418. /****************************************************************
  419. * *
  420. * File Class *
  421. * *
  422. ****************************************************************/
  423. /****************************************************************
  424. * *
  425. * Function prototypes - FILE *
  426. * *
  427. ****************************************************************/
  428. extern API_FUNCTION
  429. NetFileClose2 ( const char FAR * pszServer,
  430. unsigned long ulFileId );
  431. extern API_FUNCTION
  432. NetFileEnum ( const char FAR * pszServer,
  433. const char FAR * pszBasePath,
  434. short sLevel,
  435. char FAR * pbBuffer,
  436. unsigned short cbBuffer,
  437. unsigned short FAR * pcEntriesRead,
  438. unsigned short FAR * pcTotalAvail );
  439. /****************************************************************
  440. * *
  441. * Data structure templates - FILE *
  442. * *
  443. ****************************************************************/
  444. struct file_info_0 {
  445. unsigned short fi0_id;
  446. }; /* file_info_0 */
  447. struct file_info_1 {
  448. unsigned short fi1_id;
  449. unsigned short fi1_permissions;
  450. unsigned short fi1_num_locks;
  451. char FAR * fi1_pathname;
  452. char FAR * fi1_username;
  453. }; /* file_info_1 */
  454. struct file_info_2 {
  455. unsigned long fi2_id;
  456. }; /* file_info_2 */
  457. struct file_info_3 {
  458. unsigned long fi3_id;
  459. unsigned short fi3_permissions;
  460. unsigned short fi3_num_locks;
  461. char FAR * fi3_pathname;
  462. char FAR * fi3_username;
  463. }; /* file_info_3 */
  464. struct file_info_50 {
  465. unsigned long fi50_id;
  466. unsigned short fi50_permissions;
  467. unsigned short fi50_num_locks;
  468. char FAR * fi50_pathname;
  469. char FAR * fi50_username;
  470. char FAR * fi50_sharename;
  471. }; /* file_info_50 */
  472. struct res_file_enum_2 {
  473. unsigned short res_pad; /* not used now */
  474. unsigned short res_fs; /* server type */
  475. unsigned long res_pro; /* progressive */
  476. }; /* res_file_enum_2 */
  477. /****************************************************************
  478. * *
  479. * Special values and constants - FILE *
  480. * *
  481. ****************************************************************/
  482. /* bit values for permissions */
  483. #define PERM_FILE_READ 0x1 /* user has read access */
  484. #define PERM_FILE_WRITE 0x2 /* user has write access */
  485. #define PERM_FILE_CREATE 0x4 /* user has create access */
  486. typedef struct res_file_enum_2 FRK;
  487. /*NOINC*/
  488. #define FRK_INIT( f ) \
  489. { \
  490. (f).res_pad = 0L; \
  491. (f).res_fs = 0; \
  492. (f).res_pro = 0; \
  493. }
  494. /*INC*/
  495. /****************************************************************
  496. * *
  497. * Server Class *
  498. * *
  499. ****************************************************************/
  500. /****************************************************************
  501. * *
  502. * Function prototypes - SERVER *
  503. * *
  504. ****************************************************************/
  505. extern API_FUNCTION
  506. NetServerGetInfo ( const char FAR * pszServer,
  507. short sLevel,
  508. char FAR * pbBuffer,
  509. unsigned short cbBuffer,
  510. unsigned short FAR * pcbTotalAvail );
  511. extern API_FUNCTION
  512. NetServerSetInfo ( const char FAR * pszServer,
  513. short sLevel,
  514. const char FAR * pbBuffer,
  515. unsigned short cbBuffer,
  516. short sParmNum );
  517. /****************************************************************
  518. * *
  519. * Data structure templates - SERVER *
  520. * *
  521. ****************************************************************/
  522. struct server_info_0 {
  523. char sv0_name[CNLEN + 1]; /* Server name */
  524. }; /* server_info_0 */
  525. struct server_info_1 {
  526. char sv1_name[CNLEN + 1];
  527. unsigned char sv1_version_major; /* Major version # of net */
  528. unsigned char sv1_version_minor; /* Minor version # of net */
  529. unsigned long sv1_type; /* Server type */
  530. char FAR * sv1_comment; /* Exported server comment */
  531. }; /* server_info_1 */
  532. /* NOTE struct prefix must equal server_info_1 like below! */
  533. struct server_info_50 {
  534. char sv50_name[CNLEN + 1];
  535. unsigned char sv50_version_major; /* Major version # of net */
  536. unsigned char sv50_version_minor; /* Minor version # of net */
  537. unsigned long sv50_type; /* Server type */
  538. char FAR * sv50_comment; /* Exported server comment */
  539. unsigned short sv50_security; /* SV_SECURITY_* (see below) */
  540. unsigned short sv50_auditing; /* 0 = no auditing; nonzero = auditing */
  541. char FAR * sv50_container; /* Security server/domain */
  542. char FAR * sv50_ab_server; /* Address book server */
  543. char FAR * sv50_ab_dll; /* Address book provider DLL */
  544. }; /* server_info_50 */
  545. struct server_info_2 {
  546. char sv2_name[CNLEN + 1];
  547. unsigned char sv2_version_major;
  548. unsigned char sv2_version_minor;
  549. unsigned long sv2_type;
  550. char FAR * sv2_comment;
  551. unsigned long sv2_ulist_mtime; /* User list, last modification time */
  552. unsigned long sv2_glist_mtime; /* Group list, last modification time */
  553. unsigned long sv2_alist_mtime; /* Access list, last modification time */
  554. unsigned short sv2_users; /* max number of users allowed */
  555. unsigned short sv2_disc; /* auto-disconnect timeout(in minutes) */
  556. char FAR * sv2_alerts; /* alert names (semicolon separated) */
  557. unsigned short sv2_security; /* SV_USERSECURITY or SV_SHARESECURITY */
  558. unsigned short sv2_auditing; /* 0 = no auditing; nonzero = auditing */
  559. unsigned short sv2_numadmin; /* max number of administrators allowed */
  560. unsigned short sv2_lanmask; /* bit mask representing the srv'd nets */
  561. unsigned short sv2_hidden; /* 0 = visible; nonzero = hidden */
  562. unsigned short sv2_announce; /* visible server announce rate (sec) */
  563. unsigned short sv2_anndelta; /* announce randomize interval (sec) */
  564. /* name of guest account */
  565. char sv2_guestacct[LM20_UNLEN + 1];
  566. unsigned char sv2_pad1; /* Word alignment pad byte */
  567. char FAR * sv2_userpath; /* ASCIIZ path to user directories */
  568. unsigned short sv2_chdevs; /* max # shared character devices */
  569. unsigned short sv2_chdevq; /* max # character device queues */
  570. unsigned short sv2_chdevjobs; /* max # character device jobs */
  571. unsigned short sv2_connections; /* max # of connections */
  572. unsigned short sv2_shares; /* max # of shares */
  573. unsigned short sv2_openfiles; /* max # of open files */
  574. unsigned short sv2_sessopens; /* max # of open files per session */
  575. unsigned short sv2_sessvcs; /* max # of virtual circuits per client */
  576. unsigned short sv2_sessreqs; /* max # of simul. reqs. from a client */
  577. unsigned short sv2_opensearch; /* max # of open searches */
  578. unsigned short sv2_activelocks; /* max # of active file locks */
  579. unsigned short sv2_numreqbuf; /* number of server (standard) buffers */
  580. unsigned short sv2_sizreqbuf; /* size of svr (standard) bufs (bytes) */
  581. unsigned short sv2_numbigbuf; /* number of big (64K) buffers */
  582. unsigned short sv2_numfiletasks;/* number of file worker processes */
  583. unsigned short sv2_alertsched; /* alert counting interval (minutes) */
  584. unsigned short sv2_erroralert; /* error log alerting threshold */
  585. unsigned short sv2_logonalert; /* logon violation alerting threshold */
  586. unsigned short sv2_accessalert; /* access violation alerting threshold */
  587. unsigned short sv2_diskalert; /* low disk space alert threshold (KB) */
  588. unsigned short sv2_netioalert; /* net I/O error ratio alert threshold */
  589. /* (tenths of a percent) */
  590. unsigned short sv2_maxauditsz; /* Maximum audit file size (KB) */
  591. char FAR * sv2_srvheuristics; /* performance related server switches*/
  592. }; /* server_info_2 */
  593. struct server_info_3 {
  594. char sv3_name[CNLEN + 1];
  595. unsigned char sv3_version_major;
  596. unsigned char sv3_version_minor;
  597. unsigned long sv3_type;
  598. char FAR * sv3_comment;
  599. unsigned long sv3_ulist_mtime; /* User list, last modification time */
  600. unsigned long sv3_glist_mtime; /* Group list, last modification time */
  601. unsigned long sv3_alist_mtime; /* Access list, last modification time */
  602. unsigned short sv3_users; /* max number of users allowed */
  603. unsigned short sv3_disc; /* auto-disconnect timeout(in minutes) */
  604. char FAR * sv3_alerts; /* alert names (semicolon separated) */
  605. unsigned short sv3_security; /* SV_USERSECURITY or SV_SHARESECURITY */
  606. unsigned short sv3_auditing; /* 0 = no auditing; nonzero = auditing */
  607. unsigned short sv3_numadmin; /* max number of administrators allowed */
  608. unsigned short sv3_lanmask; /* bit mask representing the srv'd nets */
  609. unsigned short sv3_hidden; /* 0 = visible; nonzero = hidden */
  610. unsigned short sv3_announce; /* visible server announce rate (sec) */
  611. unsigned short sv3_anndelta; /* announce randomize interval (sec) */
  612. /* name of guest account */
  613. char sv3_guestacct[LM20_UNLEN + 1];
  614. unsigned char sv3_pad1; /* Word alignment pad byte */
  615. char FAR * sv3_userpath; /* ASCIIZ path to user directories */
  616. unsigned short sv3_chdevs; /* max # shared character devices */
  617. unsigned short sv3_chdevq; /* max # character device queues */
  618. unsigned short sv3_chdevjobs; /* max # character device jobs */
  619. unsigned short sv3_connections; /* max # of connections */
  620. unsigned short sv3_shares; /* max # of shares */
  621. unsigned short sv3_openfiles; /* max # of open files */
  622. unsigned short sv3_sessopens; /* max # of open files per session */
  623. unsigned short sv3_sessvcs; /* max # of virtual circuits per client */
  624. unsigned short sv3_sessreqs; /* max # of simul. reqs. from a client */
  625. unsigned short sv3_opensearch; /* max # of open searches */
  626. unsigned short sv3_activelocks; /* max # of active file locks */
  627. unsigned short sv3_numreqbuf; /* number of server (standard) buffers */
  628. unsigned short sv3_sizreqbuf; /* size of svr (standard) bufs (bytes) */
  629. unsigned short sv3_numbigbuf; /* number of big (64K) buffers */
  630. unsigned short sv3_numfiletasks;/* number of file worker processes */
  631. unsigned short sv3_alertsched; /* alert counting interval (minutes) */
  632. unsigned short sv3_erroralert; /* error log alerting threshold */
  633. unsigned short sv3_logonalert; /* logon violation alerting threshold */
  634. unsigned short sv3_accessalert; /* access violation alerting threshold */
  635. unsigned short sv3_diskalert; /* low disk space alert threshold (KB) */
  636. unsigned short sv3_netioalert; /* net I/O error ratio alert threshold */
  637. /* (tenths of a percent) */
  638. unsigned short sv3_maxauditsz; /* Maximum audit file size (KB) */
  639. char FAR * sv3_srvheuristics; /* performance related server switches*/
  640. unsigned long sv3_auditedevents; /* Audit event control mask */
  641. unsigned short sv3_autoprofile; /* (0,1,2,3) = (NONE,LOAD,SAVE,or BOTH) */
  642. char FAR * sv3_autopath; /* file pathname (where to load & save) */
  643. }; /* server_info_3 */
  644. /****************************************************************
  645. * *
  646. * Special values and constants - SERVER *
  647. * *
  648. ****************************************************************/
  649. /*
  650. * Mask to be applied to svX_version_major in order to obtain
  651. * the major version number.
  652. */
  653. #define MAJOR_VERSION_MASK 0x0F
  654. /*
  655. * Bit-mapped values for svX_type fields. X = 1, 2 or 3.
  656. */
  657. #define SV_TYPE_WORKSTATION 0x00000001
  658. #define SV_TYPE_SERVER 0x00000002
  659. #define SV_TYPE_SQLSERVER 0x00000004
  660. #define SV_TYPE_DOMAIN_CTRL 0x00000008
  661. #define SV_TYPE_DOMAIN_BAKCTRL 0x00000010
  662. #define SV_TYPE_TIME_SOURCE 0x00000020
  663. #define SV_TYPE_AFP 0x00000040
  664. #define SV_TYPE_NOVELL 0x00000080
  665. #define SV_TYPE_DOMAIN_MEMBER 0x00000100
  666. #define SV_TYPE_PRINTQ_SERVER 0x00000200
  667. #define SV_TYPE_DIALIN_SERVER 0x00000400
  668. #define SV_TYPE_ALL 0xFFFFFFFF /* handy for NetServerEnum2 */
  669. /*
  670. * Special value for svX_disc that specifies infinite disconnect
  671. * time. X = 2 or 3.
  672. */
  673. #define SV_NODISC 0xFFFF /* No autodisconnect timeout enforced */
  674. /*
  675. * Values of svX_security field. X = 2 or 3.
  676. */
  677. #define SV_USERSECURITY 1
  678. #define SV_SHARESECURITY 0
  679. /*
  680. * Values of svX_security field. X = 50.
  681. */
  682. #define SV_SECURITY_SHARE 0 /* Share-level */
  683. #define SV_SECURITY_WINNT 1 /* User-level - Windows NT workst'n */
  684. #define SV_SECURITY_WINNTAS 2 /* User-level - Windows NT domain */
  685. #define SV_SECURITY_NETWARE 3 /* User-level - NetWare 3.x bindery */
  686. /*
  687. * Values of svX_hidden field. X = 2 or 3.
  688. */
  689. #define SV_HIDDEN 1
  690. #define SV_VISIBLE 0
  691. /*
  692. * Values for parmnum parameter to NetServerSetInfo.
  693. */
  694. #define SV_COMMENT_PARMNUM 5
  695. #define SV_DISC_PARMNUM 10
  696. #define SV_ALERTS_PARMNUM 11
  697. #define SV_HIDDEN_PARMNUM 16
  698. #define SV_ANNOUNCE_PARMNUM 17
  699. #define SV_ANNDELTA_PARMNUM 18
  700. #define SV_ALERTSCHED_PARMNUM 37
  701. #define SV_ERRORALERT_PARMNUM 38
  702. #define SV_LOGONALERT_PARMNUM 39
  703. #define SV_ACCESSALERT_PARMNUM 40
  704. #define SV_DISKALERT_PARMNUM 41
  705. #define SV_NETIOALERT_PARMNUM 42
  706. #define SV_MAXAUDITSZ_PARMNUM 43
  707. #define SVI1_NUM_ELEMENTS 5
  708. #define SVI2_NUM_ELEMENTS 44
  709. #define SVI3_NUM_ELEMENTS 45
  710. /*
  711. * Masks describing AUTOPROFILE parameters
  712. */
  713. #define SW_AUTOPROF_LOAD_MASK 0x1
  714. #define SW_AUTOPROF_SAVE_MASK 0x2
  715. /****************************************************************
  716. * *
  717. * Security Class *
  718. * *
  719. ****************************************************************/
  720. /****************************************************************
  721. * *
  722. * Function prototypes - SECURITY *
  723. * *
  724. ****************************************************************/
  725. extern API_FUNCTION
  726. NetSecurityGetInfo ( const char FAR * pszServer,
  727. short sLevel,
  728. char FAR * pbBuffer,
  729. unsigned short cbBuffer,
  730. unsigned short FAR * pcbTotalAvail );
  731. /****************************************************************
  732. * *
  733. * Data structure templates - SECURITY *
  734. * *
  735. ****************************************************************/
  736. struct security_info_1 {
  737. unsigned long sec1_security; /* SEC_SECURITY_* (see below) */
  738. char FAR * sec1_container; /* Security server/domain */
  739. char FAR * sec1_ab_server; /* Address book server */
  740. char FAR * sec1_ab_dll; /* Address book provider DLL */
  741. }; /* security_info_1 */
  742. /****************************************************************
  743. * *
  744. * Special values and constants - SECURITY *
  745. * *
  746. ****************************************************************/
  747. /*
  748. /*
  749. * Values of secX_security field. X = 1.
  750. */
  751. #define SEC_SECURITY_SHARE SV_SECURITY_SHARE
  752. #define SEC_SECURITY_WINNT SV_SECURITY_WINNT
  753. #define SEC_SECURITY_WINNTAS SV_SECURITY_WINNTAS
  754. #define SEC_SECURITY_NETWARE SV_SECURITY_NETWARE
  755. /*NOINC*/
  756. #ifdef __cplusplus
  757. }
  758. #endif /* __cplusplus */
  759. #ifndef RC_INVOKED
  760. #pragma pack() /* Revert to default packing */
  761. #endif
  762. #endif /* SVRAPI_INCLUDED */
  763. /*INC*/