From 07a4dc9d3c2ec2584ac9a904f8c6e85b97171fd0 Mon Sep 17 00:00:00 2001 From: "SND\\kernelnet_cp" Date: Mon, 21 Apr 2014 06:03:37 +0000 Subject: [PATCH] [0.3.x] added : getCurrentProcessId ( return current process debug id ) [0.3.x] added : getCurrentThreadId ( return current thread debug id ) git-svn-id: https://pykd.svn.codeplex.com/svn@88012 9b283d60-5439-405e-af05-b73fd8c4d996 --- pykd/pydbgeng.h | 6 ++++++ pykd/pymod.cpp | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/pykd/pydbgeng.h b/pykd/pydbgeng.h index 35c2792..a8dd8d8 100644 --- a/pykd/pydbgeng.h +++ b/pykd/pydbgeng.h @@ -195,6 +195,12 @@ inline kdlib::MEMOFFSET_64 getCurrentProcess() return kdlib::getCurrentProcess(); } +inline kdlib::PROCESS_DEBUG_ID getCurrentProcessId() +{ + AutoRestorePyState pystate; + return kdlib::getCurrentProcessId(); +} + inline void setCurrentProcess(kdlib::MEMOFFSET_64 offset) { AutoRestorePyState pystate; diff --git a/pykd/pymod.cpp b/pykd/pymod.cpp index c948483..4598d7c 100644 --- a/pykd/pymod.cpp +++ b/pykd/pymod.cpp @@ -374,6 +374,8 @@ BOOST_PYTHON_MODULE( pykd ) "Return process ID by the system's process ID ( PID )" ) ); python::def( "getCurrentProcess", pykd::getCurrentProcess, "Return current offset" ); + python::def( "getCurrentProcessId", pykd::getCurrentProcessId, + "Return current process ID" ); python::def( "setCurrentProcess", pykd::setCurrentProcess, "Set current process" ); python::def( "setCurrentProcessId", pykd::setCurrentProcessId, @@ -399,10 +401,12 @@ BOOST_PYTHON_MODULE( pykd ) "Return system thread ID ( TID )" ) ); python::def( "getThreadId", pykd::getThreadIdByOffset, "Return thread ID by the location in the target's memory of the thread structure" ); - python::def( "getThreadId", pykd::getThreadIdBySystemId, getThreadIdBySystemId_( python::args("Tid"), - "Return thread ID by the system's thread ID ( PID )" ) ); + python::def( "getThreadIdBySystemID", pykd::getThreadIdBySystemId, getThreadIdBySystemId_( python::args("Tid"), + "Return thread ID by the system's thread ID ( TID )" ) ); python::def( "getCurrentThread", pykd::getCurrentThread, "Return current thread offset" ); + python::def( "getCurrentThreadId", pykd::getCurrentThreadId, + "Return current thread ID" ); python::def("setCurrentThread", pykd::setCurrentThread, "Set current thread" ); python::def("setCurrentThreadId",pykd::setCurrentThreadId,