From 7091708541af3d698c94cc6f8f5d2ef00138d552 Mon Sep 17 00:00:00 2001 From: Colin Finck Date: Tue, 3 Feb 2009 22:25:39 +0000 Subject: [PATCH 1/1] Gabriel Ilardi (gabrielilardi@hotmail.it) - Allow only one instance of Task-Manager to be run at the same time See issue #3976 for more details. svn path=/trunk/; revision=39353 --- reactos/base/applications/taskmgr/taskmgr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reactos/base/applications/taskmgr/taskmgr.c b/reactos/base/applications/taskmgr/taskmgr.c index f11413adf12..75fcb61dcf8 100644 --- a/reactos/base/applications/taskmgr/taskmgr.c +++ b/reactos/base/applications/taskmgr/taskmgr.c @@ -51,6 +51,12 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HANDLE hProcess; HANDLE hToken; TOKEN_PRIVILEGES tkp; + HANDLE hMutex; + + /* check wether we're already running or not */ + hMutex = CreateMutexW(NULL, TRUE, L"taskmgrros"); + if ((!hMutex) || (GetLastError() == ERROR_ALREADY_EXISTS)) + return 1; /* Initialize global variables */ hInst = hInstance; -- 2.17.1