[ros-diffs] [cfinck] 39353: Gabriel Ilardi (gabrielilardi at hotmail.it) - Allow only one instance of Task-Manager to be run at the same time See issue #3976 for more details.

Alex Ionescu ionucu at videotron.ca
Wed Feb 4 04:38:59 CET 2009


This won't be compatible with Windows applications.

On 3-Feb-09, at 5:25 PM, cfinck at 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 at 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/taskmgr.c?rev=39353&r1=39352&r2=39353&view=diff
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- 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



More information about the Ros-diffs mailing list