Well, here's how you do it! We had to understand this, and I decided that we would return to stackoverflow!
class Program { internal static class Win32Stuff { [DllImport("kernel32.dll", SetLastError = true)] unsafe public static extern int InterlockedIncrement(int* lpAddend); } private static MemoryMappedFile _mmf; private static MemoryMappedViewStream _mmvs; unsafe static void Main(string[] args) { const int INT_OFFSET = 8; _mmf = MemoryMappedFile.CreateOrOpen("SomeName", 1024);
It works and works in several processes! Always enjoy a good challenge!
Traviswhidden
source share