From c7adbc1c0948df97ebc12fde0ca2eb7ea4f337ba Mon Sep 17 00:00:00 2001 From: wj32 Date: Wed, 7 Apr 2010 23:41:27 +0000 Subject: [PATCH] create installer mutant git-svn-id: svn://svn.code.sf.net/p/processhacker/code@3033 21ef857c-d57f-4fe0-8362-d861dc6d29cd --- 2.x/trunk/ProcessHacker/main.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/2.x/trunk/ProcessHacker/main.c b/2.x/trunk/ProcessHacker/main.c index 01320fc17..ff88960bd 100644 --- a/2.x/trunk/ProcessHacker/main.c +++ b/2.x/trunk/ProcessHacker/main.c @@ -139,6 +139,24 @@ INT WINAPI WinMain( if (PhGetIntegerSetting(L"EnableKph") && !PhStartupParameters.NoKph) PhInitializeKph(); + // Create a mutant for the installer. + { + HANDLE mutantHandle; + OBJECT_ATTRIBUTES oa; + UNICODE_STRING mutantName; + + RtlInitUnicodeString(&mutantName, L"\\BaseNamedObjects\\ProcessHacker2Mutant"); + InitializeObjectAttributes( + &oa, + &mutantName, + 0, + NULL, + NULL + ); + + NtCreateMutant(&mutantHandle, MUTANT_ALL_ACCESS, &oa, FALSE); + } + #ifdef DEBUG dbg.ClientId.UniqueProcess = NtCurrentProcessId(); dbg.ClientId.UniqueThread = NtCurrentThreadId();