From c0df05d4181feb14567a648f122557e0d3f7bc0d Mon Sep 17 00:00:00 2001 From: s1lentq Date: Thu, 28 Jan 2016 06:01:30 +0600 Subject: [PATCH] Fix #15: ignore the dependence of hooks for hl.exe --- regamedll/hookers/main_mp.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/regamedll/hookers/main_mp.cpp b/regamedll/hookers/main_mp.cpp index 72b9ac68..35dfe65d 100644 --- a/regamedll/hookers/main_mp.cpp +++ b/regamedll/hookers/main_mp.cpp @@ -35,14 +35,17 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { if (fdwReason == DLL_PROCESS_ATTACH) { +#ifdef _WIN32 g_ReGameDLLRuntimeConfig.parseFromCommandLine(GetCommandLineA()); -#ifdef _WIN32 Module hlds_exe; - if (!FindModuleByName("hlds.exe", &hlds_exe)) - return (FALSE); + if (!GetModuleHandle("hl.exe")) + { + if (!FindModuleByName("hlds.exe", &hlds_exe)) + return (FALSE); - TestSuite_Init(NULL, &hlds_exe, NULL); + TestSuite_Init(NULL, &hlds_exe, NULL); + } #endif // _WIN32 } @@ -50,6 +53,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { } + return TRUE; }