mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-20 03:23:23 +08:00
[0.2.x] fixed : IDebugEventCallback::UnloadModule exception on kernel debugging
git-svn-id: https://pykd.svn.codeplex.com/svn@80877 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
d197c8e9af
commit
7d1aed151a
@ -1047,6 +1047,24 @@ HRESULT STDMETHODCALLTYPE DebugEngine::UnloadModule(
|
||||
{
|
||||
DEBUG_CALLBACK_RESULT result = DebugCallbackNoChange;
|
||||
|
||||
HRESULT hres;
|
||||
|
||||
char moduleNameBuf[0x100];
|
||||
|
||||
// áûëè ñëó÷àè, êîãäà ïî BaseOffset íå ïîëó÷èòü áûëî èìÿ ìîäóëÿ
|
||||
// ïîýòîìó íå èñïîëüçóåòñÿ ô. getModuleName
|
||||
hres = g_dbgEng->symbols->GetModuleNameString(
|
||||
DEBUG_MODNAME_MODULE,
|
||||
DEBUG_ANY_ID,
|
||||
BaseOffset,
|
||||
moduleNameBuf,
|
||||
sizeof( moduleNameBuf ),
|
||||
NULL );
|
||||
|
||||
std::string moduleName = "";
|
||||
if ( hres == S_OK )
|
||||
moduleName = std::string( moduleNameBuf );
|
||||
|
||||
boost::recursive_mutex::scoped_lock l(m_handlerLock);
|
||||
|
||||
HandlerList::iterator it = m_handlers.begin();
|
||||
@ -1055,11 +1073,12 @@ HRESULT STDMETHODCALLTYPE DebugEngine::UnloadModule(
|
||||
{
|
||||
PyThread_StateSave pyThreadSave( it->pystate );
|
||||
|
||||
DEBUG_CALLBACK_RESULT ret = it->callback->OnModuleUnload( BaseOffset, getModuleName(BaseOffset) );
|
||||
DEBUG_CALLBACK_RESULT ret = it->callback->OnModuleUnload( BaseOffset, moduleName );
|
||||
|
||||
result = ret != DebugCallbackNoChange ? ret : result;
|
||||
}
|
||||
|
||||
|
||||
return ConvertCallbackResult( result );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user