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 b73ded3597
commit fffc737df2

View File

@ -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");