From d2996c5271c8a0d77c8b1598ea394c5954c69e2c Mon Sep 17 00:00:00 2001 From: Felix Date: Tue, 9 Feb 2021 02:18:37 +0000 Subject: [PATCH] chunihook: Explicitly load dbghelp.dll so path hooks apply to it - This allows AMLib (in Chunithm and other games) to successfully initialize without requiring the game to be run as Administrator on first boot to create `C:\Users\AppUser\temp`. --- chunihook/dllmain.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/chunihook/dllmain.c b/chunihook/dllmain.c index b543402..1a7dc39 100644 --- a/chunihook/dllmain.c +++ b/chunihook/dllmain.c @@ -30,6 +30,7 @@ static struct chuni_hook_config chuni_hook_cfg; static DWORD CALLBACK chuni_pre_startup(void) { HMODULE d3dc; + HMODULE dbghelp; HRESULT hr; dprintf("--- Begin chuni_pre_startup ---\n"); @@ -44,6 +45,16 @@ static DWORD CALLBACK chuni_pre_startup(void) dprintf("Failed to load shader compiler!\n"); } + /* Pin dbghelp so the path hooks apply to it. */ + + dbghelp = LoadLibraryW(L"dbghelp.dll"); + + if (dbghelp != NULL) { + dprintf("Pinned debug helper library, hMod=%p\n", dbghelp); + } else { + dprintf("Failed to load debug helper library!\n"); + } + /* Config load */ chuni_hook_config_load(&chuni_hook_cfg, L".\\segatools.ini");