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.

288 lines
9.3 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. Main.cpp
  5. Abstract:
  6. Notes:
  7. History:
  8. 15/11/2000 clupu Created
  9. 11/30/2000 a-brienw modified for beginning of misc shim
  10. --*/
  11. #include "precomp.h"
  12. #include "ShimHookMacro.h"
  13. DECLARE_SHIM(AliasDXDC)
  14. DECLARE_SHIM(CorrectACMArgs)
  15. DECLARE_SHIM(CorrectACMStreamOpen)
  16. DECLARE_SHIM(CorrectActiveMoviePath)
  17. DECLARE_SHIM(CorrectCreateIcon)
  18. DECLARE_SHIM(CorrectCreateSurface)
  19. DECLARE_SHIM(CorrectFarEastFont)
  20. DECLARE_SHIM(CorrectFilePathInSetDlgItemText)
  21. DECLARE_SHIM(CorrectFilePathsUninstall)
  22. DECLARE_SHIM(CorrectOpenFileExclusive)
  23. DECLARE_SHIM(CorrectVerInstallFile)
  24. DECLARE_SHIM(CUASAppFix)
  25. DECLARE_SHIM(CUASDisableCicero)
  26. DECLARE_SHIM(DelayDllInit)
  27. DECLARE_SHIM(DelayShowGroup)
  28. DECLARE_SHIM(DelayWin95VersionLie)
  29. DECLARE_SHIM(DelayWinMMCallback)
  30. DECLARE_SHIM(DeleteSpecifiedFiles)
  31. DECLARE_SHIM(DeRandomizeExeName)
  32. DECLARE_SHIM(DisableBoostThread)
  33. DECLARE_SHIM(DisableFilterKeys)
  34. DECLARE_SHIM(DisableScreenSaver)
  35. DECLARE_SHIM(DisableStickyKeys)
  36. #ifndef SHIM_WIN2K
  37. DECLARE_SHIM(DisableThemes)
  38. #endif // SHIM_WIN2K
  39. DECLARE_SHIM(DisableW2KOwnerDrawButtonStates)
  40. DECLARE_SHIM(EmptyClipboardtoSet)
  41. DECLARE_SHIM(EmulateGetStdHandle)
  42. DECLARE_SHIM(EmulateGetStringType)
  43. DECLARE_SHIM(EmulateLZHandles)
  44. DECLARE_SHIM(EnlargeGetObjectBufferSize)
  45. DECLARE_SHIM(ExtractAssociatedIcon)
  46. DECLARE_SHIM(FailCloseProfileUserMapping)
  47. DECLARE_SHIM(FailGetStdHandle)
  48. DECLARE_SHIM(FailObsoleteShellAPIs)
  49. DECLARE_SHIM(FailOpenFile)
  50. DECLARE_SHIM(FakeThemeMetrics)
  51. DECLARE_SHIM(FilterNetworkResources)
  52. DECLARE_SHIM(FixServiceStartupCircularDependency)
  53. DECLARE_SHIM(Force640x480x8)
  54. DECLARE_SHIM(Force640x480x16)
  55. DECLARE_SHIM(ForceAdminAccess)
  56. DECLARE_SHIM(ForceAnsiWindowProc)
  57. DECLARE_SHIM(ForceAppendMenuSuccess)
  58. DECLARE_SHIM(ForceApplicationFocus)
  59. DECLARE_SHIM(ForceAVIWindow)
  60. DECLARE_SHIM(ForceDefaultSystemPaletteEntries)
  61. DECLARE_SHIM(ForceDirectDrawEmulation)
  62. DECLARE_SHIM(ForceDirectDrawWait)
  63. DECLARE_SHIM(ForceDisplayMode)
  64. DECLARE_SHIM(ForceSeparateVDM)
  65. DECLARE_SHIM(ForceSimpleWindow)
  66. DECLARE_SHIM(ForceTemporaryModeChange)
  67. DECLARE_SHIM(ForceWorkingDirectoryToEXEPath)
  68. DECLARE_SHIM(FUSBadApplicationType1)
  69. DECLARE_SHIM(FUSBadApplicationType2)
  70. DECLARE_SHIM(FUSBadApplicationType3)
  71. DECLARE_SHIM(FUSBadApplicationType4)
  72. DECLARE_SHIM(GlobalMemoryStatusLie)
  73. DECLARE_SHIM(HandleDBCSUserName)
  74. DECLARE_SHIM(HandleDBCSUserName2)
  75. DECLARE_SHIM(HeapClearAllocation)
  76. DECLARE_SHIM(HeapDelayLocalFree)
  77. DECLARE_SHIM(HeapForceGrowable)
  78. DECLARE_SHIM(HeapIgnoreMoveable)
  79. DECLARE_SHIM(HeapLookasideFree)
  80. DECLARE_SHIM(HeapPadAllocation)
  81. DECLARE_SHIM(HeapValidateFrees)
  82. DECLARE_SHIM(HideCursor)
  83. DECLARE_SHIM(HideTaskBar)
  84. DECLARE_SHIM(IgnoreAltTab)
  85. DECLARE_SHIM(IgnoreCoCreateInstance)
  86. DECLARE_SHIM(IgnoreCRTExit)
  87. DECLARE_SHIM(IgnoreDebugOutput)
  88. DECLARE_SHIM(IgnoreFreeLibrary)
  89. DECLARE_SHIM(IgnoreHungAppPaint)
  90. DECLARE_SHIM(IgnoreMCIStop)
  91. DECLARE_SHIM(IgnoreMessageBox)
  92. DECLARE_SHIM(IgnoreNoModeChange)
  93. DECLARE_SHIM(IgnoreOemToChar)
  94. DECLARE_SHIM(IgnoreSysColChanges)
  95. DECLARE_SHIM(IgnoreTAPIDisconnect)
  96. DECLARE_SHIM(IgnoreVBOverflow)
  97. DECLARE_SHIM(IgnoreZeroMoveWindow)
  98. DECLARE_SHIM(InjectDll)
  99. DECLARE_SHIM(KeepWindowOnMonitor)
  100. DECLARE_SHIM(LazyReleaseDC)
  101. DECLARE_SHIM(LimitFindFile)
  102. DECLARE_SHIM(LoadComctl32Version5)
  103. DECLARE_SHIM(LoadLibraryCWD)
  104. DECLARE_SHIM(LowerThreadPriority)
  105. DECLARE_SHIM(MoveIniToRegistry)
  106. DECLARE_SHIM(MoveWinInitRenameToReg)
  107. DECLARE_SHIM(NullHwndInMessageBox)
  108. DECLARE_SHIM(PaletteRestore)
  109. DECLARE_SHIM(PopulateDefaultHKCUSettings)
  110. DECLARE_SHIM(PropagateProcessHistory)
  111. DECLARE_SHIM(RecopyExeFromCD)
  112. DECLARE_SHIM(RedirectDBCSTempPath)
  113. DECLARE_SHIM(RedirectEXE)
  114. DECLARE_SHIM(RedirectWindowsDirToSystem32)
  115. DECLARE_SHIM(RemoveBroadcastPostMessage)
  116. DECLARE_SHIM(RemoveDDEFlagFromShellExecuteEx)
  117. DECLARE_SHIM(RemoveInvalidW2KWindowStyles)
  118. DECLARE_SHIM(RemoveIpFromMsInfoCommandLine)
  119. DECLARE_SHIM(RemoveNoBufferingFlagFromCreateFile)
  120. DECLARE_SHIM(RemoveOverlappedFlagFromCreateFile)
  121. DECLARE_SHIM(RemoveReadOnlyAttribute)
  122. DECLARE_SHIM(RestoreSystemCursors)
  123. DECLARE_SHIM(SearchPathInAppPaths)
  124. DECLARE_SHIM(SetEnvironmentVariable)
  125. DECLARE_SHIM(StackSwap)
  126. DECLARE_SHIM(TerminateExe)
  127. DECLARE_SHIM(TrimVersionInfo)
  128. DECLARE_SHIM(UnMirrorImageList)
  129. DECLARE_SHIM(WaveOutUsePreferredDevice)
  130. DECLARE_SHIM(WinG32SysToSys32)
  131. VOID MULTISHIM_NOTIFY_FUNCTION()(DWORD fdwReason)
  132. {
  133. switch (fdwReason)
  134. {
  135. case DLL_PROCESS_ATTACH:
  136. DPF("AcGenral", eDbgLevelSpew, "General Purpose Shims initialized.");
  137. break;
  138. case DLL_PROCESS_DETACH:
  139. DPF("AcGenral", eDbgLevelSpew, "General Purpose Shims uninitialized.");
  140. break;
  141. default:
  142. break;
  143. }
  144. }
  145. MULTISHIM_BEGIN()
  146. MULTISHIM_ENTRY(AliasDXDC)
  147. MULTISHIM_ENTRY(CorrectACMArgs)
  148. MULTISHIM_ENTRY(CorrectACMStreamOpen)
  149. MULTISHIM_ENTRY(CorrectActiveMoviePath)
  150. MULTISHIM_ENTRY(CorrectCreateIcon)
  151. MULTISHIM_ENTRY(CorrectCreateSurface)
  152. MULTISHIM_ENTRY(CorrectFarEastFont)
  153. MULTISHIM_ENTRY(CorrectFilePathInSetDlgItemText)
  154. MULTISHIM_ENTRY(CorrectFilePathsUninstall)
  155. MULTISHIM_ENTRY(CorrectOpenFileExclusive)
  156. MULTISHIM_ENTRY(CorrectVerInstallFile)
  157. MULTISHIM_ENTRY(CUASAppFix)
  158. MULTISHIM_ENTRY(CUASDisableCicero)
  159. MULTISHIM_ENTRY(DelayDllInit)
  160. MULTISHIM_ENTRY(DelayShowGroup)
  161. MULTISHIM_ENTRY(DelayWin95VersionLie)
  162. MULTISHIM_ENTRY(DelayWinMMCallback)
  163. MULTISHIM_ENTRY(DeleteSpecifiedFiles)
  164. MULTISHIM_ENTRY(DeRandomizeExeName)
  165. MULTISHIM_ENTRY(DisableBoostThread)
  166. MULTISHIM_ENTRY(DisableFilterKeys)
  167. MULTISHIM_ENTRY(DisableScreenSaver)
  168. MULTISHIM_ENTRY(DisableStickyKeys)
  169. #ifndef SHIM_WIN2K
  170. MULTISHIM_ENTRY(DisableThemes)
  171. #endif // SHIM_WIN2K
  172. MULTISHIM_ENTRY(DisableW2KOwnerDrawButtonStates)
  173. MULTISHIM_ENTRY(EmptyClipboardtoSet)
  174. MULTISHIM_ENTRY(EmulateGetStdHandle)
  175. MULTISHIM_ENTRY(EmulateGetStringType)
  176. MULTISHIM_ENTRY(EmulateLZHandles)
  177. MULTISHIM_ENTRY(EnlargeGetObjectBufferSize)
  178. MULTISHIM_ENTRY(ExtractAssociatedIcon)
  179. MULTISHIM_ENTRY(FailCloseProfileUserMapping)
  180. MULTISHIM_ENTRY(FailGetStdHandle)
  181. MULTISHIM_ENTRY(FailObsoleteShellAPIs)
  182. MULTISHIM_ENTRY(FailOpenFile)
  183. MULTISHIM_ENTRY(FakeThemeMetrics)
  184. MULTISHIM_ENTRY(FilterNetworkResources)
  185. MULTISHIM_ENTRY(FixServiceStartupCircularDependency)
  186. MULTISHIM_ENTRY(Force640x480x8)
  187. MULTISHIM_ENTRY(Force640x480x16)
  188. MULTISHIM_ENTRY(ForceAdminAccess)
  189. MULTISHIM_ENTRY(ForceAnsiWindowProc)
  190. MULTISHIM_ENTRY(ForceAppendMenuSuccess)
  191. MULTISHIM_ENTRY(ForceApplicationFocus)
  192. MULTISHIM_ENTRY(ForceAVIWindow)
  193. MULTISHIM_ENTRY(ForceDefaultSystemPaletteEntries)
  194. MULTISHIM_ENTRY(ForceDirectDrawEmulation)
  195. MULTISHIM_ENTRY(ForceDirectDrawWait)
  196. MULTISHIM_ENTRY(ForceDisplayMode)
  197. MULTISHIM_ENTRY(ForceSeparateVDM)
  198. MULTISHIM_ENTRY(ForceSimpleWindow)
  199. MULTISHIM_ENTRY(ForceTemporaryModeChange)
  200. MULTISHIM_ENTRY(ForceWorkingDirectoryToEXEPath)
  201. MULTISHIM_ENTRY(FUSBadApplicationType1)
  202. MULTISHIM_ENTRY(FUSBadApplicationType2)
  203. MULTISHIM_ENTRY(FUSBadApplicationType3)
  204. MULTISHIM_ENTRY(FUSBadApplicationType4)
  205. MULTISHIM_ENTRY(GlobalMemoryStatusLie)
  206. MULTISHIM_ENTRY(HandleDBCSUserName)
  207. MULTISHIM_ENTRY(HandleDBCSUserName2)
  208. MULTISHIM_ENTRY(HeapClearAllocation)
  209. MULTISHIM_ENTRY(HeapDelayLocalFree)
  210. MULTISHIM_ENTRY(HeapForceGrowable)
  211. MULTISHIM_ENTRY(HeapIgnoreMoveable)
  212. MULTISHIM_ENTRY(HeapLookasideFree)
  213. MULTISHIM_ENTRY(HeapPadAllocation)
  214. MULTISHIM_ENTRY(HeapValidateFrees)
  215. MULTISHIM_ENTRY(HideCursor)
  216. MULTISHIM_ENTRY(HideTaskBar)
  217. MULTISHIM_ENTRY(IgnoreAltTab)
  218. MULTISHIM_ENTRY(IgnoreCoCreateInstance)
  219. MULTISHIM_ENTRY(IgnoreCRTExit)
  220. MULTISHIM_ENTRY(IgnoreDebugOutput)
  221. MULTISHIM_ENTRY(IgnoreFreeLibrary)
  222. MULTISHIM_ENTRY(IgnoreHungAppPaint)
  223. MULTISHIM_ENTRY(IgnoreMCIStop)
  224. MULTISHIM_ENTRY(IgnoreMessageBox)
  225. MULTISHIM_ENTRY(IgnoreNoModeChange)
  226. MULTISHIM_ENTRY(IgnoreOemToChar)
  227. MULTISHIM_ENTRY(IgnoreSysColChanges)
  228. MULTISHIM_ENTRY(IgnoreTAPIDisconnect)
  229. MULTISHIM_ENTRY(IgnoreVBOverflow)
  230. MULTISHIM_ENTRY(IgnoreZeroMoveWindow)
  231. MULTISHIM_ENTRY(InjectDll)
  232. MULTISHIM_ENTRY(KeepWindowOnMonitor)
  233. MULTISHIM_ENTRY(LazyReleaseDC)
  234. MULTISHIM_ENTRY(LimitFindFile)
  235. MULTISHIM_ENTRY(LoadComctl32Version5)
  236. MULTISHIM_ENTRY(LoadLibraryCWD)
  237. MULTISHIM_ENTRY(LowerThreadPriority)
  238. MULTISHIM_ENTRY(MoveIniToRegistry)
  239. MULTISHIM_ENTRY(MoveWinInitRenameToReg)
  240. MULTISHIM_ENTRY(NullHwndInMessageBox)
  241. MULTISHIM_ENTRY(PaletteRestore)
  242. MULTISHIM_ENTRY(PopulateDefaultHKCUSettings)
  243. MULTISHIM_ENTRY(PropagateProcessHistory)
  244. MULTISHIM_ENTRY(RecopyExeFromCD)
  245. MULTISHIM_ENTRY(RedirectDBCSTempPath)
  246. MULTISHIM_ENTRY(RedirectEXE)
  247. MULTISHIM_ENTRY(RedirectWindowsDirToSystem32)
  248. MULTISHIM_ENTRY(RemoveBroadcastPostMessage)
  249. MULTISHIM_ENTRY(RemoveDDEFlagFromShellExecuteEx)
  250. MULTISHIM_ENTRY(RemoveInvalidW2KWindowStyles)
  251. MULTISHIM_ENTRY(RemoveIpFromMsInfoCommandLine)
  252. MULTISHIM_ENTRY(RemoveNoBufferingFlagFromCreateFile)
  253. MULTISHIM_ENTRY(RemoveOverlappedFlagFromCreateFile)
  254. MULTISHIM_ENTRY(RemoveReadOnlyAttribute)
  255. MULTISHIM_ENTRY(RestoreSystemCursors)
  256. MULTISHIM_ENTRY(SearchPathInAppPaths)
  257. MULTISHIM_ENTRY(SetEnvironmentVariable)
  258. MULTISHIM_ENTRY(StackSwap)
  259. MULTISHIM_ENTRY(TerminateExe)
  260. MULTISHIM_ENTRY(TrimVersionInfo)
  261. MULTISHIM_ENTRY(UnMirrorImageList)
  262. MULTISHIM_ENTRY(WaveOutUsePreferredDevice)
  263. MULTISHIM_ENTRY(WinG32SysToSys32)
  264. CALL_MULTISHIM_NOTIFY_FUNCTION()
  265. MULTISHIM_END()