Writable shared memory is unacceptable, but as long as it's read-only from the client there's no problem in principle.
Excellent, thanks Alexandre.
I'm attaching my current shared memory diff. It uses shm_open + mmap in wineserver to map the shared memory area read/write, and shm_open + NtCreateSection + NtMapViewOfSection in wine to map read only. A thread is run in wineserver which does a clock_nanosleep to set the times without drift.
The wineserver code appears to work, and successfully writes to shared memory. The wine code fails in NtMapViewOfSection with error C0000018, which is STATUS_CONFLICTING_ADDRESSES. Can someone who understands NtMapViewOfSection look at my code and tell me if I've done something stupid? I thought there might be code buried in NtMapViewOfSection which tries to reserve that code block, but I didn't see it when I looked.
Some notes:
I didn't use CreateFileMapping/MapViewOfFile because that lives in kernel32.dll, so I pulled the code in and called NtCreateSection/NtMapViewOfSection directly.
I also had to pull out all of the ntdll code which writes to USER_SHARED_DATA, and move that to wineserver.
I had to link ntdll and wineserver against -lrt; this should of course be done more clealy via configure.
Finally, the mmap call in wineserver only succeeds if I pass in a candidate address; if I pass in NULL, it fails with 'Operation not permitted'.
cheers,
Joey