Browse Source

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.
jp9000 5 years ago
parent
commit
72e770458f

+ 1 - 1
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:

+ 1 - 6
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);