diff --git a/source/modules/threadpoolfix.cpp b/source/modules/threadpoolfix.cpp index 351d59ac..6c7417e0 100644 --- a/source/modules/threadpoolfix.cpp +++ b/source/modules/threadpoolfix.cpp @@ -32,7 +32,8 @@ static int hook_CThreadPool_ExecuteToPriority(IThreadPool* pool, void* idx, void } #endif -#if ARCHITECTURE_IS_X86_64 +#define FILESYSTEM_FIX 0 // This fix was added to Gmod -> https://github.com/Facepunch/garrysmod-issues/issues/6031 +#if ARCHITECTURE_IS_X86_64 && FILESYSTEM_FIX static Detouring::Hook detour_CThreadPool_Start; Symbols::CBaseFileSystem_InitAsync func_CBaseFileSystem_InitAsync = NULL; Symbols::CBaseFileSystem_ShutdownAsync func_CBaseFileSystem_ShutdownAsync = NULL; @@ -62,6 +63,7 @@ void CThreadPoolFixModule::Init(CreateInterfaceFn* appfn, CreateInterfaceFn* gam Util::StartThreadPool(g_pThreadPool, startParams); } +#if FILESYSTEM_FIX if (func_CBaseFileSystem_InitAsync && func_CBaseFileSystem_ShutdownAsync && !g_pModuleManager.IsUsingGhostInj()) // Restart the threadpool to fix it. { if (g_pThreadPoolFixModule.InDebug()) @@ -71,6 +73,7 @@ void CThreadPoolFixModule::Init(CreateInterfaceFn* appfn, CreateInterfaceFn* gam func_CBaseFileSystem_InitAsync(g_pFullFileSystem); } #endif +#endif } void CThreadPoolFixModule::InitDetour(bool bPreServer) @@ -78,7 +81,7 @@ void CThreadPoolFixModule::InitDetour(bool bPreServer) SourceSDK::ModuleLoader libvstdlib_loader("vstdlib"); if (bPreServer) { -#if ARCHITECTURE_IS_X86_64 +#if ARCHITECTURE_IS_X86_64 && FILESYSTEM_FIX Detour::Create( &detour_CThreadPool_Start, "CThreadPool::Start", libvstdlib_loader.GetModule(), Symbols::CThreadPool_StartSym, diff --git a/source/modules/vprof.cpp b/source/modules/vprof.cpp index bf348024..2ebf5705 100644 --- a/source/modules/vprof.cpp +++ b/source/modules/vprof.cpp @@ -579,7 +579,7 @@ static void* hook_lj_BC_FUNCC(void* arg) // Find out the luajit function later. } #endif -#ifdef ARCHITECTURE_X86_64 +#if defined(ARCHITECTURE_X86_64) && 0 Detouring::Hook detour_ThreadGetCurrentId; ThreadId_t hook_ThreadGetCurrentId() { @@ -726,6 +726,7 @@ void CVProfModule::InitDetour(bool bPreServer) #endif #ifdef ARCHITECTURE_X86_64 +#if 0 // This bug was fixed in Gmod itself -> https://github.com/Facepunch/garrysmod-issues/issues/6019 Detour::Create( &detour_ThreadGetCurrentId, "ThreadGetCurrentId", tier0_loader.GetModule(), Symbols::ThreadGetCurrentIdSym, @@ -738,6 +739,7 @@ void CVProfModule::InitDetour(bool bPreServer) unsigned long int pthread_Id = ThreadGetCurrentId(); if (m_TargetThreadId != pthread_Id) Warning("[holylib - vprof] Failed to fix ThreadGetCurrentId! (vprof most likely won't work)\n"); +#endif Detour::Create( &detour_Msg, "Msg",