Don't use PROCESS_ALL_ACCESS when it is not required (#2181)

* Request SDK neutral PROCESS_ALL_ACCESS

* Use basic version test

* Just ask for the access required
This commit is contained in:
Anders 2022-01-27 21:34:24 +01:00 committed by GitHub
parent 05bf0f9fb4
commit 5c8f87d4f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -63,7 +63,7 @@ bool pjutil::TerminatedExistingExe()
break;
}
}
HANDLE hHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, lppe.th32ProcessID);
HANDLE hHandle = OpenProcess(SYNCHRONIZE|PROCESS_TERMINATE, FALSE, lppe.th32ProcessID);
if (hHandle != nullptr)
{
if (TerminateProcess(hHandle, 0))