From e19dbcf76b35cabe9487926b3a96d69c7f949d64 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 9 Sep 2010 21:48:48 +0000 Subject: [PATCH] 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 --- src/msw/utils.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index e23656dfa9..47009f0bd0 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -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 ) -- 2.47.2