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.

157 lines
2.3 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. usermig.c
  5. Abstract:
  6. User migration test tool
  7. Author:
  8. <full name> (<alias>) <date>
  9. Revision History:
  10. <alias> <date> <comments>
  11. --*/
  12. #include "pch.h"
  13. BOOL
  14. Init (
  15. VOID
  16. )
  17. {
  18. HINSTANCE hInstance;
  19. DWORD dwReason;
  20. PVOID lpReserved;
  21. //
  22. // Simulate DllMain
  23. //
  24. hInstance = GetModuleHandle (NULL);
  25. dwReason = DLL_PROCESS_ATTACH;
  26. lpReserved = NULL;
  27. //
  28. // Initialize DLL globals
  29. //
  30. if (!FirstInitRoutine (hInstance)) {
  31. return FALSE;
  32. }
  33. //
  34. // Initialize all libraries
  35. //
  36. if (!InitLibs (hInstance, dwReason, lpReserved)) {
  37. return FALSE;
  38. }
  39. //
  40. // Final initialization
  41. //
  42. if (!FinalInitRoutine ()) {
  43. return FALSE;
  44. }
  45. return TRUE;
  46. }
  47. VOID
  48. Terminate (
  49. VOID
  50. )
  51. {
  52. HINSTANCE hInstance;
  53. DWORD dwReason;
  54. PVOID lpReserved;
  55. //
  56. // Simulate DllMain
  57. //
  58. hInstance = GetModuleHandle (NULL);
  59. dwReason = DLL_PROCESS_DETACH;
  60. lpReserved = NULL;
  61. //
  62. // Call the cleanup routine that requires library APIs
  63. //
  64. FirstCleanupRoutine();
  65. //
  66. // Clean up all libraries
  67. //
  68. TerminateLibs (hInstance, dwReason, lpReserved);
  69. //
  70. // Do any remaining clean up
  71. //
  72. FinalCleanupRoutine();
  73. }
  74. INT
  75. __cdecl
  76. wmain (
  77. INT argc,
  78. WCHAR *argv[]
  79. )
  80. {
  81. LONG rc;
  82. REGTREE_ENUM e;
  83. if (!Init()) {
  84. wprintf (L"Unable to initialize!\n");
  85. return 255;
  86. }
  87. InitializeProgressBar (NULL, NULL, NULL, NULL);
  88. //
  89. // Initialize Win95Reg
  90. //
  91. rc = Win95RegInit (TEXT("c:\\windows\\setup\\defhives"), TRUE);
  92. if (rc != ERROR_SUCCESS) {
  93. SetLastError (rc);
  94. LOG ((LOG_ERROR, "Init Processor: Win95RegInit failed, check Win9x windir in code"));
  95. return FALSE;
  96. }
  97. MemDbLoad (TEXT("c:\\windows\\setup\\ntsetup.dat"));
  98. g_DomainUserName = NULL;
  99. g_Win9xUserName = NULL;
  100. g_FixedUserName = NULL;
  101. g_hKeyRootNT = HKEY_LOCAL_MACHINE;
  102. g_hKeyRoot95 = HKEY_LOCAL_MACHINE;
  103. SetRegRoot (g_hKeyRoot95);
  104. MergeRegistry (TEXT("d:\\i386\\wkstamig.inf"), NULL);
  105. Terminate();
  106. return 0;
  107. }