Пример #1
0
        private void CreateOrOpen()
        {
            var hHandle = CreateFileMapping(new IntPtr(-1), 0, FileMapProtection.PageReadWrite, 0, Size, SharedMemoryName);

            _sharedMemoryHandle = new SharedMemoryHandle(hHandle);
            if (_sharedMemoryHandle.IsInvalid)
            {
                Log.Error("Error");
                throw new InvalidOperationException("Error creating object");
            }
        }
Пример #2
0
 private void CreateOrOpen()
 {
     var hHandle = CreateFileMapping(new IntPtr(-1), 0, FileMapProtection.PageReadWrite, 0, Size, SharedMemoryName);
     _sharedMemoryHandle = new SharedMemoryHandle(hHandle);
     if (_sharedMemoryHandle.IsInvalid)
     {
         Log.Error("Error");
         throw new InvalidOperationException("Error creating object");
     }
 }