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.

544 lines
17 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) 1991-1999 Microsoft Corporation
  3. Module Name:
  4. lmrpl.h
  5. Abstract:
  6. This file contains structures, function prototypes, and definitions
  7. for the Remote (Initial) Program Load service.
  8. Environment:
  9. User Mode - Win32
  10. Portable to any flat, 32-bit environment. (Uses Win32 typedefs.)
  11. Requires ANSI C extensions: slash-slash comments, long external names.
  12. Revision History:
  13. 27-July-1993
  14. Created from NT RPL API spec which was influenced by LM2.1 RPL product,
  15. header files and specs.
  16. --*/
  17. #if _MSC_VER > 1000
  18. #pragma once
  19. #endif
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. #define RPL_MAX_WKSTA_NAME_LENGTH MAX_COMPUTERNAME_LENGTH
  24. #define RPL_MAX_PROFILE_NAME_LENGTH 16
  25. #define RPL_MAX_CONFIG_NAME_LENGTH RPL_MAX_PROFILE_NAME_LENGTH
  26. #define RPL_MAX_BOOT_NAME_LENGTH 12
  27. #define RPL_ADAPTER_NAME_LENGTH 12 // count of hex digits in network id
  28. #define RPL_VENDOR_NAME_LENGTH 6 // leading digits of network id
  29. #define RPL_MAX_STRING_LENGTH 126 // driven by jet < 255 byte limit
  30. //
  31. // Data Structures
  32. //
  33. //
  34. // NetRplGetInfo & NetRplSetInfo
  35. //
  36. //
  37. // Pass these flags in AdapterPolicy to cause these special actions
  38. // to occur. This will not change the adapter policy.
  39. //
  40. #define RPL_REPLACE_RPLDISK 0x80000000
  41. #define RPL_CHECK_SECURITY 0x40000000
  42. #define RPL_CHECK_CONFIGS 0x20000000
  43. #define RPL_CREATE_PROFILES 0x10000000
  44. #define RPL_BACKUP_DATABASE 0x08000000
  45. #define RPL_SPECIAL_ACTIONS \
  46. ( RPL_REPLACE_RPLDISK | \
  47. RPL_CHECK_SECURITY | \
  48. RPL_CHECK_CONFIGS | \
  49. RPL_CREATE_PROFILES | \
  50. RPL_BACKUP_DATABASE )
  51. typedef struct _RPL_INFO_0 {
  52. DWORD Flags;
  53. } RPL_INFO_0, *PRPL_INFO_0, *LPRPL_INFO_0;
  54. //
  55. // NetRplBootEnum & NetRplBootAdd
  56. //
  57. typedef struct _RPL_BOOT_INFO_0 {
  58. LPTSTR BootName;
  59. LPTSTR BootComment;
  60. } RPL_BOOT_INFO_0, *PRPL_BOOT_INFO_0, *LPRPL_BOOT_INFO_0;
  61. //
  62. //
  63. // BOOT_FLAGS_FINAL_ACKNOWLEDGMENT_* describe whether acknowledgment of the
  64. // last remote boot frame will be requested from the client.
  65. //
  66. #define BOOT_FLAGS_FINAL_ACKNOWLEDGMENT_TRUE ((DWORD)0x00000001)
  67. #define BOOT_FLAGS_FINAL_ACKNOWLEDGMENT_FALSE ((DWORD)0x00000002)
  68. #define BOOT_FLAGS_MASK_FINAL_ACKNOWLEDGMENT \
  69. ( BOOT_FLAGS_FINAL_ACKNOWLEDGMENT_TRUE | \
  70. BOOT_FLAGS_FINAL_ACKNOWLEDGMENT_FALSE )
  71. typedef struct _RPL_BOOT_INFO_1 {
  72. LPTSTR BootName;
  73. LPTSTR BootComment;
  74. DWORD Flags;
  75. LPTSTR VendorName;
  76. } RPL_BOOT_INFO_1, *PRPL_BOOT_INFO_1, *LPRPL_BOOT_INFO_1;
  77. typedef struct _RPL_BOOT_INFO_2 {
  78. LPTSTR BootName;
  79. LPTSTR BootComment;
  80. DWORD Flags;
  81. LPTSTR VendorName;
  82. LPTSTR BbcFile;
  83. DWORD WindowSize;
  84. } RPL_BOOT_INFO_2, *PRPL_BOOT_INFO_2, *LPRPL_BOOT_INFO_2;
  85. //
  86. // NetRplConfigEnum & NetRplConfigAdd
  87. //
  88. typedef struct _RPL_CONFIG_INFO_0 {
  89. LPTSTR ConfigName;
  90. LPTSTR ConfigComment;
  91. } RPL_CONFIG_INFO_0, *PRPL_CONFIG_INFO_0, *LPRPL_CONFIG_INFO_0;
  92. //
  93. // CONFIG_FLAGS_ENABLED_* describe whether configuration is enabled (admin
  94. // has copied all the necessary files to use such configuration) or disabled
  95. //
  96. #define CONFIG_FLAGS_ENABLED_TRUE ((DWORD)0x00000001) // enabled
  97. #define CONFIG_FLAGS_ENABLED_FALSE ((DWORD)0x00000002) // disabled
  98. #define CONFIG_FLAGS_MASK_ENABLED \
  99. ( CONFIG_FLAGS_ENABLED_TRUE | \
  100. CONFIG_FLAGS_ENABLED_FALSE )
  101. typedef struct _RPL_CONFIG_INFO_1 {
  102. LPTSTR ConfigName;
  103. LPTSTR ConfigComment;
  104. DWORD Flags;
  105. } RPL_CONFIG_INFO_1, *PRPL_CONFIG_INFO_1, *LPRPL_CONFIG_INFO_1;
  106. typedef struct _RPL_CONFIG_INFO_2 {
  107. LPTSTR ConfigName;
  108. LPTSTR ConfigComment;
  109. DWORD Flags;
  110. LPTSTR BootName;
  111. LPTSTR DirName;
  112. LPTSTR DirName2;
  113. LPTSTR DirName3;
  114. LPTSTR DirName4;
  115. LPTSTR FitShared;
  116. LPTSTR FitPersonal;
  117. } RPL_CONFIG_INFO_2, *PRPL_CONFIG_INFO_2, *LPRPL_CONFIG_INFO_2;
  118. //
  119. // NetRplProfileEnum, NetRplProfileGetInfo, NetRplProfileSetInfo &
  120. // NetRplProfileAdd
  121. //
  122. typedef struct _RPL_PROFILE_INFO_0 {
  123. LPTSTR ProfileName;
  124. LPTSTR ProfileComment;
  125. } RPL_PROFILE_INFO_0, *PRPL_PROFILE_INFO_0, *LPRPL_PROFILE_INFO_0;
  126. typedef struct _RPL_PROFILE_INFO_1 {
  127. LPTSTR ProfileName;
  128. LPTSTR ProfileComment;
  129. DWORD Flags;
  130. } RPL_PROFILE_INFO_1, *PRPL_PROFILE_INFO_1, *LPRPL_PROFILE_INFO_1;
  131. typedef struct _RPL_PROFILE_INFO_2 {
  132. LPTSTR ProfileName;
  133. LPTSTR ProfileComment;
  134. DWORD Flags;
  135. LPTSTR ConfigName;
  136. LPTSTR BootName;
  137. LPTSTR FitShared;
  138. LPTSTR FitPersonal;
  139. } RPL_PROFILE_INFO_2, *PRPL_PROFILE_INFO_2, *LPRPL_PROFILE_INFO_2;
  140. //
  141. // NetRplVendorEnum
  142. //
  143. typedef struct _RPL_VENDOR_INFO_0 {
  144. LPTSTR VendorName;
  145. LPTSTR VendorComment;
  146. } RPL_VENDOR_INFO_0, *PRPL_VENDOR_INFO_0, *LPRPL_VENDOR_INFO_0;
  147. typedef struct _RPL_VENDOR_INFO_1 {
  148. LPTSTR VendorName;
  149. LPTSTR VendorComment;
  150. DWORD Flags;
  151. } RPL_VENDOR_INFO_1, *PRPL_VENDOR_INFO_1, *LPRPL_VENDOR_INFO_1;
  152. //
  153. // NetRplAdapterEnum
  154. //
  155. typedef struct _RPL_ADAPTER_INFO_0 {
  156. LPTSTR AdapterName;
  157. LPTSTR AdapterComment;
  158. } RPL_ADAPTER_INFO_0, *PRPL_ADAPTER_INFO_0, *LPRPL_ADAPTER_INFO_0;
  159. typedef struct _RPL_ADAPTER_INFO_1 {
  160. LPTSTR AdapterName;
  161. LPTSTR AdapterComment;
  162. DWORD Flags;
  163. } RPL_ADAPTER_INFO_1, *PRPL_ADAPTER_INFO_1, *LPRPL_ADAPTER_INFO_1;
  164. //
  165. // NetRplWkstaEnum, NetRplWkstaGetInfo, NetRplWkstaSetInfo &
  166. // NetRplWkstaAdd
  167. //
  168. // WKSTA_FLAGS_LOGON_INPUT_* describe username/password policy during rpl logon
  169. // on the client side. Depending on the value of this field, user input for
  170. // username/password during RPL logon will be:
  171. //
  172. #define WKSTA_FLAGS_LOGON_INPUT_REQUIRED ((DWORD)0x00000001) // L'P', user input is required
  173. #define WKSTA_FLAGS_LOGON_INPUT_OPTIONAL ((DWORD)0x00000002) // L'N', user input is optional
  174. #define WKSTA_FLAGS_LOGON_INPUT_IMPOSSIBLE ((DWORD)0x00000004) // L'D', user input is not solicited
  175. #define WKSTA_FLAGS_MASK_LOGON_INPUT \
  176. ( WKSTA_FLAGS_LOGON_INPUT_REQUIRED | \
  177. WKSTA_FLAGS_LOGON_INPUT_OPTIONAL | \
  178. WKSTA_FLAGS_LOGON_INPUT_IMPOSSIBLE )
  179. //
  180. // WKSTA_FLAGS_SHARING_* describe whether workstation shares or does not share its
  181. // remote boot disk (i.e. "does it have shared or personal profile").
  182. //
  183. #define WKSTA_FLAGS_SHARING_TRUE ((DWORD)0x00000008) // L'S', shares remote boot disk
  184. #define WKSTA_FLAGS_SHARING_FALSE ((DWORD)0x00000010) // L'P', does not share remote boot disk
  185. #define WKSTA_FLAGS_MASK_SHARING \
  186. ( WKSTA_FLAGS_SHARING_TRUE | \
  187. WKSTA_FLAGS_SHARING_FALSE )
  188. //
  189. // WKSTA_FLAGS_DHCP_* describe whether workstation uses DHCP or not. Note
  190. // that these flags are relevant only if TCP/IP itself is enabled (i.e. changes
  191. // to boot block configuration file, config.sys & autoexec.bat have been made).
  192. //
  193. #define WKSTA_FLAGS_DHCP_TRUE ((DWORD)0x00000020) // use DHCP
  194. #define WKSTA_FLAGS_DHCP_FALSE ((DWORD)0x00000040) // do not use DHCP
  195. #define WKSTA_FLAGS_MASK_DHCP \
  196. ( WKSTA_FLAGS_DHCP_TRUE | \
  197. WKSTA_FLAGS_DHCP_FALSE )
  198. //
  199. // WKSTA_FLAGS_DELETE_ACCOUNT_* describes whether the corresponding user
  200. // account was created by Remoteboot Manager, and thus, should be deleted
  201. // when the workstation is deleted. This flag is actually used by
  202. // Remoteboot Manager rather than RPL Service.
  203. //
  204. #define WKSTA_FLAGS_DELETE_TRUE ((DWORD)0x00000080) // delete user acct
  205. #define WKSTA_FLAGS_DELETE_FALSE ((DWORD)0x00000100) // do not delete
  206. #define WKSTA_FLAGS_MASK_DELETE \
  207. ( WKSTA_FLAGS_DELETE_TRUE | \
  208. WKSTA_FLAGS_DELETE_FALSE )
  209. #define WKSTA_FLAGS_MASK \
  210. ( WKSTA_FLAGS_MASK_LOGON_INPUT | \
  211. WKSTA_FLAGS_MASK_SHARING | \
  212. WKSTA_FLAGS_MASK_DHCP | \
  213. WKSTA_FLAGS_MASK_DELETE )
  214. typedef struct _RPL_WKSTA_INFO_0 {
  215. LPTSTR WkstaName;
  216. LPTSTR WkstaComment;
  217. } RPL_WKSTA_INFO_0, *PRPL_WKSTA_INFO_0, *LPRPL_WKSTA_INFO_0;
  218. typedef struct _RPL_WKSTA_INFO_1 {
  219. LPTSTR WkstaName;
  220. LPTSTR WkstaComment;
  221. DWORD Flags;
  222. LPTSTR ProfileName;
  223. } RPL_WKSTA_INFO_1, *PRPL_WKSTA_INFO_1, *LPRPL_WKSTA_INFO_1;
  224. typedef struct _RPL_WKSTA_INFO_2 {
  225. LPTSTR WkstaName;
  226. LPTSTR WkstaComment;
  227. DWORD Flags;
  228. LPTSTR ProfileName;
  229. LPTSTR BootName;
  230. LPTSTR FitFile;
  231. LPTSTR AdapterName;
  232. DWORD TcpIpAddress;
  233. DWORD TcpIpSubnet;
  234. DWORD TcpIpGateway;
  235. } RPL_WKSTA_INFO_2, *PRPL_WKSTA_INFO_2, *LPRPL_WKSTA_INFO_2;
  236. //
  237. // RPL RPC Context Handle (Opaque form).
  238. //
  239. typedef HANDLE RPL_HANDLE;
  240. typedef RPL_HANDLE * PRPL_HANDLE;
  241. typedef PRPL_HANDLE LPRPL_HANDLE;
  242. //
  243. // Function Prototypes
  244. //
  245. //
  246. // Service apis
  247. //
  248. NET_API_STATUS NET_API_FUNCTION
  249. NetRplClose(
  250. IN RPL_HANDLE ServerHandle
  251. );
  252. NET_API_STATUS NET_API_FUNCTION
  253. NetRplGetInfo(
  254. IN RPL_HANDLE ServerHandle,
  255. IN DWORD InfoLevel,
  256. OUT LPBYTE * PointerToBuffer
  257. );
  258. NET_API_STATUS NET_API_FUNCTION
  259. NetRplOpen(
  260. IN LPTSTR ServerName,
  261. OUT LPRPL_HANDLE ServerHandle
  262. );
  263. NET_API_STATUS NET_API_FUNCTION
  264. NetRplSetInfo(
  265. IN RPL_HANDLE ServerHandle,
  266. IN DWORD InfoLevel,
  267. IN LPBYTE Buffer,
  268. OUT LPDWORD ErrorParameter OPTIONAL
  269. );
  270. //
  271. // ADAPTER apis
  272. //
  273. NET_API_STATUS NET_API_FUNCTION
  274. NetRplAdapterAdd(
  275. IN RPL_HANDLE ServerHandle,
  276. IN DWORD InfoLevel,
  277. IN LPBYTE Buffer,
  278. OUT LPDWORD ErrorParameter OPTIONAL
  279. );
  280. //
  281. // NetRplAdapterDel: if AdapterName is NULL then all adapters will be deleted.
  282. //
  283. NET_API_STATUS NET_API_FUNCTION
  284. NetRplAdapterDel(
  285. IN RPL_HANDLE ServerHandle,
  286. IN LPTSTR AdapterName OPTIONAL
  287. );
  288. NET_API_STATUS NET_API_FUNCTION
  289. NetRplAdapterEnum(
  290. IN RPL_HANDLE ServerHandle,
  291. IN DWORD InfoLevel,
  292. OUT LPBYTE * PointerToBuffer,
  293. IN DWORD PrefMaxLength,
  294. OUT LPDWORD EntriesRead,
  295. OUT LPDWORD TotalEntries,
  296. OUT LPDWORD ResumeHandle
  297. );
  298. //
  299. // BOOT block apis
  300. //
  301. NET_API_STATUS NET_API_FUNCTION
  302. NetRplBootAdd(
  303. IN RPL_HANDLE ServerHandle,
  304. IN DWORD InfoLevel,
  305. IN LPBYTE Buffer,
  306. OUT LPDWORD ErrorParameter OPTIONAL
  307. );
  308. NET_API_STATUS NET_API_FUNCTION
  309. NetRplBootDel(
  310. IN RPL_HANDLE ServerHandle,
  311. IN LPTSTR BootName,
  312. IN LPTSTR VendorName
  313. );
  314. NET_API_STATUS NET_API_FUNCTION
  315. NetRplBootEnum(
  316. IN RPL_HANDLE ServerHandle,
  317. IN DWORD InfoLevel,
  318. OUT LPBYTE * PointerToBuffer,
  319. IN DWORD PrefMaxLength,
  320. OUT LPDWORD EntriesRead,
  321. OUT LPDWORD TotalEntries,
  322. OUT LPDWORD ResumeHandle
  323. );
  324. //
  325. // CONFIG apis
  326. //
  327. NET_API_STATUS NET_API_FUNCTION
  328. NetRplConfigAdd(
  329. IN RPL_HANDLE ServerHandle,
  330. IN DWORD InfoLevel,
  331. IN LPBYTE Buffer,
  332. OUT LPDWORD ErrorParameter OPTIONAL
  333. );
  334. NET_API_STATUS NET_API_FUNCTION
  335. NetRplConfigDel(
  336. IN RPL_HANDLE ServerHandle,
  337. IN LPTSTR ConfigName
  338. );
  339. NET_API_STATUS NET_API_FUNCTION
  340. NetRplConfigEnum(
  341. IN RPL_HANDLE ServerHandle,
  342. IN LPTSTR AdapterName,
  343. IN DWORD InfoLevel,
  344. OUT LPBYTE * PointerToBuffer,
  345. IN DWORD PrefMaxLength,
  346. OUT LPDWORD EntriesRead,
  347. OUT LPDWORD TotalEntries,
  348. OUT LPDWORD ResumeHandle
  349. );
  350. //
  351. // PROFILE apis
  352. //
  353. NET_API_STATUS NET_API_FUNCTION
  354. NetRplProfileAdd(
  355. IN RPL_HANDLE ServerHandle,
  356. IN DWORD InfoLevel,
  357. IN LPBYTE Buffer,
  358. OUT LPDWORD ErrorParameter OPTIONAL
  359. );
  360. NET_API_STATUS NET_API_FUNCTION
  361. NetRplProfileClone(
  362. IN RPL_HANDLE ServerHandle,
  363. IN LPTSTR SourceProfileName,
  364. IN LPTSTR TargetProfileName,
  365. IN LPTSTR TargetProfileComment OPTIONAL
  366. );
  367. NET_API_STATUS NET_API_FUNCTION
  368. NetRplProfileDel(
  369. IN RPL_HANDLE ServerHandle,
  370. IN LPTSTR ProfileName
  371. );
  372. NET_API_STATUS NET_API_FUNCTION
  373. NetRplProfileEnum(
  374. IN RPL_HANDLE ServerHandle,
  375. IN LPTSTR AdapterName,
  376. IN DWORD InfoLevel,
  377. OUT LPBYTE * PointerToBuffer,
  378. IN DWORD PrefMaxLength,
  379. OUT LPDWORD EntriesRead,
  380. OUT LPDWORD TotalEntries,
  381. OUT LPDWORD ResumeHandle
  382. );
  383. NET_API_STATUS NET_API_FUNCTION
  384. NetRplProfileGetInfo(
  385. IN RPL_HANDLE ServerHandle,
  386. IN LPTSTR ProfileName,
  387. IN DWORD InfoLevel,
  388. OUT LPBYTE * PointerToBuffer
  389. );
  390. NET_API_STATUS NET_API_FUNCTION
  391. NetRplProfileSetInfo(
  392. IN RPL_HANDLE ServerHandle,
  393. IN LPTSTR ProfileName,
  394. IN DWORD InfoLevel,
  395. IN LPBYTE Buffer,
  396. OUT LPDWORD ErrorParameter OPTIONAL
  397. );
  398. //
  399. // VENDOR apis
  400. //
  401. NET_API_STATUS NET_API_FUNCTION
  402. NetRplVendorAdd(
  403. IN RPL_HANDLE ServerHandle,
  404. IN DWORD InfoLevel,
  405. IN LPBYTE Buffer,
  406. OUT LPDWORD ErrorParameter OPTIONAL
  407. );
  408. NET_API_STATUS NET_API_FUNCTION
  409. NetRplVendorDel(
  410. IN RPL_HANDLE ServerHandle,
  411. IN LPTSTR VendorName
  412. );
  413. NET_API_STATUS NET_API_FUNCTION
  414. NetRplVendorEnum(
  415. IN RPL_HANDLE ServerHandle,
  416. IN DWORD InfoLevel,
  417. OUT LPBYTE * PointerToBuffer,
  418. IN DWORD PrefMaxLength,
  419. OUT LPDWORD EntriesRead,
  420. OUT LPDWORD TotalEntries,
  421. OUT LPDWORD ResumeHandle
  422. );
  423. //
  424. // WKSTA apis
  425. //
  426. NET_API_STATUS NET_API_FUNCTION
  427. NetRplWkstaAdd(
  428. IN RPL_HANDLE ServerHandle,
  429. IN DWORD InfoLevel,
  430. IN LPBYTE Buffer,
  431. OUT LPDWORD ErrorParameter OPTIONAL
  432. );
  433. NET_API_STATUS NET_API_FUNCTION
  434. NetRplWkstaClone(
  435. IN RPL_HANDLE ServerHandle,
  436. IN LPTSTR SourceWkstaName,
  437. IN LPTSTR TargetWkstaName,
  438. IN LPTSTR TargetWkstaComment OPTIONAL,
  439. IN LPTSTR TargetAdapterName,
  440. IN DWORD TargetWkstaIpAddress
  441. );
  442. NET_API_STATUS NET_API_FUNCTION
  443. NetRplWkstaDel(
  444. IN RPL_HANDLE ServerHandle,
  445. IN LPTSTR WkstaName
  446. );
  447. NET_API_STATUS NET_API_FUNCTION
  448. NetRplWkstaEnum(
  449. IN RPL_HANDLE ServerHandle,
  450. IN LPTSTR ProfileName,
  451. IN DWORD InfoLevel,
  452. OUT LPBYTE * PointerToBuffer,
  453. IN DWORD PrefMaxLength,
  454. OUT LPDWORD EntriesRead,
  455. OUT LPDWORD TotalEntries,
  456. OUT LPDWORD ResumeHandle
  457. );
  458. NET_API_STATUS NET_API_FUNCTION
  459. NetRplWkstaGetInfo(
  460. IN RPL_HANDLE ServerHandle,
  461. IN LPTSTR WkstaName,
  462. IN DWORD InfoLevel,
  463. OUT LPBYTE * Buffer
  464. );
  465. NET_API_STATUS NET_API_FUNCTION
  466. NetRplWkstaSetInfo(
  467. IN RPL_HANDLE ServerHandle,
  468. IN LPTSTR WkstaName,
  469. IN DWORD InfoLevel,
  470. IN LPBYTE Buffer,
  471. OUT LPDWORD ErrorParameter OPTIONAL
  472. );
  473. //
  474. // SECURITY api
  475. //
  476. NET_API_STATUS NET_API_FUNCTION
  477. NetRplSetSecurity(
  478. IN RPL_HANDLE ServerHandle,
  479. IN LPTSTR WkstaName OPTIONAL,
  480. IN DWORD WkstaRid,
  481. IN DWORD RplUserRid
  482. );
  483. #ifdef __cplusplus
  484. }
  485. #endif