mirror of https://github.com/tongzx/nt5src
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
288 lines
9.3 KiB
/*++
|
|
|
|
Copyright (c) 2000 Microsoft Corporation
|
|
|
|
Module Name:
|
|
|
|
Main.cpp
|
|
|
|
Abstract:
|
|
|
|
|
|
Notes:
|
|
|
|
History:
|
|
|
|
15/11/2000 clupu Created
|
|
11/30/2000 a-brienw modified for beginning of misc shim
|
|
|
|
--*/
|
|
|
|
#include "precomp.h"
|
|
#include "ShimHookMacro.h"
|
|
|
|
DECLARE_SHIM(AliasDXDC)
|
|
DECLARE_SHIM(CorrectACMArgs)
|
|
DECLARE_SHIM(CorrectACMStreamOpen)
|
|
DECLARE_SHIM(CorrectActiveMoviePath)
|
|
DECLARE_SHIM(CorrectCreateIcon)
|
|
DECLARE_SHIM(CorrectCreateSurface)
|
|
DECLARE_SHIM(CorrectFarEastFont)
|
|
DECLARE_SHIM(CorrectFilePathInSetDlgItemText)
|
|
DECLARE_SHIM(CorrectFilePathsUninstall)
|
|
DECLARE_SHIM(CorrectOpenFileExclusive)
|
|
DECLARE_SHIM(CorrectVerInstallFile)
|
|
DECLARE_SHIM(CUASAppFix)
|
|
DECLARE_SHIM(CUASDisableCicero)
|
|
DECLARE_SHIM(DelayDllInit)
|
|
DECLARE_SHIM(DelayShowGroup)
|
|
DECLARE_SHIM(DelayWin95VersionLie)
|
|
DECLARE_SHIM(DelayWinMMCallback)
|
|
DECLARE_SHIM(DeleteSpecifiedFiles)
|
|
DECLARE_SHIM(DeRandomizeExeName)
|
|
DECLARE_SHIM(DisableBoostThread)
|
|
DECLARE_SHIM(DisableFilterKeys)
|
|
DECLARE_SHIM(DisableScreenSaver)
|
|
DECLARE_SHIM(DisableStickyKeys)
|
|
|
|
#ifndef SHIM_WIN2K
|
|
DECLARE_SHIM(DisableThemes)
|
|
#endif // SHIM_WIN2K
|
|
|
|
DECLARE_SHIM(DisableW2KOwnerDrawButtonStates)
|
|
DECLARE_SHIM(EmptyClipboardtoSet)
|
|
DECLARE_SHIM(EmulateGetStdHandle)
|
|
DECLARE_SHIM(EmulateGetStringType)
|
|
DECLARE_SHIM(EmulateLZHandles)
|
|
DECLARE_SHIM(EnlargeGetObjectBufferSize)
|
|
DECLARE_SHIM(ExtractAssociatedIcon)
|
|
DECLARE_SHIM(FailCloseProfileUserMapping)
|
|
DECLARE_SHIM(FailGetStdHandle)
|
|
DECLARE_SHIM(FailObsoleteShellAPIs)
|
|
DECLARE_SHIM(FailOpenFile)
|
|
DECLARE_SHIM(FakeThemeMetrics)
|
|
DECLARE_SHIM(FilterNetworkResources)
|
|
DECLARE_SHIM(FixServiceStartupCircularDependency)
|
|
DECLARE_SHIM(Force640x480x8)
|
|
DECLARE_SHIM(Force640x480x16)
|
|
DECLARE_SHIM(ForceAdminAccess)
|
|
DECLARE_SHIM(ForceAnsiWindowProc)
|
|
DECLARE_SHIM(ForceAppendMenuSuccess)
|
|
DECLARE_SHIM(ForceApplicationFocus)
|
|
DECLARE_SHIM(ForceAVIWindow)
|
|
DECLARE_SHIM(ForceDefaultSystemPaletteEntries)
|
|
DECLARE_SHIM(ForceDirectDrawEmulation)
|
|
DECLARE_SHIM(ForceDirectDrawWait)
|
|
DECLARE_SHIM(ForceDisplayMode)
|
|
DECLARE_SHIM(ForceSeparateVDM)
|
|
DECLARE_SHIM(ForceSimpleWindow)
|
|
DECLARE_SHIM(ForceTemporaryModeChange)
|
|
DECLARE_SHIM(ForceWorkingDirectoryToEXEPath)
|
|
DECLARE_SHIM(FUSBadApplicationType1)
|
|
DECLARE_SHIM(FUSBadApplicationType2)
|
|
DECLARE_SHIM(FUSBadApplicationType3)
|
|
DECLARE_SHIM(FUSBadApplicationType4)
|
|
DECLARE_SHIM(GlobalMemoryStatusLie)
|
|
DECLARE_SHIM(HandleDBCSUserName)
|
|
DECLARE_SHIM(HandleDBCSUserName2)
|
|
DECLARE_SHIM(HeapClearAllocation)
|
|
DECLARE_SHIM(HeapDelayLocalFree)
|
|
DECLARE_SHIM(HeapForceGrowable)
|
|
DECLARE_SHIM(HeapIgnoreMoveable)
|
|
DECLARE_SHIM(HeapLookasideFree)
|
|
DECLARE_SHIM(HeapPadAllocation)
|
|
DECLARE_SHIM(HeapValidateFrees)
|
|
DECLARE_SHIM(HideCursor)
|
|
DECLARE_SHIM(HideTaskBar)
|
|
DECLARE_SHIM(IgnoreAltTab)
|
|
DECLARE_SHIM(IgnoreCoCreateInstance)
|
|
DECLARE_SHIM(IgnoreCRTExit)
|
|
DECLARE_SHIM(IgnoreDebugOutput)
|
|
DECLARE_SHIM(IgnoreFreeLibrary)
|
|
DECLARE_SHIM(IgnoreHungAppPaint)
|
|
DECLARE_SHIM(IgnoreMCIStop)
|
|
DECLARE_SHIM(IgnoreMessageBox)
|
|
DECLARE_SHIM(IgnoreNoModeChange)
|
|
DECLARE_SHIM(IgnoreOemToChar)
|
|
DECLARE_SHIM(IgnoreSysColChanges)
|
|
DECLARE_SHIM(IgnoreTAPIDisconnect)
|
|
DECLARE_SHIM(IgnoreVBOverflow)
|
|
DECLARE_SHIM(IgnoreZeroMoveWindow)
|
|
DECLARE_SHIM(InjectDll)
|
|
DECLARE_SHIM(KeepWindowOnMonitor)
|
|
DECLARE_SHIM(LazyReleaseDC)
|
|
DECLARE_SHIM(LimitFindFile)
|
|
DECLARE_SHIM(LoadComctl32Version5)
|
|
DECLARE_SHIM(LoadLibraryCWD)
|
|
DECLARE_SHIM(LowerThreadPriority)
|
|
DECLARE_SHIM(MoveIniToRegistry)
|
|
DECLARE_SHIM(MoveWinInitRenameToReg)
|
|
DECLARE_SHIM(NullHwndInMessageBox)
|
|
DECLARE_SHIM(PaletteRestore)
|
|
DECLARE_SHIM(PopulateDefaultHKCUSettings)
|
|
DECLARE_SHIM(PropagateProcessHistory)
|
|
DECLARE_SHIM(RecopyExeFromCD)
|
|
DECLARE_SHIM(RedirectDBCSTempPath)
|
|
DECLARE_SHIM(RedirectEXE)
|
|
DECLARE_SHIM(RedirectWindowsDirToSystem32)
|
|
DECLARE_SHIM(RemoveBroadcastPostMessage)
|
|
DECLARE_SHIM(RemoveDDEFlagFromShellExecuteEx)
|
|
DECLARE_SHIM(RemoveInvalidW2KWindowStyles)
|
|
DECLARE_SHIM(RemoveIpFromMsInfoCommandLine)
|
|
DECLARE_SHIM(RemoveNoBufferingFlagFromCreateFile)
|
|
DECLARE_SHIM(RemoveOverlappedFlagFromCreateFile)
|
|
DECLARE_SHIM(RemoveReadOnlyAttribute)
|
|
DECLARE_SHIM(RestoreSystemCursors)
|
|
DECLARE_SHIM(SearchPathInAppPaths)
|
|
DECLARE_SHIM(SetEnvironmentVariable)
|
|
DECLARE_SHIM(StackSwap)
|
|
DECLARE_SHIM(TerminateExe)
|
|
DECLARE_SHIM(TrimVersionInfo)
|
|
DECLARE_SHIM(UnMirrorImageList)
|
|
DECLARE_SHIM(WaveOutUsePreferredDevice)
|
|
DECLARE_SHIM(WinG32SysToSys32)
|
|
|
|
|
|
VOID MULTISHIM_NOTIFY_FUNCTION()(DWORD fdwReason)
|
|
{
|
|
switch (fdwReason)
|
|
{
|
|
case DLL_PROCESS_ATTACH:
|
|
DPF("AcGenral", eDbgLevelSpew, "General Purpose Shims initialized.");
|
|
break;
|
|
|
|
case DLL_PROCESS_DETACH:
|
|
DPF("AcGenral", eDbgLevelSpew, "General Purpose Shims uninitialized.");
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
MULTISHIM_BEGIN()
|
|
|
|
MULTISHIM_ENTRY(AliasDXDC)
|
|
MULTISHIM_ENTRY(CorrectACMArgs)
|
|
MULTISHIM_ENTRY(CorrectACMStreamOpen)
|
|
MULTISHIM_ENTRY(CorrectActiveMoviePath)
|
|
MULTISHIM_ENTRY(CorrectCreateIcon)
|
|
MULTISHIM_ENTRY(CorrectCreateSurface)
|
|
MULTISHIM_ENTRY(CorrectFarEastFont)
|
|
MULTISHIM_ENTRY(CorrectFilePathInSetDlgItemText)
|
|
MULTISHIM_ENTRY(CorrectFilePathsUninstall)
|
|
MULTISHIM_ENTRY(CorrectOpenFileExclusive)
|
|
MULTISHIM_ENTRY(CorrectVerInstallFile)
|
|
MULTISHIM_ENTRY(CUASAppFix)
|
|
MULTISHIM_ENTRY(CUASDisableCicero)
|
|
MULTISHIM_ENTRY(DelayDllInit)
|
|
MULTISHIM_ENTRY(DelayShowGroup)
|
|
MULTISHIM_ENTRY(DelayWin95VersionLie)
|
|
MULTISHIM_ENTRY(DelayWinMMCallback)
|
|
MULTISHIM_ENTRY(DeleteSpecifiedFiles)
|
|
MULTISHIM_ENTRY(DeRandomizeExeName)
|
|
MULTISHIM_ENTRY(DisableBoostThread)
|
|
MULTISHIM_ENTRY(DisableFilterKeys)
|
|
MULTISHIM_ENTRY(DisableScreenSaver)
|
|
MULTISHIM_ENTRY(DisableStickyKeys)
|
|
|
|
#ifndef SHIM_WIN2K
|
|
MULTISHIM_ENTRY(DisableThemes)
|
|
#endif // SHIM_WIN2K
|
|
|
|
MULTISHIM_ENTRY(DisableW2KOwnerDrawButtonStates)
|
|
MULTISHIM_ENTRY(EmptyClipboardtoSet)
|
|
MULTISHIM_ENTRY(EmulateGetStdHandle)
|
|
MULTISHIM_ENTRY(EmulateGetStringType)
|
|
MULTISHIM_ENTRY(EmulateLZHandles)
|
|
MULTISHIM_ENTRY(EnlargeGetObjectBufferSize)
|
|
MULTISHIM_ENTRY(ExtractAssociatedIcon)
|
|
MULTISHIM_ENTRY(FailCloseProfileUserMapping)
|
|
MULTISHIM_ENTRY(FailGetStdHandle)
|
|
MULTISHIM_ENTRY(FailObsoleteShellAPIs)
|
|
MULTISHIM_ENTRY(FailOpenFile)
|
|
MULTISHIM_ENTRY(FakeThemeMetrics)
|
|
MULTISHIM_ENTRY(FilterNetworkResources)
|
|
MULTISHIM_ENTRY(FixServiceStartupCircularDependency)
|
|
MULTISHIM_ENTRY(Force640x480x8)
|
|
MULTISHIM_ENTRY(Force640x480x16)
|
|
MULTISHIM_ENTRY(ForceAdminAccess)
|
|
MULTISHIM_ENTRY(ForceAnsiWindowProc)
|
|
MULTISHIM_ENTRY(ForceAppendMenuSuccess)
|
|
MULTISHIM_ENTRY(ForceApplicationFocus)
|
|
MULTISHIM_ENTRY(ForceAVIWindow)
|
|
MULTISHIM_ENTRY(ForceDefaultSystemPaletteEntries)
|
|
MULTISHIM_ENTRY(ForceDirectDrawEmulation)
|
|
MULTISHIM_ENTRY(ForceDirectDrawWait)
|
|
MULTISHIM_ENTRY(ForceDisplayMode)
|
|
MULTISHIM_ENTRY(ForceSeparateVDM)
|
|
MULTISHIM_ENTRY(ForceSimpleWindow)
|
|
MULTISHIM_ENTRY(ForceTemporaryModeChange)
|
|
MULTISHIM_ENTRY(ForceWorkingDirectoryToEXEPath)
|
|
MULTISHIM_ENTRY(FUSBadApplicationType1)
|
|
MULTISHIM_ENTRY(FUSBadApplicationType2)
|
|
MULTISHIM_ENTRY(FUSBadApplicationType3)
|
|
MULTISHIM_ENTRY(FUSBadApplicationType4)
|
|
MULTISHIM_ENTRY(GlobalMemoryStatusLie)
|
|
MULTISHIM_ENTRY(HandleDBCSUserName)
|
|
MULTISHIM_ENTRY(HandleDBCSUserName2)
|
|
MULTISHIM_ENTRY(HeapClearAllocation)
|
|
MULTISHIM_ENTRY(HeapDelayLocalFree)
|
|
MULTISHIM_ENTRY(HeapForceGrowable)
|
|
MULTISHIM_ENTRY(HeapIgnoreMoveable)
|
|
MULTISHIM_ENTRY(HeapLookasideFree)
|
|
MULTISHIM_ENTRY(HeapPadAllocation)
|
|
MULTISHIM_ENTRY(HeapValidateFrees)
|
|
MULTISHIM_ENTRY(HideCursor)
|
|
MULTISHIM_ENTRY(HideTaskBar)
|
|
MULTISHIM_ENTRY(IgnoreAltTab)
|
|
MULTISHIM_ENTRY(IgnoreCoCreateInstance)
|
|
MULTISHIM_ENTRY(IgnoreCRTExit)
|
|
MULTISHIM_ENTRY(IgnoreDebugOutput)
|
|
MULTISHIM_ENTRY(IgnoreFreeLibrary)
|
|
MULTISHIM_ENTRY(IgnoreHungAppPaint)
|
|
MULTISHIM_ENTRY(IgnoreMCIStop)
|
|
MULTISHIM_ENTRY(IgnoreMessageBox)
|
|
MULTISHIM_ENTRY(IgnoreNoModeChange)
|
|
MULTISHIM_ENTRY(IgnoreOemToChar)
|
|
MULTISHIM_ENTRY(IgnoreSysColChanges)
|
|
MULTISHIM_ENTRY(IgnoreTAPIDisconnect)
|
|
MULTISHIM_ENTRY(IgnoreVBOverflow)
|
|
MULTISHIM_ENTRY(IgnoreZeroMoveWindow)
|
|
MULTISHIM_ENTRY(InjectDll)
|
|
MULTISHIM_ENTRY(KeepWindowOnMonitor)
|
|
MULTISHIM_ENTRY(LazyReleaseDC)
|
|
MULTISHIM_ENTRY(LimitFindFile)
|
|
MULTISHIM_ENTRY(LoadComctl32Version5)
|
|
MULTISHIM_ENTRY(LoadLibraryCWD)
|
|
MULTISHIM_ENTRY(LowerThreadPriority)
|
|
MULTISHIM_ENTRY(MoveIniToRegistry)
|
|
MULTISHIM_ENTRY(MoveWinInitRenameToReg)
|
|
MULTISHIM_ENTRY(NullHwndInMessageBox)
|
|
MULTISHIM_ENTRY(PaletteRestore)
|
|
MULTISHIM_ENTRY(PopulateDefaultHKCUSettings)
|
|
MULTISHIM_ENTRY(PropagateProcessHistory)
|
|
MULTISHIM_ENTRY(RecopyExeFromCD)
|
|
MULTISHIM_ENTRY(RedirectDBCSTempPath)
|
|
MULTISHIM_ENTRY(RedirectEXE)
|
|
MULTISHIM_ENTRY(RedirectWindowsDirToSystem32)
|
|
MULTISHIM_ENTRY(RemoveBroadcastPostMessage)
|
|
MULTISHIM_ENTRY(RemoveDDEFlagFromShellExecuteEx)
|
|
MULTISHIM_ENTRY(RemoveInvalidW2KWindowStyles)
|
|
MULTISHIM_ENTRY(RemoveIpFromMsInfoCommandLine)
|
|
MULTISHIM_ENTRY(RemoveNoBufferingFlagFromCreateFile)
|
|
MULTISHIM_ENTRY(RemoveOverlappedFlagFromCreateFile)
|
|
MULTISHIM_ENTRY(RemoveReadOnlyAttribute)
|
|
MULTISHIM_ENTRY(RestoreSystemCursors)
|
|
MULTISHIM_ENTRY(SearchPathInAppPaths)
|
|
MULTISHIM_ENTRY(SetEnvironmentVariable)
|
|
MULTISHIM_ENTRY(StackSwap)
|
|
MULTISHIM_ENTRY(TerminateExe)
|
|
MULTISHIM_ENTRY(TrimVersionInfo)
|
|
MULTISHIM_ENTRY(UnMirrorImageList)
|
|
MULTISHIM_ENTRY(WaveOutUsePreferredDevice)
|
|
MULTISHIM_ENTRY(WinG32SysToSys32)
|
|
|
|
CALL_MULTISHIM_NOTIFY_FUNCTION()
|
|
|
|
MULTISHIM_END()
|