mirror of
https://github.com/reactos/reactos.git
synced 2025-04-20 12:29:56 +00:00
- Use the name of the cpl as the mutex name
- The mutex name is a unicode buffer, pass it to CreateMutexW function - fixes bug 3489 svn path=/trunk/; revision=35591
This commit is contained in:
parent
5ed0e9015c
commit
72d7445528
1 changed files with 17 additions and 4 deletions
|
@ -348,21 +348,34 @@ static void Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
|
|||
LPWSTR beg = NULL;
|
||||
LPWSTR end;
|
||||
WCHAR ch;
|
||||
LPWSTR ptr;
|
||||
LPWSTR ptr, ptr2;
|
||||
WCHAR szName[MAX_PATH];
|
||||
unsigned sp = 0;
|
||||
LPWSTR extraPmts = NULL;
|
||||
int quoted = 0;
|
||||
BOOL spSet = FALSE;
|
||||
HANDLE hMutex;
|
||||
HANDLE hMutex;
|
||||
UINT Length;
|
||||
|
||||
ptr = wcsrchr(wszCmd, L'\\');
|
||||
ptr2 = wcsrchr(wszCmd, L',');
|
||||
if (!ptr || !ptr2)
|
||||
return;
|
||||
|
||||
Length = (ptr2 - ptr - 1);
|
||||
if (Length >= MAX_PATH)
|
||||
return;
|
||||
|
||||
memcpy(szName, ptr + 1, Length * sizeof(WCHAR));
|
||||
szName[Length] = L'\0';
|
||||
hMutex = CreateMutexW(NULL, FALSE, szName);
|
||||
|
||||
hMutex = CreateMutex(NULL, FALSE, (LPCTSTR) wszCmd);
|
||||
if ((!hMutex) || (GetLastError() == ERROR_ALREADY_EXISTS))
|
||||
return;
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(wszCmd) + 1) * sizeof(*wszCmd));
|
||||
if (!buffer) return;
|
||||
|
||||
end = lstrcpyW(buffer, wszCmd);
|
||||
|
||||
for (;;) {
|
||||
ch = *end;
|
||||
if (ch == '"') quoted = !quoted;
|
||||
|
|
Loading…
Reference in a new issue