diff --git a/DDrawCompat/Dll/DDrawCompat.def b/DDrawCompat/Dll/DDrawCompat.def index bd7171c..b5df31a 100644 --- a/DDrawCompat/Dll/DDrawCompat.def +++ b/DDrawCompat/Dll/DDrawCompat.def @@ -23,4 +23,3 @@ EXPORTS RegisterSpecialCase ReleaseDDThreadLock SetAppCompatData - DirectInputCreateA diff --git a/DDrawCompat/Dll/DllMain.cpp b/DDrawCompat/Dll/DllMain.cpp index 4362b15..2153468 100644 --- a/DDrawCompat/Dll/DllMain.cpp +++ b/DDrawCompat/Dll/DllMain.cpp @@ -4,29 +4,26 @@ #include #include -#include "Common/Hook.h" -#include "Common/Log.h" -#include "Common/Time.h" -#include "D3dDdi/Hooks.h" -#include "DDraw/DirectDraw.h" -#include "DDraw/Hooks.h" -#include "Direct3d/Hooks.h" -#include "Dll/Procs.h" -#include "Gdi/Gdi.h" -#include "Gdi/VirtualScreen.h" -#include "Win32/DisplayMode.h" -#include "Win32/FontSmoothing.h" -#include "Win32/MsgHooks.h" -#include "Win32/Registry.h" - -struct IDirectInput; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include HRESULT WINAPI SetAppCompatData(DWORD, DWORD); namespace { HMODULE g_origDDrawModule = nullptr; - HMODULE g_origDInputModule = nullptr; void installHooks() { @@ -130,14 +127,12 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) return FALSE; } - if (!loadLibrary(systemDirectory, "ddraw.dll", g_origDDrawModule) || - !loadLibrary(systemDirectory, "dinput.dll", g_origDInputModule)) + if (!loadLibrary(systemDirectory, "ddraw.dll", g_origDDrawModule)) { return FALSE; } VISIT_ALL_PROCS(LOAD_ORIGINAL_PROC); - Dll::g_origProcs.DirectInputCreateA = GetProcAddress(g_origDInputModule, "DirectInputCreateA"); const BOOL disablePriorityBoost = TRUE; SetProcessPriorityBoost(GetCurrentProcess(), disablePriorityBoost); @@ -167,7 +162,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) D3dDdi::uninstallHooks(); Gdi::uninstallHooks(); Compat::unhookAllFunctions(); - FreeLibrary(g_origDInputModule); FreeLibrary(g_origDDrawModule); } Win32::FontSmoothing::setSystemSettingsForced(Win32::FontSmoothing::g_origSystemSettings); @@ -205,16 +199,6 @@ extern "C" HRESULT WINAPI DirectDrawCreateEx( return LOG_RESULT(CALL_ORIG_PROC(DirectDrawCreateEx)(lpGUID, lplpDD, iid, pUnkOuter)); } -extern "C" HRESULT WINAPI DirectInputCreateA( - HINSTANCE hinst, - DWORD dwVersion, - IDirectInput** lplpDirectInput, - LPUNKNOWN punkOuter) -{ - LOG_FUNC(__func__, hinst, dwVersion, lplpDirectInput, punkOuter); - return LOG_RESULT(CALL_ORIG_PROC(DirectInputCreateA)(hinst, dwVersion, lplpDirectInput, punkOuter)); -} - extern "C" HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) { LOG_FUNC(__func__, rclsid, riid, ppv); diff --git a/DDrawCompat/Dll/Procs.h b/DDrawCompat/Dll/Procs.h index 3bdd7d8..6b4b76c 100644 --- a/DDrawCompat/Dll/Procs.h +++ b/DDrawCompat/Dll/Procs.h @@ -39,7 +39,6 @@ namespace Dll struct Procs { VISIT_ALL_PROCS(ADD_FARPROC_MEMBER); - FARPROC DirectInputCreateA; }; extern Procs g_origProcs;