mu3hook/dllmain.c: fix hook initialization order to fix path hook

- If the Unity `LoadLibraryW` hook is done too early, then it somehow
  interferes with the other DLL and hook table IAT hooks. Workaround
  this by moving the Unity `LoadLibraryW` hook initialization after all
  other hooks are done.

- Also, correct the platform ID to the ALLS HX
This commit is contained in:
Felix Anderson 2020-03-23 07:31:58 +00:00
parent c037dd73e4
commit 776cf50bd0
Signed by untrusted user: felix
GPG Key ID: 69ADF8AEB6C8B5D1

View File

@ -35,14 +35,13 @@ static DWORD CALLBACK mu3_pre_startup(void)
gfx_hook_init(&mu3_hook_cfg.gfx);
serial_hook_init();
unity_hook_init();
/* Initialize emulation hooks */
hr = platform_hook_init(
&mu3_hook_cfg.platform,
"SDDT",
"AAV2",
"ACA1",
mu3_hook_mod);
if (FAILED(hr)) {
@ -67,6 +66,13 @@ static DWORD CALLBACK mu3_pre_startup(void)
return hr;
}
/* Initialize Unity native plugin DLL hooks
There seems to be an issue with other DLL hooks if `LoadLibraryW` is
hooked earlier in the `mu3hook` initialization. */
unity_hook_init();
/* Initialize debug helpers */
spike_hook_init(L".\\segatools.ini");