mirror of
https://github.com/reactos/reactos.git
synced 2024-07-17 18:06:11 +00:00
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) svn path=/trunk/; revision=33492
This commit is contained in:
parent
7bcc8fccde
commit
f952d12c8d
|
@ -353,7 +353,11 @@ static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
|
|||
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 @@ static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
|
|||
}
|
||||
Control_UnloadApplet(applet);
|
||||
}
|
||||
ReleaseMutex(hMutex);
|
||||
HeapFree(GetProcessHeap(), 0, buffer);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue