Shared memory access rights

Started by
2 comments, last by sleepytim 20 years, 8 months ago
Hi all, What I want to do is.. Share some memory between processes, but restrict write access to only one process. Im using CreateFileMapping to create the shared memory, but have no idea about security atributes etc :/ Is there any way to make it allow write/read access to the Creator of the File mapping and only read access to additional processes gaining access to it Thanks in advance
Advertisement
Look at the sample code in the MSDN article below, but instead of RegCreateKeyEx you would use CreateFileMapping.

http://msdn.microsoft.com/library/en-us/security/security/creating_a_security_descriptor_for_a_new_object.asp
Thanks,

But that only assigns access based on user. What i need to do is allow all apps to only read some shared memory (except the process creating the shared memory, which can also write)

note: all apps are going to be the same user.
I don''t know if you can do it any other way. One way is to run your application under a specific user account and allow only that user to access the filemapping. Or to create a group and allow users from that group to access the file mapping.

You could try to ask in this group also: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&group=microsoft.public.win32.programmer.kernel

This topic is closed to new replies.

Advertisement