title: Shared memory access permissions on Windows
body: <p>I've developed a windows application that uses shared memory---that is---memory mapped files for interprocess communication.  I have a windows service that does some processing and periodically writes data to the memory mapped file.  I have a separate windows application that reads from the memory mapped file and displays the information.  The application works as expected on Windows XP, XP Pro and Server 2003, but NOT on Vista.</p>
  
  <p>I can see that the data being written to the memory mapped file is happening correctly by the windows service because I can open the file with a text editor and see the stored messages, but the "consumer" application can't read from the file.  One interesting thing to note here, is that if I close the consumer application and restart it, it consumes the messages that were previously written to the memory mapped file.  </p>
  
  <p>Also, another strange thing is that I get the same behavior when I connect to the windows host using Remote Desktop and invoke/use the consumer application through remote desktop.  However, if I invoke the Remote Desktop and connect to the target host's console session with the following command: <code>mstsc -v:servername /F -console</code>, everything works perfectly.  </p>
  
  <p>So that's why I think the problem is related to permissions.  Can anyone comment on this?</p>
  
  <p>EDIT:</p>
  
  <p>The ACL that I'm using to create the memory mapped file and the Mutex objects that sychronize access is as follows:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>TCHAR * szSD = TEXT("D:")
                 TEXT("(A;;RPWPCCDCLCSWRCWDWOGAFA;;;S-1-1-0)")
                 TEXT("(A;;GA;;;BG)")
                 TEXT("(A;;GA;;;AN)")
                 TEXT("(A;;GA;;;AU)")
                 TEXT("(A;;GA;;;LS)")
                 TEXT("(A;;GA;;;RD)")
                 TEXT("(A;;GA;;;WD)")
                 TEXT("(A;;GA;;;BA)"); 
  </code></pre>
  
  <p>I think this may be part of the issue.</p>