win-capture: Use full app obj name for keepalive mutex

Ensures that the UWP program can open the keepalive mutex to check to
see whether OBS is still alive.  Fixes a bug where UWP programs wouldn't
capture.
This commit is contained in:
jp9000
2020-03-10 06:06:23 -07:00
parent 432017b2c9
commit c76426c5bd
4 changed files with 42 additions and 1 deletions

View File

@@ -676,7 +676,9 @@ static inline bool init_keepalive(struct game_capture *gc)
wchar_t new_name[64];
swprintf(new_name, 64, WINDOW_HOOK_KEEPALIVE L"%lu", gc->process_id);
gc->keepalive_mutex = CreateMutexW(NULL, false, new_name);
gc->keepalive_mutex = gc->is_app
? create_app_mutex(gc->app_sid, new_name)
: CreateMutexW(NULL, false, new_name);
if (!gc->keepalive_mutex) {
warn("Failed to create keepalive mutex: %lu", GetLastError());
return false;