create installer mutant

git-svn-id: svn://svn.code.sf.net/p/processhacker/code@3033 21ef857c-d57f-4fe0-8362-d861dc6d29cd
This commit is contained in:
wj32
2010-04-07 23:41:27 +00:00
parent 7756971f8a
commit c7adbc1c09
+18
View File
@@ -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();