Abort hook DLLs on startup error

This commit is contained in:
Tau 2019-11-05 18:03:24 -05:00
parent bf90450539
commit a87b8f72fa
4 changed files with 99 additions and 15 deletions

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;
HRESULT hr;
dprintf("--- Begin chuni_pre_startup ---\n"); dprintf("--- Begin chuni_pre_startup ---\n");
@ -54,15 +55,33 @@ static DWORD CALLBACK chuni_pre_startup(void)
/* Initialize emulation hooks */ /* Initialize emulation hooks */
platform_hook_init( hr = platform_hook_init(
&chuni_hook_cfg.platform, &chuni_hook_cfg.platform,
"SDBT", "SDBT",
"AAV1", "AAV1",
chuni_hook_mod); chuni_hook_mod);
amex_hook_init(&chuni_hook_cfg.amex, chunithm_jvs_init); if (FAILED(hr)) {
slider_hook_init(&chuni_hook_cfg.slider); return EXIT_FAILURE;
sg_reader_hook_init(&chuni_hook_cfg.aime, 12); }
hr = amex_hook_init(&chuni_hook_cfg.amex, chunithm_jvs_init);
if (FAILED(hr)) {
return EXIT_FAILURE;
}
hr = slider_hook_init(&chuni_hook_cfg.slider);
if (FAILED(hr)) {
return EXIT_FAILURE;
}
hr = sg_reader_hook_init(&chuni_hook_cfg.aime, 12);
if (FAILED(hr)) {
return EXIT_FAILURE;
}
/* Initialize debug helpers */ /* Initialize debug helpers */

View File

@ -27,6 +27,8 @@ static struct diva_hook_config diva_hook_cfg;
static DWORD CALLBACK diva_pre_startup(void) static DWORD CALLBACK diva_pre_startup(void)
{ {
HRESULT hr;
dprintf("--- Begin diva_pre_startup ---\n"); dprintf("--- Begin diva_pre_startup ---\n");
/* Config load */ /* Config load */
@ -39,15 +41,33 @@ static DWORD CALLBACK diva_pre_startup(void)
/* Initialize emulation hooks */ /* Initialize emulation hooks */
platform_hook_init( hr = platform_hook_init(
&diva_hook_cfg.platform, &diva_hook_cfg.platform,
"SBZV", "SBZV",
"AAV0", "AAV0",
diva_hook_mod); diva_hook_mod);
amex_hook_init(&diva_hook_cfg.amex, diva_jvs_init); if (FAILED(hr)) {
sg_reader_hook_init(&diva_hook_cfg.aime, 10); return EXIT_FAILURE;
slider_hook_init(); }
hr = amex_hook_init(&diva_hook_cfg.amex, diva_jvs_init);
if (FAILED(hr)) {
return EXIT_FAILURE;
}
hr = sg_reader_hook_init(&diva_hook_cfg.aime, 10);
if (FAILED(hr)) {
return EXIT_FAILURE;
}
hr = slider_hook_init();
if (FAILED(hr)) {
return EXIT_FAILURE;
}
/* Initialize debug helpers */ /* Initialize debug helpers */

View File

@ -27,6 +27,8 @@ static struct idz_hook_config idz_hook_cfg;
static DWORD CALLBACK idz_pre_startup(void) static DWORD CALLBACK idz_pre_startup(void)
{ {
HRESULT hr;
dprintf("--- Begin idz_pre_startup ---\n"); dprintf("--- Begin idz_pre_startup ---\n");
/* Config load */ /* Config load */
@ -40,9 +42,27 @@ static DWORD CALLBACK idz_pre_startup(void)
/* Initialize emulation hooks */ /* Initialize emulation hooks */
platform_hook_init(&idz_hook_cfg.platform, "SDDF", "AAV2", idz_hook_mod); hr = platform_hook_init(
amex_hook_init(&idz_hook_cfg.amex, idz_jvs_init); &idz_hook_cfg.platform,
sg_reader_hook_init(&idz_hook_cfg.aime, 10); "SDDF",
"AAV2",
idz_hook_mod);
if (FAILED(hr)) {
return hr;
}
hr = amex_hook_init(&idz_hook_cfg.amex, idz_jvs_init);
if (FAILED(hr)) {
return hr;
}
hr = sg_reader_hook_init(&idz_hook_cfg.aime, 10);
if (FAILED(hr)) {
return hr;
}
/* Initialize debug helpers */ /* Initialize debug helpers */

View File

@ -22,6 +22,8 @@ static struct mu3_hook_config mu3_hook_cfg;
static DWORD CALLBACK mu3_pre_startup(void) static DWORD CALLBACK mu3_pre_startup(void)
{ {
HRESULT hr;
dprintf("--- Begin mu3_pre_startup ---\n"); dprintf("--- Begin mu3_pre_startup ---\n");
/* Load config */ /* Load config */
@ -34,10 +36,33 @@ static DWORD CALLBACK mu3_pre_startup(void)
/* Initialize emulation hooks */ /* Initialize emulation hooks */
platform_hook_init(&mu3_hook_cfg.platform, "SDDT", "AAV2", mu3_hook_mod); hr = platform_hook_init(
sg_reader_hook_init(&mu3_hook_cfg.aime, 1); &mu3_hook_cfg.platform,
vfd_hook_init(2); "SDDT",
mu3_io4_hook_init(); "AAV2",
mu3_hook_mod);
if (FAILED(hr)) {
return hr;
}
hr = sg_reader_hook_init(&mu3_hook_cfg.aime, 1);
if (FAILED(hr)) {
return hr;
}
hr = vfd_hook_init(2);
if (FAILED(hr)) {
return hr;
}
hr = mu3_io4_hook_init();
if (FAILED(hr)) {
return hr;
}
/* Initialize debug helpers */ /* Initialize debug helpers */