[0.3.x] added : setCurrentProcessId, setCurrentThreadId rountines

git-svn-id: https://pykd.svn.codeplex.com/svn@87619 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2014-03-20 07:36:33 +00:00 committed by Mikhail I. Izmestev
parent ed35032124
commit 1f79e0a992
2 changed files with 30 additions and 14 deletions

View File

@ -150,13 +150,19 @@ inline kdlib::MEMOFFSET_64 getThreadOffset(kdlib::THREAD_DEBUG_ID id = -1)
inline kdlib::MEMOFFSET_64 getCurrentThread() inline kdlib::MEMOFFSET_64 getCurrentThread()
{ {
AutoRestorePyState pystate; AutoRestorePyState pystate;
return kdlib::getThreadOffset(kdlib::getCurrentThreadId()); return kdlib::getCurrentThread();
} }
inline void setCurrentThread(kdlib::THREAD_DEBUG_ID id) inline void setCurrentThreadId(kdlib::THREAD_DEBUG_ID id)
{ {
AutoRestorePyState pystate; AutoRestorePyState pystate;
kdlib::setCurrentThread(id); kdlib::setCurrentThreadById(id);
}
inline void setCurrentThread(kdlib::MEMOFFSET_64 offset)
{
AutoRestorePyState pystate;
kdlib::setCurrentThread(offset);
} }
inline void setImplicitThread(kdlib::MEMOFFSET_64 offset) inline void setImplicitThread(kdlib::MEMOFFSET_64 offset)
@ -186,7 +192,19 @@ inline kdlib::PROCESS_DEBUG_ID getProcessIdByIndex(unsigned long index)
inline kdlib::MEMOFFSET_64 getCurrentProcess() inline kdlib::MEMOFFSET_64 getCurrentProcess()
{ {
AutoRestorePyState pystate; AutoRestorePyState pystate;
return kdlib::getProcessOffset( kdlib::getCurrentProcessId() ); return kdlib::getCurrentProcess();
}
inline void setCurrentProcess(kdlib::MEMOFFSET_64 offset)
{
AutoRestorePyState pystate;
kdlib::setCurrentProcess(offset);
}
inline void setCurrentProcessId( kdlib::PROCESS_DEBUG_ID id )
{
AutoRestorePyState pystate;
kdlib::setCurrentProcessById(id);
} }
inline kdlib::PROCESS_DEBUG_ID getProcessIdByOffset( kdlib::MEMOFFSET_64 offset ) inline kdlib::PROCESS_DEBUG_ID getProcessIdByOffset( kdlib::MEMOFFSET_64 offset )
@ -213,12 +231,6 @@ inline kdlib::MEMOFFSET_64 getProcessOffset( kdlib::PROCESS_DEBUG_ID id = -1)
return kdlib::getProcessOffset(id); return kdlib::getProcessOffset(id);
} }
inline void setCurrentProcess(kdlib::PROCESS_DEBUG_ID id)
{
AutoRestorePyState pystate;
kdlib::setCurrentProcess(id);
}
inline void setImplicitProcess(kdlib::MEMOFFSET_64 offset) inline void setImplicitProcess(kdlib::MEMOFFSET_64 offset)
{ {
AutoRestorePyState pystate; AutoRestorePyState pystate;

View File

@ -378,12 +378,14 @@ BOOST_PYTHON_MODULE( pykd )
"Return system process ID ( PID )" ) ); "Return system process ID ( PID )" ) );
python::def( "getProcessIdBySystemID", pykd::getProcessIdBySystemId, getProcessIdBySystemId_( python::args("Pid"), python::def( "getProcessIdBySystemID", pykd::getProcessIdBySystemId, getProcessIdBySystemId_( python::args("Pid"),
"Return process ID by the system's process ID ( PID )" ) ); "Return process ID by the system's process ID ( PID )" ) );
python::def( "setCurrentProcess", pykd::setCurrentProcess,
"Set current process by ID" );
python::def( "getImplicitProcess", pykd::getImplicitProcessOffset,
"Return implicit process" );
python::def( "getCurrentProcess", pykd::getCurrentProcess, python::def( "getCurrentProcess", pykd::getCurrentProcess,
"Return current offset" ); "Return current offset" );
python::def( "setCurrentProcess", pykd::setCurrentProcess,
"Set current process" );
python::def( "setCurrentProcessId", pykd::setCurrentProcessId,
"Set current process by debug ID" );
python::def( "getImplicitProcess", pykd::getImplicitProcessOffset,
"Return implicit process" );
python::def( "setImplicitProcess", pykd::setImplicitProcess, python::def( "setImplicitProcess", pykd::setImplicitProcess,
"Set implicit process" ); "Set implicit process" );
python::def( "getCurrentProcessExeName", pykd::getCurrentProcessExecutableName, python::def( "getCurrentProcessExeName", pykd::getCurrentProcessExecutableName,
@ -409,6 +411,8 @@ BOOST_PYTHON_MODULE( pykd )
"Return current thread offset" ); "Return current thread offset" );
python::def("setCurrentThread", pykd::setCurrentThread, python::def("setCurrentThread", pykd::setCurrentThread,
"Set current thread" ); "Set current thread" );
python::def("setCurrentThreadId",pykd::setCurrentThreadId,
"Set current thread by debug ID");
python::def( "getImplicitThread", pykd::getImplicitThreadOffset, python::def( "getImplicitThread", pykd::getImplicitThreadOffset,
"Return implicit thread" ); "Return implicit thread" );
python::def( "setImplicitThread", pykd::setImplicitThread, python::def( "setImplicitThread", pykd::setImplicitThread,