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:
@@ -53,6 +53,14 @@ wchar_t *get_app_sid(HANDLE process)
|
||||
static const wchar_t *path_format =
|
||||
L"\\Sessions\\%lu\\AppContainerNamedObjects\\%s\\%s";
|
||||
|
||||
HANDLE create_app_mutex(const wchar_t *sid, const wchar_t *name)
|
||||
{
|
||||
wchar_t path[MAX_PATH];
|
||||
DWORD session_id = WTSGetActiveConsoleSessionId();
|
||||
_snwprintf(path, MAX_PATH, path_format, session_id, sid, name);
|
||||
return nt_create_mutex(path);
|
||||
}
|
||||
|
||||
HANDLE open_app_mutex(const wchar_t *sid, const wchar_t *name)
|
||||
{
|
||||
wchar_t path[MAX_PATH];
|
||||
|
Reference in New Issue
Block a user