Skip to content
Permalink
Browse files

Use arch-specific shared memory regions in the Windows overlay.

Vtable offsetes is almost all that we store in the shared memory,
and they vary by architecture.

So, don't share the memory between arches. Instead, crate
arch-specific shared memory regions.
  • Loading branch information...
mkrautz committed Jan 23, 2015
1 parent 3a6c4f0 commit d6098796959ed24564af81da73b3f507fcc8c2f7
Showing with 9 additions and 1 deletion.
  1. +9 −1 overlay/lib.cpp
@@ -673,7 +673,15 @@ static bool dllmainProcAttachCheckProcessIsBlacklisted(char procname[], char *p)
static bool createSharedDataMap() {
DWORD dwSharedSize = sizeof(SharedData) + sizeof(Direct3D9Data) + sizeof(DXGIData) + sizeof(D3D10Data) + sizeof(D3D11Data);

hMapObject = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, dwSharedSize, "MumbleOverlayPrivate");
#if defined(_M_IX86)
const char *name = "MumbleOverlayPrivate-x86";
#elif defined(_M_X64)
const char *name = "MumbleOverlayPrivate-x64";
#else
# error Unsupported architecture
#endif

hMapObject = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, dwSharedSize, name);
if (hMapObject == NULL) {
ods("Lib: CreateFileMapping failed");
return false;

0 comments on commit d609879

Please sign in to comment.
You can’t perform that action at this time.