Inter-Process Communication with Memory-Mapped Files: Exchange date between a Windows Service and a Desktop Application

By using memory-mapped files it is possible to implement an inter-process communication. You will see the basic concept of memory-mapped files in two previous articles:

 
As I have implemented a little communication framework based on memory-mapped files I run into the following issue: The communication between two desktop applications was possible, but it was not possible to create a connection between a windows service and a desktop application.

The windows service and the desktop application are running in different security contexts. Therefore two different local mutex and memory-mapped file objects will be created. But this issue can be solved very easily. The mutex and the memory-mapped file must be created as global objects. To do this the names must have the prefix “Global\”. If this prefix is not used, the default prefix “Local\” will be used and different local objects will be created in each security context.

Werbung
Dieser Beitrag wurde unter .NET, C# abgelegt und mit , verschlagwortet. Setze ein Lesezeichen auf den Permalink.

Kommentar verfassen

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit deinem WordPress.com-Konto. Abmelden /  Ändern )

Facebook-Foto

Du kommentierst mit deinem Facebook-Konto. Abmelden /  Ändern )

Verbinde mit %s