Source code of Windows XP (NT5)
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.

175 lines
3.7 KiB

  1. /*++
  2. Copyright (c) 2002 Microsoft Corporation
  3. Module Name:
  4. progacc.c
  5. Abstract:
  6. This source file implements the operations needed to properly migrate
  7. program access settings for OE access.
  8. Author:
  9. Tim Noonan (tnoonan) 17-Jul-2002
  10. Revision History:
  11. --*/
  12. #include "pch.h"
  13. #define S_OE_FILE "MSIMN.EXE"
  14. #define S_MAIL_KEY "HKLM\\Software\\Clients\\Mail"
  15. #define S_OUTLOOK_EXPRESS "Outlook Express"
  16. #define S_IMN "Internet Mail and News"
  17. static GROWBUFFER g_FilesBuff = GROWBUF_INIT;
  18. BOOL
  19. ProgramAccess_Attach (
  20. IN HINSTANCE DllInstance
  21. )
  22. {
  23. return TRUE;
  24. }
  25. BOOL
  26. ProgramAccess_Detach (
  27. IN HINSTANCE DllInstance
  28. )
  29. {
  30. FreeGrowBuffer(&g_FilesBuff);
  31. return TRUE;
  32. }
  33. LONG
  34. ProgramAccess_QueryVersion (
  35. IN PCSTR *ExeNamesBuf
  36. )
  37. {
  38. MultiSzAppendA (&g_FilesBuff, S_OE_FILE);
  39. *ExeNamesBuf = g_FilesBuff.Buf;
  40. return ERROR_SUCCESS;
  41. }
  42. LONG
  43. ProgramAccess_Initialize9x (
  44. IN PCSTR WorkingDirectory,
  45. IN PCSTR SourceDirectories
  46. )
  47. {
  48. return ERROR_SUCCESS;
  49. }
  50. LONG
  51. ProgramAccess_MigrateUser9x (
  52. IN HWND ParentWnd,
  53. IN PCSTR UnattendFile,
  54. IN HKEY UserRegKey,
  55. IN PCSTR UserName
  56. )
  57. {
  58. return ERROR_SUCCESS;
  59. }
  60. LONG
  61. ProgramAccess_MigrateSystem9x (
  62. IN HWND ParentWnd,
  63. IN PCSTR UnattendFile
  64. )
  65. {
  66. CHAR OEAccess[MAX_PATH];
  67. DWORD cch = GetPrivateProfileStringA("Components",
  68. "OEAccess",
  69. "",
  70. OEAccess,
  71. ARRAYSIZE(OEAccess),
  72. UnattendFile);
  73. if ((cch > 0) && StringIMatchA(OEAccess, "off"))
  74. {
  75. HKEY key;
  76. DEBUGMSGA((DBG_VERBOSE, "ProgramAccess: OEAccess is off."));
  77. key = OpenRegKeyStrA(S_MAIL_KEY);
  78. if (NULL != key)
  79. {
  80. PCTSTR currentClient = GetRegValueStringA(key, "");
  81. if (NULL != currentClient)
  82. {
  83. if (StringIMatchA(currentClient, S_OUTLOOK_EXPRESS) ||
  84. StringIMatchA(currentClient, S_IMN))
  85. {
  86. DEBUGMSGA((DBG_VERBOSE, "ProgramAccess: OE was the default client and we are marking the key as handled."));
  87. WritePrivateProfileStringA(S_HANDLED,
  88. S_MAIL_KEY,
  89. "Registry",
  90. g_MigrateInfPath);
  91. }
  92. else
  93. {
  94. DEBUGMSGA ((DBG_VERBOSE, "ProgramAccess: OE was not the default client."));
  95. }
  96. MemFree(g_hHeap, 0, currentClient);
  97. }
  98. else
  99. {
  100. DEBUGMSGA ((DBG_VERBOSE, "ProgramAccess: Error getting current client or no default client."));
  101. }
  102. CloseRegKey(key);
  103. }
  104. else
  105. {
  106. DEBUGMSGA ((DBG_VERBOSE, "ProgramAccess: Error opening " S_MAIL_KEY "."));
  107. }
  108. }
  109. else
  110. {
  111. DEBUGMSGA ((DBG_VERBOSE, "ProgramAccess: OEAccess is on -- not messing with default client."));
  112. }
  113. return ERROR_SUCCESS;
  114. }
  115. LONG
  116. ProgramAccess_InitializeNT (
  117. IN PCWSTR WorkingDirectory,
  118. IN PCWSTR SourceDirectories
  119. )
  120. {
  121. return ERROR_SUCCESS;
  122. }
  123. LONG
  124. ProgramAccess_MigrateUserNT (
  125. IN HINF UnattendFile,
  126. IN HKEY UserRegKey,
  127. IN PCWSTR UserName
  128. )
  129. {
  130. return ERROR_SUCCESS;
  131. }
  132. LONG
  133. ProgramAccess_MigrateSystemNT (
  134. IN HINF UnattendFile
  135. )
  136. {
  137. return ERROR_SUCCESS;
  138. }