diff --git a/chunihook/dllmain.c b/chunihook/dllmain.c index 6c1dcf78..b5434023 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; + HRESULT hr; dprintf("--- Begin chuni_pre_startup ---\n"); @@ -54,15 +55,33 @@ static DWORD CALLBACK chuni_pre_startup(void) /* Initialize emulation hooks */ - platform_hook_init( + hr = platform_hook_init( &chuni_hook_cfg.platform, "SDBT", "AAV1", chuni_hook_mod); - amex_hook_init(&chuni_hook_cfg.amex, chunithm_jvs_init); - slider_hook_init(&chuni_hook_cfg.slider); - sg_reader_hook_init(&chuni_hook_cfg.aime, 12); + if (FAILED(hr)) { + return EXIT_FAILURE; + } + + 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 */ diff --git a/divahook/dllmain.c b/divahook/dllmain.c index 59e11ca5..a194f84e 100644 --- a/divahook/dllmain.c +++ b/divahook/dllmain.c @@ -27,6 +27,8 @@ static struct diva_hook_config diva_hook_cfg; static DWORD CALLBACK diva_pre_startup(void) { + HRESULT hr; + dprintf("--- Begin diva_pre_startup ---\n"); /* Config load */ @@ -39,15 +41,33 @@ static DWORD CALLBACK diva_pre_startup(void) /* Initialize emulation hooks */ - platform_hook_init( + hr = platform_hook_init( &diva_hook_cfg.platform, "SBZV", "AAV0", diva_hook_mod); - amex_hook_init(&diva_hook_cfg.amex, diva_jvs_init); - sg_reader_hook_init(&diva_hook_cfg.aime, 10); - slider_hook_init(); + if (FAILED(hr)) { + return EXIT_FAILURE; + } + + 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 */ diff --git a/idzhook/dllmain.c b/idzhook/dllmain.c index c02b991a..a54e4bd5 100644 --- a/idzhook/dllmain.c +++ b/idzhook/dllmain.c @@ -27,6 +27,8 @@ static struct idz_hook_config idz_hook_cfg; static DWORD CALLBACK idz_pre_startup(void) { + HRESULT hr; + dprintf("--- Begin idz_pre_startup ---\n"); /* Config load */ @@ -40,9 +42,27 @@ static DWORD CALLBACK idz_pre_startup(void) /* Initialize emulation hooks */ - platform_hook_init(&idz_hook_cfg.platform, "SDDF", "AAV2", idz_hook_mod); - amex_hook_init(&idz_hook_cfg.amex, idz_jvs_init); - sg_reader_hook_init(&idz_hook_cfg.aime, 10); + hr = platform_hook_init( + &idz_hook_cfg.platform, + "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 */ diff --git a/mu3hook/dllmain.c b/mu3hook/dllmain.c index 11a0fbca..c34bc51f 100644 --- a/mu3hook/dllmain.c +++ b/mu3hook/dllmain.c @@ -22,6 +22,8 @@ static struct mu3_hook_config mu3_hook_cfg; static DWORD CALLBACK mu3_pre_startup(void) { + HRESULT hr; + dprintf("--- Begin mu3_pre_startup ---\n"); /* Load config */ @@ -34,10 +36,33 @@ static DWORD CALLBACK mu3_pre_startup(void) /* Initialize emulation hooks */ - platform_hook_init(&mu3_hook_cfg.platform, "SDDT", "AAV2", mu3_hook_mod); - sg_reader_hook_init(&mu3_hook_cfg.aime, 1); - vfd_hook_init(2); - mu3_io4_hook_init(); + hr = platform_hook_init( + &mu3_hook_cfg.platform, + "SDDT", + "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 */