[DllImport("kernel32.dll")]
static extern IntPtr OpenMutex(uint dwDesiredAccess, bool bInheritHandle,
string lpName);
const UInt32 DELETE = 0x00010000;
const UInt32 READ_CONTROL = 0x00020000;
const UInt32 SYNCHRONIZE = 0x00100000;
const UInt32 WRITE_DAC = 0x00040000;
const UInt32 WRITE_OWNER = 0x00080000;
const UInt32 MUTEX_ALL_ACCESS = 0x1F0001;
const UInt32 MUTEX_MODIFY_STATE = 0x0001;
None.
Please add some!
hMutex = OpenMutex(SYNCHRONIZE, false, MUTEX_NAME);
if (hMutex == IntPtr.Zero)
{
//DestroySharedMemory();
throw new Win32Exception();
}
See System.Threading.Mutex in .NET Framework 1.1