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
wxKillAllChildren(pid, sig, krc);
// get the process handle to operate on
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 )
if ( hProcess == NULL )
{
if ( krc )