Trouble reading from Memory Mapped File

Deadly 提交于 2019-12-05 06:15:01

The service runs in a different session, the famous "session 0". Windows objects live in a namespace that's associated with the session of the process, so your form can't see the object created in the session used by the service.

You must prepend Global\ to the mmf name to create and access the object in the global namespace.

So in the service:

mmf = MemoryMappedFile.CreateOrOpen(@"Global\AuditStream", ...)

and in the form:

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