This won't be compatible with Windows applications.
On 3-Feb-09, at 5:25 PM, cfinck@svn.reactos.org wrote:
Author: cfinck Date: Tue Feb 3 16:25:39 2009 New Revision: 39353
URL: http://svn.reactos.org/svn/reactos?rev=39353&view=rev Log: 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.
Modified: trunk/reactos/base/applications/taskmgr/taskmgr.c
Modified: trunk/reactos/base/applications/taskmgr/taskmgr.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/t... = = = = = = = = ====================================================================== --- trunk/reactos/base/applications/taskmgr/taskmgr.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/taskmgr/taskmgr.c [iso-8859-1] Tue Feb 3 16:25:39 2009 @@ -51,6 +51,12 @@ 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;
Best regards, Alex Ionescu
Alex Ionescu wrote:
This won't be compatible with Windows applications.
Well, I can only quote Timo on this matter:
"Surely we all trust you and you are probably right, but if you want me to be *convinced*, you will hopefully answer my 3 questions: 1.) With what exactly [this won't be compatible]? 2.) Why [won't it be compatible]? 3.) Do you have a better suggestion?
ps: I assume that you have been in a hurry, that didn't allow you to be more specific in the first instance."
Best regards,
Colin
I would assume from Alex's mail, he means Windows doesn't use the mutex, so anything relying on this will fail
Ged.
-----Original Message----- From: ros-dev-bounces@reactos.org [mailto:ros-dev-bounces@reactos.org] On Behalf Of Colin Finck Sent: 04 February 2009 15:04 To: 'ReactOS Development List' Subject: Re: [ros-dev] [ros-diffs] [cfinck] 39353: Gabriel Ilardi(gabrielilardi@hotmail.it) - Allow only one instance ofTask-Manager to be run at the same time See issue #3976 formore details.
Alex Ionescu wrote:
This won't be compatible with Windows applications.
Well, I can only quote Timo on this matter:
"Surely we all trust you and you are probably right, but if you want me to be *convinced*, you will hopefully answer my 3 questions: 1.) With what exactly [this won't be compatible]? 2.) Why [won't it be compatible]? 3.) Do you have a better suggestion?
ps: I assume that you have been in a hurry, that didn't allow you to be more specific in the first instance."
Best regards,
Colin
_______________________________________________ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Using a mutex the taskmgr won't be able to open if there's another unresponsive instance, which Windows allow.
Also, note that whatever method is used, it will be deemed as "a way of disabling Ctrl+Alt+Supr". http://blogs.msdn.com/oldnewthing/archive/2006/06/20/639479.aspx