Merge pull request #1871 from VodBox/game-window-check

win-capture: Fix hook collisions with multiple game captures
This commit is contained in:
Jim
2020-02-28 23:47:48 -08:00
committed by GitHub
2 changed files with 12 additions and 6 deletions

View File

@@ -1251,8 +1251,13 @@ static inline enum capture_result init_capture_data(struct game_capture *gc)
CloseHandle(gc->hook_data_map);
gc->hook_data_map = open_map_plus_id(gc, SHMEM_TEXTURE,
gc->global_hook_info->map_id);
wchar_t name[64];
_snwprintf(name, 64, L"%s_%d_", SHMEM_TEXTURE,
(uint32_t)(uintptr_t)gc->window);
gc->hook_data_map =
open_map_plus_id(gc, name, gc->global_hook_info->map_id);
if (!gc->hook_data_map) {
DWORD error = GetLastError();
if (error == 2) {