소스 검색

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 년 전
부모
커밋
72e770458f
2개의 변경된 파일2개의 추가작업 그리고 7개의 파일을 삭제
  1. 1 1
      plugins/win-capture/game-capture.c
  2. 1 6
      plugins/win-capture/inject-helper/inject-helper.c

+ 1 - 1
plugins/win-capture/game-capture.c

@@ -930,7 +930,7 @@ static inline bool inject_hook(struct game_capture *gc)
 	} else {
 	} else {
 		info("using helper (%s hook)",
 		info("using helper (%s hook)",
 		     use_anticheat(gc) ? "compatibility" : "direct");
 		     use_anticheat(gc) ? "compatibility" : "direct");
-		success = create_inject_process(gc, inject_path, hook_dll);
+		success = create_inject_process(gc, inject_path, hook_path);
 	}
 	}
 
 
 cleanup:
 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) {
 	if (argv && argc == 4) {
 		DWORD size = GetModuleFileNameW(NULL, dll_path, MAX_PATH);
 		DWORD size = GetModuleFileNameW(NULL, dll_path, MAX_PATH);
 		if (size) {
 		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);
 	LocalFree(argv);