[0.2.x] added : pageSize routines

git-svn-id: https://pykd.svn.codeplex.com/svn@78897 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2012-08-17 07:15:10 +00:00 committed by Mikhail I. Izmestev
parent 8a41abcd13
commit baa4531964
3 changed files with 19 additions and 0 deletions

View File

@ -31,6 +31,7 @@ void eprintln( const std::wstring &str );
// system properties
ULONG ptrSize();
bool is64bitSystem();
ULONG getPageSize();
//manage debug module
ULONG64 findModuleBase( const std::string &moduleName );

View File

@ -106,6 +106,8 @@ BOOST_PYTHON_MODULE( pykd )
"Return effective pointer size" );
python::def( "is64bitSystem", &is64bitSystem,
"Check if target system has 64 address space" );
python::def( "getPageSize", &getPageSize,
"Get the page size for the currently executing processor context" );
// Manage target memory access

View File

@ -522,6 +522,22 @@ bool is64bitSystem()
///////////////////////////////////////////////////////////////////////////////
ULONG getPageSize()
{
PyThread_StateRestore pyThreadRestore( g_dbgEng->pystate );
HRESULT hres;
ULONG pageSize;
hres = g_dbgEng->control->GetPageSize( &pageSize );
if ( FAILED( hres ) )
throw DbgException( "IDebugControl::GetPageSize failed" );
return pageSize;
}
///////////////////////////////////////////////////////////////////////////////
ULONG64 loadMSR( ULONG msr )
{
PyThread_StateRestore pyThreadRestore( g_dbgEng->pystate );