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.

557 lines
11 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. miglib.h
  5. Abstract:
  6. Public Header file for Miglib functionality.
  7. Author:
  8. Marc R. Whitten (marcw) 07-Mar-2000
  9. Revision History:
  10. <alias> <date> <comments>
  11. --*/
  12. //
  13. // Includes
  14. //
  15. #include "plugin.h"
  16. #define DBG_FOO "Foo"
  17. //
  18. // Strings
  19. //
  20. // None
  21. //
  22. // Constants
  23. //
  24. #define GATHERMODE TRUE
  25. #define APPLYMODE FALSE
  26. #define SOURCEOS_WIN9X TRUE
  27. #define SOURCEOS_WINNT FALSE
  28. // None
  29. //
  30. // Macros
  31. //
  32. #define S_REGKEY_MIGRATION_DLLS_WINNT TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Setup\\NT Migration DLLs")
  33. #define MIGDLLEXPORT __declspec(dllexport)
  34. //
  35. // Types
  36. //
  37. #define DLLLIST PVOID
  38. typedef struct {
  39. SIZE_T Size;
  40. PCSTR StaticProductIdentifier;
  41. UINT DllVersion;
  42. PINT CodePageArray;
  43. UINT SourceOs;
  44. UINT TargetOs;
  45. PCSTR * NeededFileList;
  46. PVENDORINFO VendorInfo;
  47. } MIGRATIONINFOA, *PMIGRATIONINFOA;
  48. typedef struct {
  49. SIZE_T Size;
  50. PCWSTR StaticProductIdentifier;
  51. UINT DllVersion;
  52. PINT CodePageArray;
  53. UINT SourceOs;
  54. UINT TargetOs;
  55. PCWSTR * NeededFileList;
  56. PVENDORINFO VendorInfo;
  57. } MIGRATIONINFOW, *PMIGRATIONINFOW;
  58. typedef struct {
  59. CHAR WorkingDirectory[MAX_PATH];
  60. CHAR SourceMedia[MAX_PATH];
  61. CHAR DllPath[MAX_PATH];
  62. MIGRATIONINFOA Info;
  63. } MIGDLLPROPERTIESA, *PMIGDLLPROPERTIESA;
  64. typedef struct {
  65. WCHAR WorkingDirectory[MAX_PATH];
  66. WCHAR SourceMedia[MAX_PATH];
  67. WCHAR DllPath[MAX_PATH];
  68. MIGRATIONINFOW Info;
  69. } MIGDLLPROPERTIESW, *PMIGDLLPROPERTIESW;
  70. typedef struct {
  71. BOOL Isolated;
  72. BOOL MigrationMode;
  73. BOOL SourceOs;
  74. BOOL SrcUnicode;
  75. BOOL OldStyle;
  76. HANDLE Library;
  77. MIGDLLPROPERTIESA Properties;
  78. } MIGRATIONDLLA, *PMIGRATIONDLLA;
  79. typedef struct {
  80. BOOL Isolated;
  81. BOOL MigrationMode;
  82. BOOL SourceOs;
  83. BOOL SrcUnicode;
  84. BOOL OldStyle;
  85. HANDLE Library;
  86. MIGDLLPROPERTIESW Properties;
  87. } MIGRATIONDLLW, *PMIGRATIONDLLW;
  88. typedef struct {
  89. PMIGDLLPROPERTIESA Properties;
  90. INT NextItem;
  91. DLLLIST List;
  92. } MIGDLLENUMA, *PMIGDLLENUMA;
  93. typedef struct {
  94. PMIGDLLPROPERTIESW Properties;
  95. INT NextItem;
  96. DLLLIST List;
  97. } MIGDLLENUMW, *PMIGDLLENUMW;
  98. typedef enum {
  99. OS_WINDOWS9X = 0,
  100. OS_WINDOWSNT4X = 1,
  101. OS_WINDOWS2000 = 2,
  102. OS_WINDOWSWHISTLER = 3
  103. } OS_TYPES, *POS_TYPES;
  104. typedef BOOL (* MIGDLLINIT) (VOID);
  105. typedef VOID (* MIGDLLSHUTDOWN) (VOID);
  106. typedef VOID (* MIGDLLCLOSEW) (PMIGRATIONDLLW);
  107. typedef BOOL (* MIGDLLGATHERSYSTEMSETTINGSW) (PMIGRATIONDLLW, PCWSTR, PVOID, DWORD);
  108. typedef BOOL (* MIGDLLINITIALIZESRCW) (PMIGRATIONDLLW, PCWSTR, PCWSTR, PCWSTR, PVOID, DWORD);
  109. typedef BOOL (* MIGDLLOPENW) (PMIGRATIONDLLW, PCWSTR, BOOL, BOOL, BOOL);
  110. typedef VOID (* MIGDLLFREELIST) (DLLLIST);
  111. typedef BOOL (* MIGDLLENUMNEXTW) (PMIGDLLENUMW);
  112. typedef BOOL (* MIGDLLENUMFIRSTW) (DLLLIST, PMIGDLLENUMW);
  113. typedef BOOL (* MIGDLLREMOVEDLLINENUMFROMLISTW) (DLLLIST, PMIGDLLENUMW);
  114. typedef BOOL (* MIGDLLADDDLLTOLISTW) (DLLLIST, PMIGRATIONDLLW);
  115. typedef BOOL (* MIGDLLREMOVEDLLFROMLISTW) (DLLLIST, PCWSTR);
  116. typedef PMIGDLLPROPERTIESW (* MIGDLLFINDDLLINLISTW) (DLLLIST, PCWSTR);
  117. typedef BOOL (* MIGDLLQUERYMIGRATIONINFOW) (PMIGRATIONDLLW, PCWSTR, PMIGRATIONINFOW);
  118. typedef DLLLIST (* MIGDLLCREATELIST) (VOID);
  119. typedef BOOL (* MIGDLLAPPLYSYSTEMSETTINGSW) (PMIGRATIONDLLW, PCWSTR, PCWSTR, PVOID, DWORD);
  120. typedef BOOL (* MIGDLLINITIALIZEDSTW) (PMIGRATIONDLLW, PCWSTR, PCWSTR, PVOID, DWORD);
  121. typedef BOOL (* MIGDLLMOVEDLLLOCALLYW) (PMIGRATIONDLLW, PCWSTR);
  122. //
  123. // Globals
  124. //
  125. // None
  126. //
  127. // Macro expansion list
  128. //
  129. // None
  130. //
  131. // Public function prototypes
  132. //
  133. BOOL
  134. MigDllQueryMigrationInfoA (
  135. IN PMIGRATIONDLLA DllData,
  136. IN PCSTR WorkingDirectory,
  137. OUT PMIGRATIONINFOA * MigInfo
  138. );
  139. BOOL
  140. MigDllQueryMigrationInfoW (
  141. IN PMIGRATIONDLLW DllData,
  142. IN PCWSTR WorkingDirectory,
  143. OUT PMIGRATIONINFOW * MigInfo
  144. );
  145. BOOL
  146. MigDllApplySystemSettingsW (
  147. IN PMIGRATIONDLLW DllData,
  148. IN PCWSTR WorkingDirectory,
  149. IN PCWSTR AnswerFile,
  150. IN PVOID Reserved,
  151. IN DWORD ReservedSize
  152. );
  153. BOOL
  154. MigDllApplySystemSettingsA (
  155. IN PMIGRATIONDLLA DllData,
  156. IN PCSTR WorkingDirectory,
  157. IN PCSTR AnswerFile,
  158. IN PVOID Reserved,
  159. IN DWORD ReservedSize
  160. );
  161. BOOL
  162. MigDllApplyUserSettingsW (
  163. IN PMIGRATIONDLLW DllData,
  164. IN PCWSTR WorkingDir,
  165. IN PCWSTR UserKey,
  166. IN PCWSTR UserName,
  167. IN PCWSTR UserDomain,
  168. IN PCWSTR FixedUserName,
  169. IN PCWSTR UnattendTxt,
  170. IN PCWSTR UserProfilePath,
  171. IN OUT PVOID Reserved,
  172. IN DWORD ReservedSize
  173. );
  174. BOOL
  175. MigDllApplyUserSettingsA (
  176. IN PMIGRATIONDLLA DllData,
  177. IN PCSTR WorkingDir,
  178. IN PCSTR UserKey,
  179. IN PCSTR UserName,
  180. IN PCSTR UserDomain,
  181. IN PCSTR FixedUserName,
  182. IN PCSTR UnattendTxt,
  183. IN PCSTR UserProfilePath,
  184. IN OUT PVOID Reserved,
  185. IN DWORD ReservedSize
  186. );
  187. BOOL
  188. MigDllInitializeDstW (
  189. IN PMIGRATIONDLLW DllData,
  190. IN PCWSTR WorkingDir,
  191. IN PCWSTR SourceList,
  192. IN OUT PVOID Reserved,
  193. IN DWORD ReservedSize
  194. );
  195. BOOL
  196. MigDllInitializeDstA (
  197. IN PMIGRATIONDLLA DllData,
  198. IN PCSTR WorkingDir,
  199. IN PCSTR SourceList,
  200. IN OUT PVOID Reserved,
  201. IN DWORD ReservedSize
  202. );
  203. BOOL
  204. MigDllGatherSystemSettingsA (
  205. IN PMIGRATIONDLLA DllData,
  206. IN PCSTR AnswerFile,
  207. IN PVOID Reserved,
  208. IN DWORD ReservedSize
  209. );
  210. BOOL
  211. MigDllGatherSystemSettingsW (
  212. IN PMIGRATIONDLLW DllData,
  213. IN PCWSTR AnswerFile,
  214. IN PVOID Reserved,
  215. IN DWORD ReservedSize
  216. );
  217. BOOL
  218. MigDllGatherUserSettingsA (
  219. IN PMIGRATIONDLLA DllData,
  220. IN PCSTR UserKey,
  221. IN PCSTR UserName,
  222. IN PCSTR UnattendTxt,
  223. IN OUT PVOID Reserved,
  224. IN DWORD ReservedSize
  225. );
  226. BOOL
  227. MigDllGatherUserSettingsW (
  228. IN PMIGRATIONDLLW DllData,
  229. IN PCWSTR UserKey,
  230. IN PCWSTR UserName,
  231. IN PCWSTR UnattendTxt,
  232. IN OUT PVOID Reserved,
  233. IN DWORD ReservedSize
  234. );
  235. BOOL
  236. MigDllInitializeSrcA (
  237. IN PMIGRATIONDLLA DllData,
  238. IN PCSTR WorkingDir,
  239. IN PCSTR NativeSource,
  240. IN PCSTR MediaDir,
  241. IN OUT PVOID Reserved,
  242. IN DWORD ReservedSize
  243. );
  244. BOOL
  245. MigDllInitializeSrcW (
  246. IN PMIGRATIONDLLW DllData,
  247. IN PCWSTR WorkingDir,
  248. IN PCWSTR NativeSource,
  249. IN PCWSTR MediaDir,
  250. IN OUT PVOID Reserved,
  251. IN DWORD ReservedSize
  252. );
  253. BOOL
  254. MigDllOpenA (
  255. OUT PMIGRATIONDLLA DllData,
  256. IN PCSTR DllPath,
  257. IN BOOL MigrationMode,
  258. IN BOOL Isolated,
  259. IN BOOL SourceOs
  260. );
  261. BOOL
  262. MigDllOpenW (
  263. OUT PMIGRATIONDLLW DllData,
  264. IN PCWSTR DllPath,
  265. IN BOOL MigrationMode,
  266. IN BOOL Isolated,
  267. IN BOOL SourceOs
  268. );
  269. VOID
  270. MigDllCloseA (
  271. IN OUT PMIGRATIONDLLA DllData
  272. );
  273. VOID
  274. MigDllCloseW (
  275. IN OUT PMIGRATIONDLLW DllData
  276. );
  277. DLLLIST
  278. MigDllCreateList (
  279. VOID
  280. );
  281. VOID
  282. MigDllFreeList (
  283. DLLLIST List
  284. );
  285. BOOL
  286. MigDllAddDllToListA (
  287. IN DLLLIST List,
  288. IN PMIGRATIONDLLA MigrationDll
  289. );
  290. BOOL
  291. MigDllAddDllToListW (
  292. IN DLLLIST List,
  293. IN PMIGRATIONDLLW MigrationDll
  294. );
  295. BOOL
  296. MigDllRemoveDllFromListA (
  297. IN DLLLIST List,
  298. IN PCSTR ProductId
  299. );
  300. BOOL
  301. MigDllRemoveDllFromListW (
  302. IN DLLLIST List,
  303. IN PCWSTR ProductId
  304. );
  305. INT
  306. MigDllGetDllCountInList (
  307. IN DLLLIST List
  308. );
  309. PMIGDLLPROPERTIESA
  310. MigDllFindDllInListA (
  311. IN DLLLIST List,
  312. IN PCSTR ProductId
  313. );
  314. PMIGDLLPROPERTIESW
  315. MigDllFindDllInListW (
  316. IN DLLLIST List,
  317. IN PCWSTR ProductId
  318. );
  319. BOOL
  320. MigDllEnumNextA (
  321. IN OUT PMIGDLLENUMA Enum
  322. );
  323. BOOL
  324. MigDllEnumFirstA (
  325. OUT PMIGDLLENUMA Enum,
  326. IN DLLLIST List
  327. );
  328. BOOL
  329. MigDllRemoveDllInEnumFromListA (
  330. IN DLLLIST List,
  331. IN PMIGDLLENUMA Enum
  332. );
  333. BOOL
  334. MigDllEnumNextW (
  335. IN OUT PMIGDLLENUMW Enum
  336. );
  337. BOOL
  338. MigDllEnumFirstW (
  339. OUT PMIGDLLENUMW Enum,
  340. IN DLLLIST List
  341. );
  342. BOOL
  343. MigDllRemoveDllInEnumFromListW (
  344. IN DLLLIST List,
  345. IN PMIGDLLENUMW Enum
  346. );
  347. VOID
  348. MigDllSetMigIsolPathA (
  349. IN PCSTR Path
  350. );
  351. VOID
  352. MigDllSetMigIsolPathW (
  353. IN PCWSTR Path
  354. );
  355. BOOL
  356. MigDllMoveDllLocallyW (
  357. IN PMIGRATIONDLLW Dll,
  358. IN PCWSTR WorkingDirectory
  359. );
  360. BOOL
  361. MigDllInit (
  362. VOID
  363. );
  364. VOID
  365. MigDllShutdown (
  366. VOID
  367. );
  368. //
  369. // Macro expansion definition
  370. //
  371. // None
  372. //
  373. // ANSI/UNICODE macros
  374. //
  375. #ifdef UNICODE
  376. //UNICODE
  377. #define MigDllQueryMigrationInfo MigDllQueryMigrationInfoW
  378. #define MigDllApplySystemSettings MigDllApplySystemSettingsW
  379. #define MigDllApplyUserSettings MigDllApplyUserSettingsW
  380. #define MigDllInitializeDst MigDllInitializeDstW
  381. #define MigDllGatherSystemSettings MigDllGatherSystemSettingsW
  382. #define MigDllGatherUserSettings MigDllGatherUserSettingsW
  383. #define MigDllInitializeSrc MigDllInitializeSrcW
  384. #define MigDllOpen MigDllOpenW
  385. #define MigDllClose MigDllCloseW
  386. #define MigDllAddDllToList MigDllAddDllToListW
  387. #define MigDllRemoveDllFromList MigDllRemoveDllFromListW
  388. #define MigDllFindDllInList MigDllFindDllInListW
  389. #define MigDllEnumNext MigDllEnumNextW
  390. #define MigDllEnumFirst MigDllEnumFirstW
  391. #define MigDllRemoveDllInEnumFromList MigDllRemoveDllInEnumFromListW
  392. #define MigDllSetMigIsolPath MigDllSetMigIsolPathW
  393. #define MigDllMoveDllLocally MigDllMoveDllLocallyW
  394. #define MIGRATIONINFO MIGRATIONINFOW
  395. #define PMIGRATIONINFO PMIGRATIONINFOW
  396. #define MIGDLLPROPERTIES MIGDLLPROPERTIESW
  397. #define PMIGDLLPROPERTIES PMIGDLLPROPERTIESW
  398. #define MIGRATIONDLL MIGRATIONDLLW
  399. #define PMIGRATIONDLL PMIGRATIONDLLW
  400. #define MIGDLLENUM MIGDLLENUMW
  401. #define PMIGDLLENUM PMIGDLLENUMW
  402. #else
  403. //ANSI
  404. #define MigDllQueryMigrationInfo MigDllQueryMigrationInfoA
  405. #define MigDllApplySystemSettings MigDllApplySystemSettingsA
  406. #define MigDllApplyUserSettings MigDllApplyUserSettingsA
  407. #define MigDllInitializeDst MigDllInitializeDstA
  408. #define MigDllGatherSystemSettings MigDllGatherSystemSettingsA
  409. #define MigDllGatherUserSettings MigDllGatherUserSettingsA
  410. #define MigDllInitializeSrc MigDllInitializeSrcA
  411. #define MigDllOpen MigDllOpenA
  412. #define MigDllClose MigDllCloseA
  413. #define MigDllAddDllToList MigDllAddDllToListA
  414. #define MigDllRemoveDllFromList MigDllRemoveDllFromListA
  415. #define MigDllFindDllInList MigDllFindDllInListA
  416. #define MigDllEnumNext MigDllEnumNextA
  417. #define MigDllEnumFirst MigDllEnumFirstA
  418. #define MigDllRemoveDllInEnumFromList MigDllRemoveDllInEnumFromListA
  419. #define MigDllSetMigIsolPath MigDllSetMigIsolPathA
  420. #define MIGRATIONINFO MIGRATIONINFOA
  421. #define PMIGRATIONINFO PMIGRATIONINFOA
  422. #define MIGDLLPROPERTIES MIGDLLPROPERTIESA
  423. #define PMIGDLLPROPERTIES PMIGDLLPROPERTIESA
  424. #define MIGRATIONDLL MIGRATIONDLLA
  425. #define PMIGRATIONDLL PMIGRATIONDLLA
  426. #define MIGDLLENUM MIGDLLENUMA
  427. #define PMIGDLLENUM PMIGDLLENUMA
  428. #endif