https://bugs.winehq.org/show_bug.cgi?id=54015
Bug ID: 54015 Summary: Accessing shared memory from Linux Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: kernel32 Assignee: wine-bugs@winehq.org Reporter: berarma@hotmail.com Distribution: ---
Some Windows games and applications share some internals through shared memory with external tools. Shared memory is preferred over sockets because it adds no overhead with no latency.
It's mostly used in driving and flying simulators to provide visual overlays, data on additional displays, telemetry, rig movement, etc. from external tools. There's also scientific apps using it for similar purposes or general inter-process communication.
It's common to use tagged shared memory blocks that external tools can then access using the already known tag.
Here's an example from a Python application for rFactor 2:
self._rf2_tele = mmap.mmap(0, ctypes.sizeof(rF2Telemetry), f"$rFactor2SMMP_Telemetry${input_pid}") self._rf2_scor = mmap.mmap(0, ctypes.sizeof(rF2Scoring), f"$rFactor2SMMP_Scoring${input_pid}") self._rf2_ext = mmap.mmap(0, ctypes.sizeof(rF2Extended), f"$rFactor2SMMP_Extended${input_pid}") self._rf2_ffb = mmap.mmap(0, ctypes.sizeof(rF2ForceFeedback), "$rFactor2SMMP_ForceFeedback$")
Allowing these shared memory blocks to be accessed from Linux would allow us to port some of these tools or even implement or own.
Then these tools could access resources or hardware that isn't available from inside the Wine prefix. Some of these tools also fail to run on Wine.
Since I guess Wine is already using Linux shared memory mechanism to implement Windows shared memory, the blocks are already available at /dev/shm but they use generic names that can't be associated to the tag used on Windows.
Having these shared memory blocks created in the prefix directory with a name containing the tag used on creation would allow us to use it from our native applications. Or any other way to find them using the tags used on Windows.
Thanks for your attention.