win-capture: Open UWP named objects with helper functions

This detects whether the target process is a UWP process, and then uses
the open_app_* functions for mutexes/events/mapping.  Also slightly
refactors named object open functions.
This commit is contained in:
jp9000
2016-11-01 03:41:36 -07:00
parent aeb1d7ae1b
commit 926b9c5f96
3 changed files with 96 additions and 51 deletions

View File

@@ -34,13 +34,6 @@ static inline HANDLE create_event_plus_id(const wchar_t *name, DWORD id)
return create_event(new_name);
}
static inline HANDLE open_event_plus_id(const wchar_t *name, DWORD id)
{
wchar_t new_name[64];
_snwprintf(new_name, 64, L"%s%lu", name, id);
return open_event(new_name);
}
static inline HANDLE create_mutex_plus_id(const wchar_t *name, DWORD id)
{
wchar_t new_name[64];
@@ -48,13 +41,6 @@ static inline HANDLE create_mutex_plus_id(const wchar_t *name, DWORD id)
return create_mutex(new_name);
}
static inline HANDLE open_mutex_plus_id(const wchar_t *name, DWORD id)
{
wchar_t new_name[64];
_snwprintf(new_name, 64, L"%s%lu", name, id);
return open_mutex(new_name);
}
static inline bool object_signalled(HANDLE event)
{
if (!event)