title: How to share memory between services and user processes?
body: <p>I have a set of Win32 applications that share information using a shared memory segment created with <code>CreateFileMapping()</code>  and <code>MapViewOfFile()</code>. One of the applications is a system service; the remainder are started by the logged-in user. On Windows XP, there was no problem. We named our segments “Global\Something” and all was well.</p>
  
  <p>The additional security in Vista (and assumedly Windows 7) appears to prevent this architecture from working. Normal users are not allowed to create (Win32 error 5) objects in the global namespace. The MSDN indicates that if the account has the “create global” privilege then all should be well, but this does not seem to be the case in practice.
  Also, Vista’s “integrity” features appear to prevent the “low integrity” user processes from accessing the “high integrity” service-created shared memory object. It looks like I should be able to fix this via some magical <code>SetSecurityDescriptorSacl()</code> incantation, but I’m having difficulty learning to speak sacl.</p>
  
  <p>So  the question is: <strong>What is the proper way of using a shared memory segment between services and normal user processes?</strong></p>
  
  <p>To preempt the easy answer of “just turn off UAC”, we’re in a fairly locked-down environment and that is not a possibility.</p>
  
  <p>Edit: Both the service and the user process need read/write access to the segment.</p>