* pinfo.cc (winpids:add): New method.
(winpids::enumNT): New method renamed from EnumProcessesNT. Use add method to add elements to the lists. (winpids::enum9x): New method renamed from EnumProcesses9x. Use add method to add elements to the lists. (winpids::enum_init): Accept 'winpid' parameter to control whether to add all windows pids to the list. (winpids::release): New method. * pinfo.h (winpids): Reflect above changes. * signal.cc (kill_pgrp): Ditto. * external.cc (fillout_pinfo): Ditto.
This commit is contained in:
@ -32,23 +32,22 @@ fillout_pinfo (pid_t pid, int winpid)
|
||||
static winpids pids (0);
|
||||
|
||||
if (!pids.npids || !nextpid)
|
||||
pids.init ();
|
||||
pids.init (winpid);
|
||||
|
||||
static unsigned int i = 0;
|
||||
if (!pid)
|
||||
i = 0;
|
||||
|
||||
memset (&ep, 0, sizeof ep);
|
||||
for (; i < pids.npids;)
|
||||
while (i < pids.npids)
|
||||
{
|
||||
DWORD thispid = pids[i++];
|
||||
if (!thispid)
|
||||
continue;
|
||||
pinfo p (thispid, PID_NOREDIR);
|
||||
DWORD thispid = pids.winpid (i);
|
||||
_pinfo *p = pids[i];
|
||||
i++;
|
||||
|
||||
if (!p)
|
||||
{
|
||||
if (!winpid || (!nextpid && thispid != (DWORD) pid))
|
||||
if (!nextpid && thispid != (DWORD) pid)
|
||||
continue;
|
||||
ep.pid = thispid;
|
||||
ep.dwProcessId = cygwin_pid (thispid);
|
||||
|
Reference in New Issue
Block a user