Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shared memory access permissions on Windows

Tags:

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.

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.

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: mstsc -v:servername /F -console, everything works perfectly.

So that's why I think the problem is related to permissions. Can anyone comment on this?

EDIT:

The ACL that I'm using to create the memory mapped file and the Mutex objects that sychronize access is as follows:

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)"); 

I think this may be part of the issue.