DLL shared memory problems with different session, service and user session

穿精又带淫゛_ 提交于 2019-12-04 21:28:31

Shared sections don't work across session boundaries any more. Microsoft considered this a security problem and deliberately broke the feature, quite some time ago if memory serves. I believe each session now sees its own private copy of the section.

However memory mapped files (MMFs) work fine, and I use this in place of shared sections now. The only downer is that globally-available MMFs have to be created with high privilege, so I use a service to create the MMF.

Try using global shared memory. Microsoft's documentation says:

Prefixing the file mapping object names with "Global\" allows processes to communicate with each other even if they are in different terminal server sessions.

Don't forget that the credentials also plays a role when sharing memory accross sessions.

This requires that the first process must have the SeCreateGlobalPrivilege privilege

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!