Developer knowledge network ยท moderated exchange

UnreliableCode Community

Developer Research, Reverse Engineering & Coding Community

Knowledge indexLive
4Categories
919Threads
2.8KPosts
Tutorial

High-Throughput Zero-Copy Shared Memory IPC using CreateFileMapping & MapViewOfFile [v2.4 Technical Discussion]

ptr_arithmetic
C++ Wizard
MEMBER
Rep: 162
Join Date: May 2018
Posts: 73
Thanks: 42
1 months ago ยท Jul 2, 2026 11:53 PM
#1

Transferring 240 FPS entity state buffers between external reader and overlay:

CPP
// Server Process
HANDLE hMap = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, sizeof(SharedGameState), "Local\\UC_GameState_Map");
auto* pSharedData = (SharedGameState*)MapViewOfFile(hMap, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(SharedGameState));

// Client Process
HANDLE hMapClient = OpenFileMappingA(FILE_MAP_READ, FALSE, "Local\\UC_GameState_Map");
auto* pClientView = (const SharedGameState*)MapViewOfFile(hMapClient, FILE_MAP_READ, 0, 0, sizeof(SharedGameState));

Zero kernel syscall overhead during data transmission: both processes read from the identical physical RAM page frame!

imgui_artisan
UI Designer
MEMBER
Rep: 202
Join Date: Apr 2019
Posts: 54
Thanks: 28
1 months ago ยท Jul 3, 2026 3:15 AM
#2

Shared memory mapped files provide sub-microsecond latency. Overlay runs at full 240Hz monitor refresh rate.

val_driver_guy
Driver Dev
MEMBER
Rep: 42
Join Date: May 2019
Posts: 24
Thanks: 37
1 months ago ยท Jul 4, 2026 1:11 AM
#3

Much faster than named pipes or local sockets.