Use minimal required process access mask in wxMSW wxKill().

We don't need PROCESS_TERMINATE permission if we are not going to call
TerminateProcess() for it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65490 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-09-09 21:48:48 +00:00
parent 38fd5bad72
commit e19dbcf76b

View File

@@ -708,11 +708,11 @@ int wxKill(long pid, wxSignal sig, wxKillError *krc, int flags)
wxKillAllChildren(pid, sig, krc);
// get the process handle to operate on
HANDLE hProcess = ::OpenProcess(SYNCHRONIZE |
PROCESS_TERMINATE |
PROCESS_QUERY_INFORMATION,
FALSE, // not inheritable
(DWORD)pid);
DWORD dwAccess = PROCESS_QUERY_INFORMATION | SYNCHRONIZE;
if ( sig == wxSIGKILL )
dwAccess |= PROCESS_TERMINATE;
HANDLE hProcess = ::OpenProcess(dwAccess, FALSE, (DWORD)pid);
if ( hProcess == NULL )
{
if ( krc )