elast0ny / shared_memory

A Rust wrapper around native shared memory for Linux and Windows
380 stars 51 forks source link

0.12.2 can't access shared memory from another process on Windows #82

Closed bin-cat closed 2 years ago

bin-cat commented 2 years ago

Trying to open shared memory of third-party application that is created only as named object.

ShmemConf::new().os_id("TestNamedObject").open()

fails with OS error 2 (No such file or directory) because open_mapping tries to access non-existent %TEMP%\shared-memory-rs\TestNamedObject. It worked correctly in 0.11.

elast0ny commented 2 years ago

Thanks for submitting this issue. Like you said, this behaviour was introduced in 12.X on Windows in order to mimic how shared memory works on posix systems.

I agree that the crate should be able to handle shared memory mappings from external processes tho so a fix will have to be implemented to address this issue

elast0ny commented 2 years ago

This should now work on 0.12.3