Author: cfinck
Date: Tue May 13 03:56:23 2008
New Revision: 33492
URL:
http://svn.reactos.org/svn/reactos?rev=33492&view=rev
Log:
Use a Mutex, so that CPL applets cannot be launched multiple times.
Fixes bug #781 partly, we still need a fix in "control.exe" (see my comment in
the bug report)
Modified:
trunk/reactos/dll/win32/shell32/control.c
Modified: trunk/reactos/dll/win32/shell32/control.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/control.…
==============================================================================
--- trunk/reactos/dll/win32/shell32/control.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/control.c [iso-8859-1] Tue May 13 03:56:23 2008
@@ -353,7 +353,11 @@
LPWSTR extraPmts = NULL;
int quoted = 0;
BOOL spSet = FALSE;
-
+ HANDLE hMutex;
+
+ hMutex = CreateMutex(NULL, FALSE, (LPCTSTR) wszCmd);
+ if ((!hMutex) || (GetLastError() == ERROR_ALREADY_EXISTS))
+ return NULL;
buffer = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(wszCmd) + 1) * sizeof(*wszCmd));
if (!buffer) return;
@@ -412,6 +416,7 @@
}
Control_UnloadApplet(applet);
}
+ ReleaseMutex(hMutex);
HeapFree(GetProcessHeap(), 0, buffer);
}