mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-19 19:13:22 +08:00
[0.3.x] added : getLocalProcesses routine ( Return list of runnng processes on the host system )
git-svn-id: https://pykd.svn.codeplex.com/svn@90880 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
fe84574b79
commit
b58e7e0b81
@ -143,6 +143,26 @@ python::list getTargetProcesses()
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
python::list getLocalProcesses()
|
||||
{
|
||||
std::vector<kdlib::LiveProcessInfo> processInfoLst;
|
||||
|
||||
do {
|
||||
AutoRestorePyState pystate;
|
||||
kdlib::getLiveProcessesList(processInfoLst);
|
||||
|
||||
} while(false);
|
||||
|
||||
python::list lst;
|
||||
|
||||
for ( unsigned long i = 0; i < processInfoLst.size(); ++i)
|
||||
lst.append( python::make_tuple( processInfoLst[i].pid, processInfoLst[i].name, processInfoLst[i].user ) );
|
||||
|
||||
return lst;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
python::tuple getBugCheckData()
|
||||
{
|
||||
kdlib::SystemCrashInfo crashInfo = {};
|
||||
|
@ -274,6 +274,7 @@ inline kdlib::MEMOFFSET_64 getImplicitProcessOffset()
|
||||
|
||||
python::list getProcessThreads();
|
||||
python::list getTargetProcesses();
|
||||
python::list getLocalProcesses();
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -165,6 +165,8 @@ BOOST_PYTHON_MODULE( pykd )
|
||||
"Check if script works in windbg context" );
|
||||
python::def( "writeDump", pykd::writeDump,
|
||||
"Create memory dump file" );
|
||||
python::def( "getLocalProcesses", pykd::getLocalProcesses,
|
||||
"Return list of runnng processes on the host system" );
|
||||
|
||||
python::def( "breakin", pykd::targetBreak,
|
||||
"Break into debugger" );
|
||||
|
Loading…
Reference in New Issue
Block a user