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.

827 lines
22 KiB

  1. //=================================================================
  2. //
  3. // NetApi32Api.h
  4. //
  5. // Copyright (c) 1999-2001 Microsoft Corporation, All Rights Reserved
  6. //
  7. //=================================================================
  8. #ifndef _NETAPI32API_H_
  9. #define _NETAPI32API_H_
  10. #include <lmaccess.h>
  11. #include <lmapibuf.h>
  12. #include <lmserver.h>
  13. #include <lmerr.h>
  14. #include <ntsecapi.h>
  15. #include <stack>
  16. #include <comdef.h>
  17. #include <dsrole.h>
  18. #include <dsgetdc.h>
  19. /******************************************************************************
  20. * #includes to Register this class with the CResourceManager.
  21. *****************************************************************************/
  22. #include "DllWrapperBase.h"
  23. extern const GUID g_guidNetApi32Api;
  24. extern const TCHAR g_tstrNetApi32[];
  25. /******************************************************************************
  26. * Function pointer typedefs. Add new functions here as required.
  27. *****************************************************************************/
  28. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_GROUP_ENUM)
  29. (
  30. LPCWSTR servername,
  31. DWORD level,
  32. LPBYTE *bufptr,
  33. DWORD prefmaxlen,
  34. LPDWORD entriesread,
  35. LPDWORD totalentries,
  36. PDWORD_PTR resume_handle
  37. );
  38. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_GROUP_GET_INFO)
  39. (
  40. LPCWSTR servername,
  41. LPCWSTR groupname,
  42. DWORD level,
  43. LPBYTE *bufptr
  44. );
  45. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_GROUP_SET_INFO)
  46. (
  47. LPCWSTR servername,
  48. LPCWSTR groupname,
  49. DWORD level,
  50. LPBYTE buf,
  51. LPDWORD parm_err
  52. );
  53. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_LOCAL_GROUP_GET_INFO)
  54. (
  55. LPCWSTR servername,
  56. LPCWSTR groupname,
  57. DWORD level,
  58. LPBYTE *bufptr
  59. );
  60. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_LOCAL_GROUP_SET_INFO)
  61. (
  62. LPCWSTR servername,
  63. LPCWSTR groupname,
  64. DWORD level,
  65. LPBYTE buf,
  66. LPDWORD a_parm_err
  67. );
  68. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_GROUP_GET_USERS)
  69. (
  70. LPCWSTR servername,
  71. LPCWSTR groupname,
  72. DWORD level,
  73. LPBYTE *bufptr,
  74. DWORD prefmaxlen,
  75. LPDWORD entriesread,
  76. LPDWORD totalentries,
  77. PDWORD_PTR ResumeHandle
  78. );
  79. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_LOCAL_GROUP_GET_MEMBERS)
  80. (
  81. LPCWSTR servername,
  82. LPCWSTR groupname,
  83. DWORD level,
  84. LPBYTE *bufptr,
  85. DWORD prefmaxlen,
  86. LPDWORD entriesread,
  87. LPDWORD totalentries,
  88. PDWORD_PTR ResumeHandle
  89. );
  90. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_LOCAL_GROUP_ENUM)
  91. (
  92. LPCWSTR servername,
  93. DWORD level,
  94. LPBYTE *bufptr,
  95. DWORD prefmaxlen,
  96. LPDWORD entriesread,
  97. LPDWORD totalentries,
  98. PDWORD_PTR resumehandle
  99. );
  100. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_SHARE_ENUM)
  101. (
  102. LPTSTR servername,
  103. DWORD level,
  104. LPBYTE *bufptr,
  105. DWORD prefmaxlen,
  106. LPDWORD entriesread,
  107. LPDWORD totalentries,
  108. LPDWORD resume_handle
  109. );
  110. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_SHARE_GET_INFO)
  111. (
  112. LPTSTR servername,
  113. LPTSTR netname,
  114. DWORD level,
  115. LPBYTE *bufptr
  116. );
  117. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_SHARE_ADD)
  118. (
  119. IN LPTSTR servername,
  120. IN DWORD level,
  121. IN LPBYTE buf,
  122. OUT LPDWORD parm_err
  123. );
  124. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_SHARE_ENUM_STICKY)
  125. (
  126. IN LPTSTR servername,
  127. IN DWORD level,
  128. OUT LPBYTE *bufptr,
  129. IN DWORD prefmaxlen,
  130. OUT LPDWORD entriesread,
  131. OUT LPDWORD totalentries,
  132. IN OUT LPDWORD resume_handle
  133. );
  134. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_SHARE_SET_INFO)
  135. (
  136. IN LPTSTR servername,
  137. IN LPTSTR netname,
  138. IN DWORD level,
  139. IN LPBYTE buf,
  140. OUT LPDWORD parm_err
  141. );
  142. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_SHARE_DEL)
  143. (
  144. IN LPTSTR servername,
  145. IN LPTSTR netname,
  146. IN DWORD reserved
  147. );
  148. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_SHARE_DEL_STICKY)
  149. (
  150. IN LPTSTR servername,
  151. IN LPTSTR netname,
  152. IN DWORD reserved
  153. );
  154. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_SHARE_CHECK)
  155. (
  156. IN LPTSTR servername,
  157. IN LPTSTR device,
  158. OUT LPDWORD type
  159. );
  160. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_USER_ENUM)
  161. (
  162. LPCWSTR servername,
  163. DWORD level,
  164. DWORD filter,
  165. LPBYTE *bufptr,
  166. DWORD prefmaxlen,
  167. LPDWORD entriesread,
  168. LPDWORD totalentries,
  169. LPDWORD resume_handle
  170. );
  171. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_USER_GET_INFO)
  172. (
  173. LPCWSTR servername,
  174. LPCWSTR username,
  175. DWORD level,
  176. LPBYTE *bufptr
  177. );
  178. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_USER_SET_INFO)
  179. (
  180. LPCWSTR a_servername,
  181. LPCWSTR a_username,
  182. DWORD a_level,
  183. LPBYTE a_buf,
  184. LPDWORD a_parm_err
  185. );
  186. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_API_BUFFER_FREE)
  187. (
  188. void *bufptr
  189. );
  190. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_QUERY_DISPLAY_INFORMATION)
  191. (
  192. LPWSTR ServerName,
  193. DWORD Level,
  194. DWORD Index,
  195. DWORD EntriesRequested,
  196. DWORD PreferredMaximumLength,
  197. LPDWORD ReturnedEntryCount,
  198. PVOID *SortedBuffer
  199. );
  200. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_SERVER_SET_INFO)
  201. (
  202. LPTSTR servername,
  203. DWORD level,
  204. LPBYTE buf,
  205. LPDWORD ParmError
  206. );
  207. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_SERVER_GET_INFO)
  208. (
  209. LPTSTR servername,
  210. DWORD level,
  211. LPBYTE *bufptr
  212. );
  213. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_GET_DC_NAME)
  214. ( LPCWSTR servername,
  215. LPCWSTR domainname,
  216. LPBYTE *bufptr
  217. );
  218. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_WKSTA_GET_INFO)
  219. (
  220. LPWSTR servername,
  221. DWORD level,
  222. LPBYTE *bufptr
  223. );
  224. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_GET_ANY_DC_NAME)
  225. (
  226. LPWSTR servername,
  227. LPWSTR domainname,
  228. LPBYTE *bufptr
  229. );
  230. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_SERVER_ENUM)
  231. (
  232. LPTSTR servername,
  233. DWORD level,
  234. LPBYTE *bufptr,
  235. DWORD prefmaxlen,
  236. LPDWORD entriesread,
  237. LPDWORD totalentries,
  238. DWORD servertype,
  239. LPTSTR domain,
  240. LPDWORD resume_handle
  241. );
  242. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_USER_MODALS_GET)
  243. (
  244. LPWSTR servername,
  245. DWORD level,
  246. LPBYTE *bufptr
  247. );
  248. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_SCHEDULE_JOB_ADD)
  249. (
  250. IN LPCWSTR Servername OPTIONAL,
  251. IN LPBYTE Buffer,
  252. OUT LPDWORD JobId
  253. );
  254. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_SCHEDULE_JOB_DEL)
  255. (
  256. IN LPCWSTR Servername OPTIONAL,
  257. IN DWORD MinJobId,
  258. IN DWORD MaxJobId
  259. );
  260. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_SCHEDULE_JOB_ENUM)
  261. (
  262. IN LPCWSTR Servername OPTIONAL,
  263. OUT LPBYTE *PointerToBuffer,
  264. IN DWORD PrefferedMaximumLength,
  265. OUT LPDWORD EntriesRead,
  266. OUT LPDWORD TotalEntries,
  267. IN OUT LPDWORD ResumeHandle
  268. );
  269. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_SCHEDULE_JOB_GET_INFO)
  270. (
  271. IN LPCWSTR Servername OPTIONAL,
  272. IN DWORD JobId,
  273. OUT LPBYTE *PointerToBuffer
  274. );
  275. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_USE_GET_INFO)
  276. (
  277. IN LPCWSTR UncServerName OPTIONAL,
  278. IN LPCWSTR UseName,
  279. IN DWORD Level,
  280. OUT LPBYTE *BufPtr
  281. );
  282. // ******* BEGIN: NT 4 and over only *******
  283. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_NET_ENUMERATE_TRUSTED_DOMAINS)
  284. (
  285. LPCWSTR servername,
  286. LPWSTR *domainNames
  287. ) ;
  288. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NETAPI32_DS_GET_DC_NAME)
  289. (
  290. LPCTSTR ComputerName,
  291. LPCTSTR DomainName,
  292. GUID *DomainGuid,
  293. LPCTSTR SiteName,
  294. ULONG Flags,
  295. PDOMAIN_CONTROLLER_INFO *DomainControllerInfo
  296. );
  297. // ******* END: NT4 and over only ***********
  298. // ******* BEGIN: NT 5 and over only *******
  299. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_DS_ROLE_GET_PRIMARY_DOMAIN_INFORMATION)
  300. (
  301. LPCWSTR servername,
  302. DSROLE_PRIMARY_DOMAIN_INFO_LEVEL level,
  303. LPBYTE *bufptr
  304. );
  305. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_DS_ROLE_FREE_MEMORY)
  306. (
  307. LPBYTE bufptr
  308. );
  309. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NET_RENAME_MACHINE_IN_DOMAIN)
  310. (
  311. LPCWSTR lpServer,
  312. LPCWSTR lpNewMachineName,
  313. LPCWSTR lpAccount,
  314. LPCWSTR lpPassword,
  315. DWORD fRenameOptions
  316. );
  317. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NET_JOIN_DOMAIN)
  318. (
  319. LPCWSTR lpServer,
  320. LPCWSTR lpDomain,
  321. LPCWSTR lpAccountOU,
  322. LPCWSTR lpAccount,
  323. LPCWSTR lpPassword,
  324. DWORD fJoinOptions
  325. );
  326. typedef NET_API_STATUS (NET_API_FUNCTION *PFN_NET_UNJOIN_DOMAIN)
  327. (
  328. LPCWSTR lpServer,
  329. LPCWSTR lpAccount,
  330. LPCWSTR lpPassword,
  331. DWORD fUnjoinOptions
  332. );
  333. // ******* END: NT5 and over only ***********
  334. /******************************************************************************
  335. * Wrapper class for Kernel32 load/unload, for registration with CResourceManager.
  336. ******************************************************************************/
  337. class CNetApi32Api : public CDllWrapperBase
  338. {
  339. private:
  340. // Member variables (function pointers) pointing to kernel32 functions.
  341. // Add new functions here as required.
  342. PFN_NETAPI32_NET_GROUP_ENUM m_pfnNetGroupEnum;
  343. PFN_NETAPI32_NET_GROUP_GET_INFO m_pfnNetGroupGetInfo;
  344. PFN_NETAPI32_NET_GROUP_SET_INFO m_pfnNetGroupSetInfo;
  345. PFN_NETAPI32_NET_LOCAL_GROUP_GET_INFO m_pfnNetLocalGroupGetInfo;
  346. PFN_NETAPI32_NET_LOCAL_GROUP_SET_INFO m_pfnNetLocalGroupSetInfo;
  347. PFN_NETAPI32_NET_GROUP_GET_USERS m_pfnNetGroupGetUsers;
  348. PFN_NETAPI32_NET_LOCAL_GROUP_GET_MEMBERS m_pfnNetLocalGroupGetMembers;
  349. PFN_NETAPI32_NET_LOCAL_GROUP_ENUM m_pfnNetLocalGroupEnum;
  350. PFN_NETAPI32_NET_SHARE_ENUM m_pfnNetShareEnum;
  351. PFN_NETAPI32_NET_SHARE_GET_INFO m_pfnNetShareGetInfo;
  352. PFN_NETAPI32_NET_SHARE_SET_INFO m_pfnNetShareSetInfo;
  353. PFN_NETAPI32_NET_SHARE_ADD m_pfnNetShareAdd;
  354. PFN_NETAPI32_NET_SHARE_ENUM_STICKY m_pfnNetShareEnumSticky;
  355. PFN_NETAPI32_NET_SHARE_DEL m_pfnNetShareDel;
  356. PFN_NETAPI32_NET_SHARE_DEL_STICKY m_pfnNetShareDelSticky;
  357. PFN_NETAPI32_NET_SHARE_CHECK m_pfnNetShareCheck;
  358. PFN_NETAPI32_NET_USER_ENUM m_pfnNetUserEnum;
  359. PFN_NETAPI32_NET_USER_GET_INFO m_pfnNetUserGetInfo;
  360. PFN_NETAPI32_NET_USER_SET_INFO m_pfnNetUserSetInfo;
  361. PFN_NETAPI32_NET_API_BUFFER_FREE m_pfnNetApiBufferFree;
  362. PFN_NETAPI32_NET_QUERY_DISPLAY_INFORMATION m_pfnNetQueryDisplayInformation;
  363. PFN_NETAPI32_NET_SERVER_SET_INFO m_pfnNetServerSetInfo;
  364. PFN_NETAPI32_NET_SERVER_GET_INFO m_pfnNetServerGetInfo;
  365. PFN_NETAPI32_NET_GET_DC_NAME m_pfnNetGetDCName;
  366. PFN_NETAPI32_NET_WKSTA_GET_INFO m_pfnNetWkstaGetInfo;
  367. PFN_NETAPI32_NET_GET_ANY_DC_NAME m_pfnNetGetAnyDCName;
  368. PFN_NETAPI32_NET_SERVER_ENUM m_pfnNetServerEnum;
  369. PFN_NETAPI32_NET_USER_MODALS_GET m_pfnNetUserModalsGet;
  370. PFN_NETAPI32_NET_SCHEDULE_JOB_ADD m_pfnNetScheduleJobAdd;
  371. PFN_NETAPI32_NET_SCHEDULE_JOB_DEL m_pfnNetScheduleJobDel;
  372. PFN_NETAPI32_NET_SCHEDULE_JOB_ENUM m_pfnNetScheduleJobEnum;
  373. PFN_NETAPI32_NET_SCHEDULE_JOB_GET_INFO m_pfnNetScheduleJobGetInfo;
  374. PFN_NETAPI32_NET_USE_GET_INFO m_pfnNetUseGetInfo;
  375. // ******* BEGIN: NT 4 and over only *******
  376. PFN_NETAPI32_NET_ENUMERATE_TRUSTED_DOMAINS m_pfnNetEnumerateTrustedDomains;
  377. #ifdef NTONLY
  378. PFN_NETAPI32_DS_GET_DC_NAME m_pfnDsGetDcNameW ;
  379. #else
  380. PFN_NETAPI32_DS_GET_DC_NAME m_pfnDsGetDcNameA ;
  381. #endif
  382. // ******* END: NT4 and over only ***********
  383. // ******* BEGIN: NT 5 and over only *******
  384. PFN_DS_ROLE_GET_PRIMARY_DOMAIN_INFORMATION m_pfnDsRoleGetPrimaryDomainInformation;
  385. PFN_DS_ROLE_FREE_MEMORY m_pfnDsRoleFreeMemory;
  386. PFN_NET_RENAME_MACHINE_IN_DOMAIN m_pfnNetRenameMachineInDomain;
  387. PFN_NET_JOIN_DOMAIN m_pfnNetJoinDomain;
  388. PFN_NET_UNJOIN_DOMAIN m_pfnNetUnjoinDomain;
  389. // ******* END: NT5 and over only ***********
  390. public:
  391. // Constructor and destructor:
  392. CNetApi32Api(LPCTSTR a_tstrWrappedDllName);
  393. ~CNetApi32Api();
  394. // Inherrited initialization function.
  395. virtual bool Init();
  396. // Member functions wrapping kernel32 functions.
  397. // Add new functions here as required:
  398. NET_API_STATUS NET_API_FUNCTION NetGroupEnum
  399. (
  400. LPCWSTR a_servername,
  401. DWORD a_level,
  402. LPBYTE *a_bufptr,
  403. DWORD a_prefmaxlen,
  404. LPDWORD a_entriesread,
  405. LPDWORD a_totalentries,
  406. PDWORD_PTR a_resume_handle
  407. );
  408. NET_API_STATUS NET_API_FUNCTION NetGroupGetInfo
  409. (
  410. LPCWSTR a_servername,
  411. LPCWSTR a_groupname,
  412. DWORD a_level,
  413. LPBYTE *a_bufptr
  414. );
  415. NET_API_STATUS NET_API_FUNCTION NetGroupSetInfo
  416. (
  417. LPCWSTR servername,
  418. LPCWSTR groupname,
  419. DWORD level,
  420. LPBYTE buf,
  421. LPDWORD parm_err
  422. );
  423. NET_API_STATUS NET_API_FUNCTION NetLocalGroupGetInfo
  424. (
  425. LPCWSTR a_servername,
  426. LPCWSTR a_groupname,
  427. DWORD a_level,
  428. LPBYTE *a_bufptr
  429. );
  430. NET_API_STATUS NET_API_FUNCTION NetLocalGroupSetInfo
  431. (
  432. LPCWSTR a_servername,
  433. LPCWSTR a_groupname,
  434. DWORD a_level,
  435. LPBYTE a_buf,
  436. LPDWORD a_parm_err
  437. );
  438. NET_API_STATUS NET_API_FUNCTION NetGroupGetUsers
  439. (
  440. LPCWSTR a_servername,
  441. LPCWSTR a_groupname,
  442. DWORD a_level,
  443. LPBYTE *a_bufptr,
  444. DWORD a_prefmaxlen,
  445. LPDWORD a_entriesread,
  446. LPDWORD a_totalentries,
  447. PDWORD_PTR a_ResumeHandle
  448. );
  449. NET_API_STATUS NET_API_FUNCTION NetLocalGroupGetMembers
  450. (
  451. LPCWSTR a_servername,
  452. LPCWSTR a_groupname,
  453. DWORD a_level,
  454. LPBYTE *a_bufptr,
  455. DWORD a_prefmaxlen,
  456. LPDWORD a_entriesread,
  457. LPDWORD a_totalentries,
  458. PDWORD_PTR a_ResumeHandle
  459. );
  460. NET_API_STATUS NET_API_FUNCTION NetLocalGroupEnum
  461. (
  462. LPCWSTR a_servername,
  463. DWORD a_level,
  464. LPBYTE *a_bufptr,
  465. DWORD a_prefmaxlen,
  466. LPDWORD a_entriesread,
  467. LPDWORD a_totalentries,
  468. PDWORD_PTR a_resumehandle
  469. );
  470. NET_API_STATUS NET_API_FUNCTION NetShareEnum
  471. (
  472. LPTSTR a_servername,
  473. DWORD a_level,
  474. LPBYTE *a_bufptr,
  475. DWORD a_prefmaxlen,
  476. LPDWORD a_entriesread,
  477. LPDWORD a_totalentries,
  478. LPDWORD a_resume_handle
  479. );
  480. NET_API_STATUS NET_API_FUNCTION NetShareGetInfo
  481. (
  482. LPTSTR a_servername,
  483. LPTSTR a_netname,
  484. DWORD a_level,
  485. LPBYTE *a_bufptr
  486. );
  487. NET_API_STATUS NET_API_FUNCTION NetShareAdd
  488. (
  489. LPTSTR a_servername,
  490. DWORD a_level,
  491. LPBYTE a_buf,
  492. LPDWORD a_parm_err
  493. );
  494. NET_API_STATUS NET_API_FUNCTION NetShareEnumSticky
  495. (
  496. LPTSTR a_servername,
  497. DWORD a_level,
  498. LPBYTE *a_bufptr,
  499. DWORD a_prefmaxlen,
  500. LPDWORD a_entriesread,
  501. LPDWORD a_totalentries,
  502. LPDWORD a_resume_handle
  503. );
  504. NET_API_STATUS NET_API_FUNCTION NetShareSetInfo
  505. (
  506. LPTSTR a_servername,
  507. LPTSTR a_netname,
  508. DWORD a_level,
  509. LPBYTE a_buf,
  510. LPDWORD a_parm_err
  511. );
  512. NET_API_STATUS NET_API_FUNCTION NetShareDel
  513. (
  514. LPTSTR a_servername,
  515. LPTSTR a_netname,
  516. DWORD a_reserved
  517. );
  518. NET_API_STATUS NET_API_FUNCTION NetShareDelSticky
  519. (
  520. LPTSTR a_servername,
  521. LPTSTR a_netname,
  522. DWORD a_reserved
  523. );
  524. NET_API_STATUS NET_API_FUNCTION NetShareCheck
  525. (
  526. LPTSTR a_servername,
  527. LPTSTR a_device,
  528. LPDWORD a_type
  529. );
  530. NET_API_STATUS NET_API_FUNCTION NetUserEnum
  531. (
  532. LPCWSTR a_servername,
  533. DWORD a_level,
  534. DWORD a_filter,
  535. LPBYTE *a_bufptr,
  536. DWORD a_prefmaxlen,
  537. LPDWORD a_entriesread,
  538. LPDWORD a_totalentries,
  539. LPDWORD a_resume_handle
  540. );
  541. NET_API_STATUS NET_API_FUNCTION NetUserGetInfo
  542. (
  543. LPCWSTR a_servername,
  544. LPCWSTR a_username,
  545. DWORD a_level,
  546. LPBYTE *a_bufptr
  547. );
  548. NET_API_STATUS NET_API_FUNCTION NetUserSetInfo(
  549. LPCWSTR a_servername,
  550. LPCWSTR a_username,
  551. DWORD a_level,
  552. LPBYTE a_buf,
  553. LPDWORD a_parm_err
  554. );
  555. NET_API_STATUS NET_API_FUNCTION NetApiBufferFree
  556. (
  557. void *a_bufptr
  558. );
  559. NET_API_STATUS NET_API_FUNCTION NetQueryDisplayInformation
  560. (
  561. LPWSTR a_ServerName,
  562. DWORD a_Level,
  563. DWORD a_Index,
  564. DWORD a_EntriesRequested,
  565. DWORD a_PreferredMaximumLength,
  566. LPDWORD a_ReturnedEntryCount,
  567. PVOID *a_SortedBuffer
  568. );
  569. NET_API_STATUS NET_API_FUNCTION NetServerSetInfo
  570. (
  571. LPTSTR a_servername,
  572. DWORD a_level,
  573. LPBYTE a_buf,
  574. LPDWORD a_ParmError
  575. );
  576. NET_API_STATUS NET_API_FUNCTION NetServerGetInfo
  577. (
  578. LPTSTR a_servername,
  579. DWORD a_level,
  580. LPBYTE *a_bufptr
  581. );
  582. NET_API_STATUS NET_API_FUNCTION NetGetDCName
  583. ( LPCWSTR a_servername,
  584. LPCWSTR a_domainname,
  585. LPBYTE *a_bufptr
  586. );
  587. NET_API_STATUS NET_API_FUNCTION NetWkstaGetInfo
  588. (
  589. LPWSTR a_servername,
  590. DWORD a_level,
  591. LPBYTE *a_bufptr
  592. );
  593. NET_API_STATUS NET_API_FUNCTION NetGetAnyDCName
  594. (
  595. LPWSTR a_servername,
  596. LPWSTR a_domainname,
  597. LPBYTE *a_bufptr
  598. );
  599. NET_API_STATUS NET_API_FUNCTION NetServerEnum
  600. (
  601. LPTSTR a_servername,
  602. DWORD a_level,
  603. LPBYTE *a_bufptr,
  604. DWORD a_prefmaxlen,
  605. LPDWORD a_entriesread,
  606. LPDWORD a_totalentries,
  607. DWORD a_servertype,
  608. LPTSTR a_domain,
  609. LPDWORD a_resume_handle
  610. );
  611. NET_API_STATUS NET_API_FUNCTION NetUserModalsGet
  612. (
  613. LPWSTR a_servername,
  614. DWORD a_level,
  615. LPBYTE *a_bufptr
  616. );
  617. NET_API_STATUS NET_API_FUNCTION NetScheduleJobAdd
  618. (
  619. LPCWSTR a_Servername,
  620. LPBYTE a_Buffer,
  621. LPDWORD a_JobId
  622. );
  623. NET_API_STATUS NET_API_FUNCTION NetScheduleJobDel
  624. (
  625. LPCWSTR a_Servername,
  626. DWORD a_MinJobId,
  627. DWORD a_MaxJobId
  628. );
  629. NET_API_STATUS NET_API_FUNCTION NetScheduleJobEnum
  630. (
  631. LPCWSTR a_Servername,
  632. LPBYTE *a_PointerToBuffer,
  633. DWORD a_PrefferedMaximumLength,
  634. LPDWORD a_EntriesRead,
  635. LPDWORD a_TotalEntries,
  636. LPDWORD a_ResumeHandle
  637. );
  638. NET_API_STATUS NET_API_FUNCTION NetScheduleJobGetInfo
  639. (
  640. LPCWSTR a_Servername,
  641. DWORD a_JobId,
  642. LPBYTE *a_PointerToBuffer
  643. );
  644. NET_API_STATUS NET_API_FUNCTION NetUseGetInfo
  645. (
  646. LPCWSTR a_UncServerName,
  647. LPCWSTR a_UseName,
  648. DWORD a_Level,
  649. LPBYTE *a_BufPtr
  650. );
  651. // ******* BEGIN: NT 4 and over only *******
  652. bool NET_API_FUNCTION NetEnumerateTrustedDomains
  653. (
  654. LPCWSTR a_servername,
  655. LPWSTR *a_domainNames,
  656. NET_API_STATUS *a_pnasRetval
  657. ) ;
  658. bool NET_API_FUNCTION DsGetDCName
  659. (
  660. LPCTSTR a_ComputerName,
  661. LPCTSTR a_DomainName,
  662. GUID *a_DomainGuid,
  663. LPCTSTR a_SiteName,
  664. ULONG a_Flags,
  665. PDOMAIN_CONTROLLER_INFO *a_DomainControllerInfo,
  666. NET_API_STATUS *a_pnasRetval
  667. );
  668. // ******* END: NT4 and over only ***********
  669. // ******* BEGIN: NT 5 and over only *******
  670. bool NET_API_FUNCTION DSRoleGetPrimaryDomainInformation
  671. (
  672. LPCWSTR a_servername,
  673. DSROLE_PRIMARY_DOMAIN_INFO_LEVEL a_level,
  674. LPBYTE *a_bufptr,
  675. NET_API_STATUS *a_pnasRetval
  676. );
  677. bool NET_API_FUNCTION DSRoleFreeMemory
  678. (
  679. LPBYTE a_bufptr,
  680. NET_API_STATUS *a_pnasRetval
  681. );
  682. bool NET_API_FUNCTION NetRenameMachineInDomain
  683. (
  684. LPCWSTR a_lpServer,
  685. LPCWSTR a_lpNewMachineName,
  686. LPCWSTR a_lpAccount,
  687. LPCWSTR a_lpPassword,
  688. DWORD a_fRenameOptions,
  689. NET_API_STATUS *a_pnasRetval
  690. );
  691. bool NET_API_FUNCTION NetJoinDomain
  692. (
  693. LPCWSTR lpServer,
  694. LPCWSTR lpDomain,
  695. LPCWSTR lpAccountOU,
  696. LPCWSTR lpAccount,
  697. LPCWSTR lpPassword,
  698. DWORD fJoinOptions,
  699. NET_API_STATUS *a_pnasRetval
  700. );
  701. bool NET_API_FUNCTION NetUnjoinDomain(
  702. LPCWSTR lpServer,
  703. LPCWSTR lpAccount,
  704. LPCWSTR lpPassword,
  705. DWORD fUnjoinOptions,
  706. NET_API_STATUS *a_pnasRetval
  707. );
  708. // ******* END: NT5 and over only ***********
  709. };
  710. #endif