From 888d82b5716f64101fe358c0fa8d5a18f3287257 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 6 Sep 2016 14:06:15 +0200 Subject: [PATCH] Remove Sleep(500) with global hook - was causing process creation stalls * This was for no good reason anyway. You absolutely shouldn't be creating threads in DllMain... but if you do, don't delay return from it to wait on those threads, as they won't even start until you've returned. Ooops. --- renderdocshim/renderdocshim.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/renderdocshim/renderdocshim.cpp b/renderdocshim/renderdocshim.cpp index 3eaeabd3c..8c29055c8 100644 --- a/renderdocshim/renderdocshim.cpp +++ b/renderdocshim/renderdocshim.cpp @@ -128,7 +128,7 @@ void CheckHook() else { LOGPRINT(L"renderdocshim: NOT Hooking into '"); - LOGPRINT(data->exepath); + LOGPRINT(exepath); LOGPRINT(L"', based on '"); LOGPRINT(data->pathmatchstring); LOGPRINT(L"'\n"); @@ -165,11 +165,6 @@ BOOL APIENTRY dll_entry(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpRese // create a thread so that we can perform more complex actions (DllMain must be minimal // in size, even this is a bit dodgy). CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&CheckHookThread, (LPVOID)hModule, 0, NULL); - - // Sleep on this thread a bit, as we want to call CheckHook() before any real work is done. - // Note it is important we don't try to *synchronise* on CheckHookThread, as that can easily - // cause deadlocks, crashes, etc. - Sleep(500); } return TRUE;