From a72a762a8c8c562698c256cd4286aca5e80a5077 Mon Sep 17 00:00:00 2001 From: Robert Krawczyk Date: Tue, 26 Jan 2016 15:36:55 +0100 Subject: [PATCH] Delete obsolete file. --- d3d9ex/DirectInputModuleManager.h | 70 ------------------------------- 1 file changed, 70 deletions(-) delete mode 100644 d3d9ex/DirectInputModuleManager.h diff --git a/d3d9ex/DirectInputModuleManager.h b/d3d9ex/DirectInputModuleManager.h deleted file mode 100644 index 1914dd2..0000000 --- a/d3d9ex/DirectInputModuleManager.h +++ /dev/null @@ -1,70 +0,0 @@ -#pragma once - -#include - -#include -#include - -#include "Common.h" - -class DirectInputModuleManager : NonCopyable -{ -public: - HRESULT(WINAPI* DirectInput8Create)(HINSTANCE hinst, DWORD dwVersion, REFIID riidltf, LPVOID *ppvOut, LPUNKNOWN punkOuter); - HRESULT(WINAPI* DllCanUnloadNow)(void); - HRESULT(WINAPI* DllGetClassObject)(REFCLSID rclsid, REFIID riid, LPVOID FAR* ppv); - HRESULT(WINAPI* DllRegisterServer)(void); - HRESULT(WINAPI* DllUnregisterServer)(void); - - DirectInputModuleManager() - { - std::string loaded_module_path; - m_module = LoadLibrarySystem("dinput8.dll", &loaded_module_path); - - if (!m_module) - { - HRESULT hr = GetLastError(); - std::unique_ptr error_msg(new char[MAX_PATH]); - sprintf_s(error_msg.get(), MAX_PATH, "Cannot load \"%s\" error: 0x%x", loaded_module_path.c_str(), hr); - PrintLog(error_msg.get()); - MessageBoxA(NULL, error_msg.get(), "Error", MB_ICONERROR); - exit(hr); - } - else - { - PrintLog("Loaded \"%s\"", loaded_module_path.c_str()); - } - - GetProcAddress("DirectInput8Create", &DirectInput8Create); - GetProcAddress("DllCanUnloadNow", &DllCanUnloadNow); - GetProcAddress("DllGetClassObject", &DllGetClassObject); - GetProcAddress("DllRegisterServer", &DllRegisterServer); - GetProcAddress("DllUnregisterServer", &DllUnregisterServer); - } - - ~DirectInputModuleManager() - { - if (m_module) - { - std::string xinput_path; - ModulePath(&xinput_path, m_module); - PrintLog("Unloading %s", xinput_path.c_str()); - FreeLibrary(m_module); - } - } - - static DirectInputModuleManager& Get() - { - static DirectInputModuleManager instance; - return instance; - } - -private: - template - inline void GetProcAddress(const char* funcname, T* ppfunc) - { - *ppfunc = reinterpret_cast(::GetProcAddress(m_module, funcname)); - } - - HMODULE m_module; -}; \ No newline at end of file