From 72e770458f7dda648ebc80545bf07e72875f839a Mon Sep 17 00:00:00 2001 From: jp9000 Date: Thu, 27 Feb 2020 05:14:48 -0800 Subject: [PATCH] win-capture: Use full DLL path for inject helper The inject helper should be able to specify the full path rather than assume the path of the hook DLL. This change allows us to modify the hook's location. This needs to be done because the hook needs to be relocated to ProgramData to prevent the possibility of multiple Vulkan capture hooks. --- plugins/win-capture/game-capture.c | 2 +- plugins/win-capture/inject-helper/inject-helper.c | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/plugins/win-capture/game-capture.c b/plugins/win-capture/game-capture.c index a47f4912e..fb28336f1 100644 --- a/plugins/win-capture/game-capture.c +++ b/plugins/win-capture/game-capture.c @@ -930,7 +930,7 @@ static inline bool inject_hook(struct game_capture *gc) } else { info("using helper (%s hook)", use_anticheat(gc) ? "compatibility" : "direct"); - success = create_inject_process(gc, inject_path, hook_dll); + success = create_inject_process(gc, inject_path, hook_path); } cleanup: diff --git a/plugins/win-capture/inject-helper/inject-helper.c b/plugins/win-capture/inject-helper/inject-helper.c index e35042b48..636350ce6 100644 --- a/plugins/win-capture/inject-helper/inject-helper.c +++ b/plugins/win-capture/inject-helper/inject-helper.c @@ -109,12 +109,7 @@ int main(int argc, char *argv_ansi[]) if (argv && argc == 4) { DWORD size = GetModuleFileNameW(NULL, dll_path, MAX_PATH); if (size) { - wchar_t *name_start = wcsrchr(dll_path, '\\'); - if (name_start) { - *(++name_start) = 0; - wcscpy(name_start, argv[1]); - ret = inject_helper(argv, dll_path); - } + ret = inject_helper(argv, argv[1]); } } LocalFree(argv);