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

@@ -113,11 +113,3 @@ static inline HANDLE create_hook_info(DWORD id)
return CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE,
0, sizeof(struct hook_info), new_name);
}
static inline HANDLE open_hook_info(DWORD id)
{
wchar_t new_name[64];
_snwprintf(new_name, 64, L"%s%lu", SHMEM_HOOK_INFO, id);
return OpenFileMappingW(GC_MAPPING_FLAGS, false, new_name);
}