本文整理汇总了C++中IDiaSymbol::get_symIndexId方法的典型用法代码示例。如果您正苦于以下问题:C++ IDiaSymbol::get_symIndexId方法的具体用法?C++ IDiaSymbol::get_symIndexId怎么用?C++ IDiaSymbol::get_symIndexId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDiaSymbol
的用法示例。
在下文中一共展示了IDiaSymbol::get_symIndexId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadDIASymbols
bool LoadDIASymbols(const wxString &strPDBFile,
wxInt32 modulenum,
std::list<CFunctionDescription> & llFuncs,
stdext::hash_map<BasedAddress,int> & addressmap
)
{
// Create DIA80 Data Source Object
IDiaDataSource *pDataSource;
HRESULT hr = NoRegCoCreate( L"msdia80.dll", _uuidof( DiaSource ), _uuidof( IDiaDataSource ), (void **) &(pDataSource));
if(!SUCCEEDED(hr))
{
return false;
}
/*
HMODULE mod=LoadLibrary(L"msdia80.dll");
if(!mod)
{
return false;
}
TYPEOF_DllGetClassObject *pGetClassObject=(TYPEOF_DllGetClassObject *)GetProcAddress(mod,"DllGetClassObject");
if(!pGetClassObject)
{
FreeLibrary(mod);
return false;
}
IClassFactory *pcf;
HRESULT hr=(*pGetClassObject)(CLSID_DiaSource,IID_IClassFactory,(void **)&pcf);
if(!SUCCEEDED(hr))
{
FreeLibrary(mod);
return false;
}
IDiaDataSource *pDataSource;
hr=pcf->CreateInstance(NULL,_uuidof(IDiaDataSource),(void **)&pDataSource);
if(!SUCCEEDED(hr))
{
pcf->Release();
FreeLibrary(mod);
return false;
}
pcf->Release();
*/
// Load the executable's debug symbols
hr=pDataSource->loadDataFromPdb(strPDBFile);
if(!SUCCEEDED(hr))
{
pDataSource->Release();
return false;
}
// Open a symbol session
IDiaSession *pDIASession;
hr=pDataSource->openSession(&pDIASession);
if(!SUCCEEDED(hr))
{
pDataSource->Release();
return false;
}
// Set the UNBASED address on the session, for resolving BasedAddress addrs
hr=pDIASession->put_loadAddress(0);
if(!SUCCEEDED(hr))
{
pDIASession->Release();
pDataSource->Release();
return false;
}
// Get addresses for this module
std::list<BasedAddress> addresses;
for(stdext::hash_map<BasedAddress,int>::iterator iter=addressmap.begin();iter!=addressmap.end();iter++)
{
if(iter->first.nModule==modulenum)
{
addresses.push_back(iter->first);
}
}
stdext::hash_map<DWORD,wxInt32> functions;
int curidx=(int)llFuncs.size();
for(std::list<BasedAddress>::iterator itera=addresses.begin();itera!=addresses.end();itera++)
{
// Get the symbol for this thing
IDiaSymbol* pFunc;
if(FAILED(pDIASession->findSymbolByVA(itera->nAddr, SymTagFunction, &pFunc)) || pFunc==NULL)
{
continue;
}
// Get the unique symbol index id
DWORD indexId;
if(FAILED(pFunc->get_symIndexId(&indexId)))
{
pFunc->Release();
continue;
//.........这里部分代码省略.........