MemArena: Name shared memory handle

Assign a name to the CreateFileMapping handle on Win32 so third party
applications can read from Dolphin's memory and integrate with the
current emulation.

Built and tested, multiple sessions are still possible without
collisions.
This commit is contained in:
Dane Z. Bush 2017-09-30 14:59:07 -04:00 committed by Léo Lam
parent 90ca2e8042
commit 4dfe6c0875
1 changed files with 2 additions and 2 deletions

View File

@ -55,8 +55,8 @@ static int AshmemCreateFileMapping(const char* name, size_t size)
void MemArena::GrabSHMSegment(size_t size) void MemArena::GrabSHMSegment(size_t size)
{ {
#ifdef _WIN32 #ifdef _WIN32
hMemoryMapping = hMemoryMapping = CreateFileMapping(INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE, 0,
CreateFileMapping(INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE, 0, (DWORD)(size), nullptr); static_cast<DWORD>(size), L"Dolphin-emu");
#elif defined(ANDROID) #elif defined(ANDROID)
fd = AshmemCreateFileMapping("Dolphin-emu", size); fd = AshmemCreateFileMapping("Dolphin-emu", size);
if (fd < 0) if (fd < 0)