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.

758 lines
20 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. migrate.c
  5. Abstract:
  6. This source file implements the seven required functions for a
  7. Windows NT 5.0 migration DLL. This main file calls each registered
  8. source file.
  9. Author:
  10. Jim Schmidt (jimschm) 02-Apr-1998
  11. Revision History:
  12. --*/
  13. #include "pch.h"
  14. #include "setupmigp.h"
  15. VENDORINFO g_VendorInfo = {"", "", "", ""};
  16. CHAR g_ProductId [MAX_PATH];
  17. PCSTR g_MigrateInfPath = NULL;
  18. HINF g_MigrateInf = INVALID_HANDLE_VALUE;
  19. HANDLE g_hHeap;
  20. HINSTANCE g_hInst;
  21. POOLHANDLE g_GlobalPool;
  22. HWND g_ParentWnd;
  23. TCHAR g_DllDir[MAX_TCHAR_PATH];
  24. #define D_DLLVERSION 1
  25. /*++
  26. Macro Expansion Lists Description:
  27. The following list represents all the entries that the migrations DLL calls within setup.
  28. We recommend that each separate item that is fixed using this migration DLL to be implemented
  29. in a separate source file. Each entry having the name XXX needs to implement this functions:
  30. XXX_QueryVersion
  31. XXX_Initialize9x
  32. XXX_MigrateUser9x
  33. XXX_MigrateSystem9x
  34. XXX_InitializeNT
  35. XXX_MigrateUserNT
  36. XXX_MigrateSystemNT
  37. Line Syntax:
  38. DEFMAC(EntryName)
  39. Arguments:
  40. EntryName - This is the name that you give to a separate item implemented in this migration DLL.
  41. Each entry is very much like a complete migration DLL except for initializing routines.
  42. Variables Generated From List:
  43. g_MigrationEntries
  44. --*/
  45. #define MIGRATION_DLL_ENTRIES \
  46. DEFMAC(KodakImagingPro) \
  47. DEFMAC(Office) \
  48. DEFMAC(PhotoSuiteII) \
  49. DEFMAC(CorelDRAW8) \
  50. DEFMAC(WinMine) \
  51. DEFMAC(SymantecWinFax) \
  52. /*
  53. // It looks like this is not needed any more.
  54. // However, I will let this here just in case.
  55. DEFMAC(CreativeWriter2) \
  56. // This is no longer needed either, desk.cpl supports themes
  57. DEFMAC(Plus95) \
  58. */
  59. //
  60. // Implementation
  61. //
  62. typedef BOOL (ATTACH_PROTOTYPE) (HINSTANCE DllInstance);
  63. typedef ATTACH_PROTOTYPE *PATTACH_PROTOTYPE;
  64. typedef BOOL (DETACH_PROTOTYPE) (HINSTANCE DllInstance);
  65. typedef DETACH_PROTOTYPE *PDETACH_PROTOTYPE;
  66. typedef LONG (QUERYVERSION_PROTOTYPE) (PCSTR *ExeNamesBuf);
  67. typedef QUERYVERSION_PROTOTYPE *PQUERYVERSION_PROTOTYPE;
  68. typedef LONG (INITIALIZE9X_PROTOTYPE) (PCSTR WorkingDirectory, PCSTR SourceDirectories);
  69. typedef INITIALIZE9X_PROTOTYPE *PINITIALIZE9X_PROTOTYPE;
  70. typedef LONG (MIGRATEUSER9X_PROTOTYPE) (HWND ParentWnd, PCSTR UnattendFile, HKEY UserRegKey, PCSTR UserName);
  71. typedef MIGRATEUSER9X_PROTOTYPE *PMIGRATEUSER9X_PROTOTYPE;
  72. typedef LONG (MIGRATESYSTEM9X_PROTOTYPE) (HWND ParentWnd, PCSTR UnattendFile);
  73. typedef MIGRATESYSTEM9X_PROTOTYPE *PMIGRATESYSTEM9X_PROTOTYPE;
  74. typedef LONG (INITIALIZENT_PROTOTYPE) (PCWSTR WorkingDirectory, PCWSTR SourceDirectories);
  75. typedef INITIALIZENT_PROTOTYPE *PINITIALIZENT_PROTOTYPE;
  76. typedef LONG (MIGRATEUSERNT_PROTOTYPE) (HINF UnattendInfHandle, HKEY UserRegKey, PCWSTR UserName);
  77. typedef MIGRATEUSERNT_PROTOTYPE *PMIGRATEUSERNT_PROTOTYPE;
  78. typedef LONG (MIGRATESYSTEMNT_PROTOTYPE) (HINF UnattendInfHandle);
  79. typedef MIGRATESYSTEMNT_PROTOTYPE *PMIGRATESYSTEMNT_PROTOTYPE;
  80. typedef struct {
  81. PSTR Name;
  82. PATTACH_PROTOTYPE pAttach;
  83. PDETACH_PROTOTYPE pDetach;
  84. PQUERYVERSION_PROTOTYPE pQueryVersion;
  85. PINITIALIZE9X_PROTOTYPE pInitialize9x;
  86. PMIGRATEUSER9X_PROTOTYPE pMigrateUser9x;
  87. PMIGRATESYSTEM9X_PROTOTYPE pMigrateSystem9x;
  88. PINITIALIZENT_PROTOTYPE pInitializeNT;
  89. PMIGRATEUSERNT_PROTOTYPE pMigrateUserNT;
  90. PMIGRATESYSTEMNT_PROTOTYPE pMigrateSystemNT;
  91. DWORD Active;
  92. DWORD WantToRunOnNt;
  93. } MIGRATION_ENTRY, *PMIGRATION_ENTRY;
  94. #define DEFMAC(fn) ATTACH_PROTOTYPE fn##_Attach; \
  95. DETACH_PROTOTYPE fn##_Detach; \
  96. QUERYVERSION_PROTOTYPE fn##_QueryVersion; \
  97. INITIALIZE9X_PROTOTYPE fn##_Initialize9x; \
  98. MIGRATEUSER9X_PROTOTYPE fn##_MigrateUser9x; \
  99. MIGRATESYSTEM9X_PROTOTYPE fn##_MigrateSystem9x; \
  100. INITIALIZENT_PROTOTYPE fn##_InitializeNT; \
  101. MIGRATEUSERNT_PROTOTYPE fn##_MigrateUserNT; \
  102. MIGRATESYSTEMNT_PROTOTYPE fn##_MigrateSystemNT;
  103. MIGRATION_DLL_ENTRIES
  104. #undef DEFMAC
  105. #define DEFMAC(fn) {#fn, \
  106. fn##_Attach, \
  107. fn##_Detach, \
  108. fn##_QueryVersion, \
  109. fn##_Initialize9x, \
  110. fn##_MigrateUser9x, \
  111. fn##_MigrateSystem9x, \
  112. fn##_InitializeNT, \
  113. fn##_MigrateUserNT, \
  114. fn##_MigrateSystemNT, \
  115. 1, \
  116. 0 \
  117. },
  118. static MIGRATION_ENTRY g_MigrationEntries[] = {
  119. MIGRATION_DLL_ENTRIES
  120. {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0}
  121. };
  122. #undef DEFMAC
  123. #define MEMDB_CATEGORY_DLLENTRIES "MigDllEntries"
  124. #define S_ACTIVE "Active"
  125. #define DBG_MIGDLL "SMIGDLL"
  126. GROWBUFFER g_FilesBuff = GROWBUF_INIT;
  127. PCSTR g_WorkingDir = NULL;
  128. typedef BOOL (WINAPI INITROUTINE_PROTOTYPE)(HINSTANCE, DWORD, LPVOID);
  129. INITROUTINE_PROTOTYPE MigUtil_Entry;
  130. INITROUTINE_PROTOTYPE MemDb_Entry;
  131. BOOL
  132. WINAPI
  133. DllMain (
  134. IN HINSTANCE DllInstance,
  135. IN ULONG ReasonForCall,
  136. IN LPVOID Reserved
  137. )
  138. {
  139. PSTR p;
  140. PMIGRATION_ENTRY m;
  141. BOOL entryResult;
  142. BOOL result = TRUE;
  143. switch (ReasonForCall) {
  144. case DLL_PROCESS_ATTACH:
  145. //
  146. // We don't need DLL_THREAD_ATTACH or DLL_THREAD_DETACH messages
  147. //
  148. DisableThreadLibraryCalls (DllInstance);
  149. //
  150. // Global init
  151. //
  152. g_hHeap = GetProcessHeap();
  153. g_hInst = DllInstance;
  154. //
  155. // Init common controls
  156. //
  157. InitCommonControls();
  158. //
  159. // Get DLL path and strip directory
  160. //
  161. GetModuleFileNameA (DllInstance, g_DllDir, MAX_TCHAR_PATH);
  162. p = _mbsrchr (g_DllDir, '\\');
  163. MYASSERT (p);
  164. if (p) {
  165. *p = 0;
  166. }
  167. if (!MigUtil_Entry (DllInstance, DLL_PROCESS_ATTACH, NULL)) {
  168. return FALSE;
  169. }
  170. LogReInit (NULL, NULL);
  171. if (!MemDb_Entry (DllInstance, DLL_PROCESS_ATTACH, NULL)) {
  172. return FALSE;
  173. }
  174. //
  175. // Allocate a global pool
  176. //
  177. g_GlobalPool = PoolMemInitNamedPool ("Global Pool");
  178. m = g_MigrationEntries;
  179. while (m->pAttach) {
  180. DEBUGMSGA ((DBG_MIGDLL, "Attach calling: %s", m->Name));
  181. entryResult = m->pAttach (DllInstance);
  182. if (!entryResult) {
  183. DEBUGMSGA ((DBG_ERROR, DBG_MIGDLL"-Attach: Migration entry %s returned FALSE", m->Name));
  184. result = entryResult;
  185. break;
  186. }
  187. m++;
  188. }
  189. break;
  190. case DLL_PROCESS_DETACH:
  191. if (g_MigrateInfPath) {
  192. FreePathStringA (g_MigrateInfPath);
  193. g_MigrateInfPath = NULL;
  194. }
  195. if (g_MigrateInf != INVALID_HANDLE_VALUE) {
  196. InfCloseInfFile (g_MigrateInf);
  197. g_MigrateInf = INVALID_HANDLE_VALUE;
  198. }
  199. //
  200. // Free standard pools
  201. //
  202. if (g_GlobalPool) {
  203. PoolMemDestroyPool (g_GlobalPool);
  204. g_GlobalPool = NULL;
  205. }
  206. FreeGrowBuffer (&g_FilesBuff);
  207. m = g_MigrationEntries;
  208. while (m->pDetach) {
  209. DEBUGMSGA ((DBG_MIGDLL, "Detach calling: %s", m->Name));
  210. entryResult = m->pDetach (DllInstance);
  211. if (!entryResult) {
  212. DEBUGMSGA ((DBG_ERROR, DBG_MIGDLL"-Detach: Migration entry %s returned FALSE", m->Name));
  213. result = entryResult;
  214. break;
  215. }
  216. m++;
  217. }
  218. MemDb_Entry (DllInstance, DLL_PROCESS_DETACH, NULL);
  219. MigUtil_Entry (DllInstance, DLL_PROCESS_DETACH, NULL);
  220. break;
  221. }
  222. return result;
  223. }
  224. LONG
  225. CALLBACK
  226. QueryVersion (
  227. OUT PCSTR *ProductID,
  228. OUT PUINT DllVersion,
  229. OUT PINT *CodePageArray, OPTIONAL
  230. OUT PCSTR *ExeNamesBuf, OPTIONAL
  231. OUT PVENDORINFO *VendorInfo
  232. )
  233. {
  234. PMIGRATION_ENTRY m;
  235. PCSTR entryExeNamesBuf;
  236. MULTISZ_ENUM entryEnum;
  237. LONG result = ERROR_NOT_INSTALLED;
  238. LONG entryResult;
  239. PCSTR tempStr;
  240. //
  241. // Fill the data.
  242. //
  243. tempStr = GetStringResourceA (MSG_PRODUCT_ID);
  244. if (tempStr) {
  245. StringCopyByteCountA (g_ProductId, tempStr, MAX_PATH);
  246. FreeStringResourceA (tempStr);
  247. }
  248. *ProductID = g_ProductId;
  249. *DllVersion = D_DLLVERSION;
  250. *CodePageArray = NULL;
  251. *VendorInfo = &g_VendorInfo;
  252. // now get the VendorInfo data from resources
  253. tempStr = GetStringResourceA (MSG_VI_COMPANY_NAME);
  254. if (tempStr) {
  255. StringCopyByteCountA (g_VendorInfo.CompanyName, tempStr, 256);
  256. FreeStringResourceA (tempStr);
  257. }
  258. tempStr = GetStringResourceA (MSG_VI_SUPPORT_NUMBER);
  259. if (tempStr) {
  260. StringCopyByteCountA (g_VendorInfo.SupportNumber, tempStr, 256);
  261. FreeStringResourceA (tempStr);
  262. }
  263. tempStr = GetStringResourceA (MSG_VI_SUPPORT_URL);
  264. if (tempStr) {
  265. StringCopyByteCountA (g_VendorInfo.SupportUrl, tempStr, 256);
  266. FreeStringResourceA (tempStr);
  267. }
  268. tempStr = GetStringResourceA (MSG_VI_INSTRUCTIONS);
  269. if (tempStr) {
  270. StringCopyByteCountA (g_VendorInfo.InstructionsToUser, tempStr, 1024);
  271. FreeStringResourceA (tempStr);
  272. }
  273. //
  274. // Query each entry.
  275. //
  276. m = g_MigrationEntries;
  277. while (m->pQueryVersion) {
  278. DEBUGMSGA ((DBG_MIGDLL, "QueryVersion calling: %s", m->Name));
  279. entryExeNamesBuf = NULL;
  280. entryResult = m->pQueryVersion (&entryExeNamesBuf);
  281. if (entryResult == ERROR_SUCCESS) {
  282. //
  283. // Put the files that this entry needs in grow buffer.
  284. //
  285. if (EnumFirstMultiSzA (&entryEnum, entryExeNamesBuf)) {
  286. do {
  287. MultiSzAppendA (&g_FilesBuff, entryEnum.CurrentString);
  288. } while (EnumNextMultiSzA (&entryEnum));
  289. }
  290. //
  291. // result is now ERROR_SUCCESS so QueryVersion will return this.
  292. //
  293. result = ERROR_SUCCESS;
  294. } else if (entryResult != ERROR_NOT_INSTALLED) {
  295. DEBUGMSGA ((DBG_ERROR, DBG_MIGDLL"-QueryVersion: Migration entry %s reported error: %d", m->Name, entryResult));
  296. }
  297. m++;
  298. }
  299. *ExeNamesBuf = g_FilesBuff.Buf;
  300. return result;
  301. }
  302. LONG
  303. CALLBACK
  304. Initialize9x (
  305. IN PCSTR WorkingDirectory,
  306. IN PCSTR SourceDirectories,
  307. PVOID Reserved
  308. )
  309. {
  310. PMIGRATION_ENTRY m;
  311. PCSTR entryExeNamesBuf;
  312. LONG result = ERROR_NOT_INSTALLED;
  313. LONG entryResult;
  314. g_WorkingDir = DuplicatePathString (WorkingDirectory, 0);
  315. g_MigrateInfPath = JoinPathsA (WorkingDirectory, S_MIGRATE_INF);
  316. g_MigrateInf = InfOpenInfFileA (g_MigrateInfPath);
  317. //
  318. // We were unloaded so all the data about if an entry is active or not would have gone away. We need
  319. // to query each entry again.
  320. //
  321. m = g_MigrationEntries;
  322. while (m->pQueryVersion) {
  323. DEBUGMSGA ((DBG_MIGDLL, "QueryVersion calling: %s", m->Name));
  324. entryExeNamesBuf = NULL;
  325. entryResult = m->pQueryVersion (&entryExeNamesBuf);
  326. if (entryResult != ERROR_SUCCESS) {
  327. if (entryResult != ERROR_NOT_INSTALLED) {
  328. DEBUGMSGA ((DBG_ERROR, DBG_MIGDLL"-QueryVersion: Migration entry %s reported error: %d", m->Name, entryResult));
  329. }
  330. m->Active = FALSE;
  331. }
  332. m++;
  333. }
  334. //
  335. // Now is the time to call Initialize9x for each active entry
  336. //
  337. m = g_MigrationEntries;
  338. while (m->pInitialize9x) {
  339. if (m->Active) {
  340. DEBUGMSGA ((DBG_MIGDLL, "Initialize9x calling: %s", m->Name));
  341. entryResult = m->pInitialize9x (WorkingDirectory, SourceDirectories);
  342. if (entryResult != ERROR_SUCCESS) {
  343. if (entryResult != ERROR_NOT_INSTALLED) {
  344. DEBUGMSGA ((DBG_ERROR, DBG_MIGDLL"-Initialize9x: Migration entry %s reported error: %d", m->Name, entryResult));
  345. }
  346. m->Active = FALSE;
  347. }
  348. else {
  349. result = ERROR_SUCCESS;
  350. }
  351. }
  352. m++;
  353. }
  354. return result;
  355. }
  356. LONG
  357. CALLBACK
  358. MigrateUser9x (
  359. IN HWND ParentWnd,
  360. IN PCSTR UnattendFile,
  361. IN HKEY UserRegKey,
  362. IN PCSTR UserName,
  363. PVOID Reserved
  364. )
  365. {
  366. PMIGRATION_ENTRY m;
  367. LONG result = ERROR_NOT_INSTALLED;
  368. LONG entryResult;
  369. g_ParentWnd = ParentWnd;
  370. LogReInit (&g_ParentWnd, NULL);
  371. //
  372. // Call MigrateUser9x for each active entry
  373. //
  374. m = g_MigrationEntries;
  375. while (m->pMigrateUser9x) {
  376. if (m->Active) {
  377. DEBUGMSGA ((DBG_MIGDLL, "MigrateUser9x calling: %s", m->Name));
  378. entryResult = m->pMigrateUser9x (ParentWnd, UnattendFile, UserRegKey, UserName);
  379. if (entryResult != ERROR_SUCCESS) {
  380. if (entryResult != ERROR_NOT_INSTALLED) {
  381. DEBUGMSGA ((DBG_ERROR, DBG_MIGDLL"-MigrateUser9x: Migration entry %s reported error: %d", m->Name, entryResult));
  382. }
  383. }
  384. else {
  385. result = ERROR_SUCCESS;
  386. m->WantToRunOnNt = 1;
  387. }
  388. }
  389. m++;
  390. }
  391. return result;
  392. }
  393. LONG
  394. CALLBACK
  395. MigrateSystem9x (
  396. IN HWND ParentWnd,
  397. IN PCSTR UnattendFile,
  398. PVOID Reserved
  399. )
  400. {
  401. PMIGRATION_ENTRY m;
  402. LONG result = ERROR_NOT_INSTALLED;
  403. LONG entryResult;
  404. PCSTR savePath;
  405. CHAR key[MEMDB_MAX];
  406. g_ParentWnd = ParentWnd;
  407. LogReInit (&g_ParentWnd, NULL);
  408. //
  409. // Call MigrateSystem9x for each active entry
  410. //
  411. m = g_MigrationEntries;
  412. while (m->pMigrateSystem9x) {
  413. if (m->Active) {
  414. DEBUGMSGA ((DBG_MIGDLL, "MigrateSystem9x calling: %s", m->Name));
  415. entryResult = m->pMigrateSystem9x (ParentWnd, UnattendFile);
  416. if (entryResult != ERROR_SUCCESS) {
  417. if (entryResult != ERROR_NOT_INSTALLED) {
  418. DEBUGMSGA ((DBG_ERROR, DBG_MIGDLL"-MigrateSystem9x: Migration entry %s reported error: %d", m->Name, entryResult));
  419. }
  420. }
  421. else {
  422. result = ERROR_SUCCESS;
  423. m->WantToRunOnNt = 1;
  424. }
  425. }
  426. m++;
  427. }
  428. //
  429. // This was the last function on 9x side. Let's put all the data in MemDb
  430. // and save it for NT side.
  431. //
  432. m = g_MigrationEntries;
  433. while (m->Name) {
  434. MemDbBuildKeyA (key, MEMDB_CATEGORY_DLLENTRIES, m->Name, S_ACTIVE, NULL);
  435. MemDbSetValueA (key, m->WantToRunOnNt);
  436. m++;
  437. }
  438. //
  439. // Now save MemDb content.
  440. //
  441. MYASSERT (g_WorkingDir);
  442. savePath = JoinPathsA (g_WorkingDir, "SETUPDLL.DAT");
  443. if (!MemDbSaveA (savePath)) {
  444. DEBUGMSGA ((DBG_ERROR, DBG_MIGDLL"-Could not save MemDb content to %s.", savePath));
  445. }
  446. FreePathStringA (savePath);
  447. FreePathString (g_WorkingDir);
  448. g_WorkingDir = NULL;
  449. return result;
  450. }
  451. LONG
  452. CALLBACK
  453. InitializeNT (
  454. IN PCWSTR WorkingDirectory,
  455. IN PCWSTR SourceDirectories,
  456. PVOID Reserved
  457. )
  458. {
  459. PMIGRATION_ENTRY m;
  460. LONG result = ERROR_NOT_INSTALLED;
  461. LONG entryResult;
  462. PCWSTR loadPath;
  463. CHAR key[MEMDB_MAX];
  464. //
  465. // This is the first function on NT side. Let's load MemDb content.
  466. //
  467. loadPath = JoinPathsW (WorkingDirectory, L"SETUPDLL.DAT");
  468. if (!MemDbLoadW (loadPath)) {
  469. DEBUGMSGA ((DBG_ERROR, DBG_MIGDLL"-Could not load MemDb content."));
  470. }
  471. FreePathStringW (loadPath);
  472. //
  473. // Let's get the data that we stored in MemDb
  474. //
  475. m = g_MigrationEntries;
  476. while (m->Name) {
  477. MemDbBuildKeyA (key, MEMDB_CATEGORY_DLLENTRIES, m->Name, S_ACTIVE, NULL);
  478. MemDbGetValueA (key, &m->Active);
  479. m++;
  480. }
  481. //
  482. // Now call InitializeNT for each active entry
  483. //
  484. m = g_MigrationEntries;
  485. while (m->pMigrateSystem9x) {
  486. if (m->Active) {
  487. DEBUGMSGA ((DBG_MIGDLL, "InitializeNT calling: %s", m->Name));
  488. entryResult = m->pInitializeNT (WorkingDirectory, SourceDirectories);
  489. if (entryResult != ERROR_SUCCESS) {
  490. if (entryResult != ERROR_NOT_INSTALLED) {
  491. DEBUGMSGA ((DBG_ERROR, DBG_MIGDLL"-InitializeNT: Migration entry %s reported error: %d", m->Name, entryResult));
  492. }
  493. }
  494. else {
  495. result = ERROR_SUCCESS;
  496. }
  497. }
  498. m++;
  499. }
  500. return result;
  501. }
  502. LONG
  503. CALLBACK
  504. MigrateUserNT (
  505. IN HINF UnattendInfHandle,
  506. IN HKEY UserRegKey,
  507. IN PCWSTR UserName,
  508. PVOID Reserved
  509. )
  510. {
  511. PMIGRATION_ENTRY m;
  512. LONG result = ERROR_NOT_INSTALLED;
  513. LONG entryResult;
  514. //
  515. // Call MigrateUserNT for each active entry
  516. //
  517. m = g_MigrationEntries;
  518. while (m->pMigrateSystem9x) {
  519. if (m->Active) {
  520. DEBUGMSGA ((DBG_MIGDLL, "MigrateUserNT calling: %s", m->Name));
  521. entryResult = m->pMigrateUserNT (UnattendInfHandle, UserRegKey, UserName);
  522. if (entryResult != ERROR_SUCCESS) {
  523. if (entryResult != ERROR_NOT_INSTALLED) {
  524. DEBUGMSGA ((DBG_ERROR, DBG_MIGDLL"-MigrateUserNT: Migration entry %s reported error: %d", m->Name, entryResult));
  525. }
  526. }
  527. else {
  528. result = ERROR_SUCCESS;
  529. }
  530. }
  531. m++;
  532. }
  533. return result;
  534. }
  535. LONG
  536. CALLBACK
  537. MigrateSystemNT (
  538. IN HINF UnattendInfHandle,
  539. PVOID Reserved
  540. )
  541. {
  542. PMIGRATION_ENTRY m;
  543. LONG result = ERROR_NOT_INSTALLED;
  544. LONG entryResult;
  545. //
  546. // Call MigrateSystemNT for each active entry
  547. //
  548. m = g_MigrationEntries;
  549. while (m->pMigrateSystem9x) {
  550. if (m->Active) {
  551. DEBUGMSGA ((DBG_MIGDLL, "MigrateSystemNT calling: %s", m->Name));
  552. entryResult = m->pMigrateSystemNT (UnattendInfHandle);
  553. if (entryResult != ERROR_SUCCESS) {
  554. if (entryResult != ERROR_NOT_INSTALLED) {
  555. DEBUGMSGA ((DBG_ERROR, DBG_MIGDLL"-MigrateSystemNT: Migration entry %s reported error: %d", m->Name, entryResult));
  556. }
  557. }
  558. else {
  559. result = ERROR_SUCCESS;
  560. }
  561. }
  562. m++;
  563. }
  564. return result;
  565. }
  566. BOOL
  567. IsExcludedPath (
  568. PCSTR Path
  569. )
  570. {
  571. INFSTRUCT context = INITINFSTRUCT_GROWBUFFER;
  572. PCSTR ExcludedPath;
  573. BOOL b = FALSE;
  574. if (InfFindFirstLineA (g_MigrateInf, "Excluded Paths", NULL, &context)) {
  575. do {
  576. ExcludedPath = InfGetStringField (&context, 1);
  577. if (ExcludedPath) {
  578. if (StringIMatchByteCount (ExcludedPath, Path, ByteCount (ExcludedPath))) {
  579. b = TRUE;
  580. break;
  581. }
  582. }
  583. } while (InfFindNextLine (&context));
  584. }
  585. InfCleanUpInfStruct (&context);
  586. return b;
  587. }