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`.
This commit is contained in:
Felix Anderson 2021-02-09 02:18:37 +00:00 committed by Tau
parent 2432b32338
commit d2996c5271

View File

@ -30,6 +30,7 @@ static struct chuni_hook_config chuni_hook_cfg;
static DWORD CALLBACK chuni_pre_startup(void) static DWORD CALLBACK chuni_pre_startup(void)
{ {
HMODULE d3dc; HMODULE d3dc;
HMODULE dbghelp;
HRESULT hr; HRESULT hr;
dprintf("--- Begin chuni_pre_startup ---\n"); dprintf("--- Begin chuni_pre_startup ---\n");
@ -44,6 +45,16 @@ static DWORD CALLBACK chuni_pre_startup(void)
dprintf("Failed to load shader compiler!\n"); 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 */ /* Config load */
chuni_hook_config_load(&chuni_hook_cfg, L".\\segatools.ini"); chuni_hook_config_load(&chuni_hook_cfg, L".\\segatools.ini");