mirror of
https://github.com/reactos/reactos.git
synced 2024-11-02 12:53:33 +00:00
- there can be only one instance of the device manager
svn path=/trunk/; revision=28905
This commit is contained in:
parent
ac5a5581cd
commit
58f165a052
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
HINSTANCE hInstance;
|
HINSTANCE hInstance;
|
||||||
HANDLE ProcessHeap;
|
HANDLE ProcessHeap;
|
||||||
|
HANDLE hMutex;
|
||||||
|
|
||||||
int WINAPI
|
int WINAPI
|
||||||
_tWinMain(HINSTANCE hThisInstance,
|
_tWinMain(HINSTANCE hThisInstance,
|
||||||
|
@ -24,6 +25,18 @@ _tWinMain(HINSTANCE hThisInstance,
|
||||||
int Ret = 1;
|
int Ret = 1;
|
||||||
INITCOMMONCONTROLSEX icex;
|
INITCOMMONCONTROLSEX icex;
|
||||||
|
|
||||||
|
hMutex = CreateMutex(NULL, TRUE, _T("devmgmt_mutex"));
|
||||||
|
if (hMutex == NULL || GetLastError() == ERROR_ALREADY_EXISTS)
|
||||||
|
{
|
||||||
|
if (hMutex)
|
||||||
|
{
|
||||||
|
CloseHandle(hMutex);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
hInstance = hThisInstance;
|
hInstance = hThisInstance;
|
||||||
ProcessHeap = GetProcessHeap();
|
ProcessHeap = GetProcessHeap();
|
||||||
|
|
||||||
|
@ -59,7 +72,7 @@ _tWinMain(HINSTANCE hThisInstance,
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalFree((HLOCAL)lpAppName);
|
LocalFree((HLOCAL)lpAppName);
|
||||||
|
CloseHandle(hMutex);
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue