• Advertisement
Sign in to follow this  

[C++] SymGetTypeInfo TI_GET_SYMNAME - LocalFree

This topic is 2763 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello!

According to all the smaples and docus ive seen so far i need to use LocalFree for the buffer retrieved from SymGetTypeInfo with TI_GET_SYMNAME. Ok, thats what ive did so far:

LPWSTR symName = NULL;
BOOL ret = SymGetTypeInfo(GetCurrentProcess(), inf->ModBase, subType, TI_GET_SYMNAME, &symName);
if(symName == NULL || !ret)
{
msg << _T("unkPtr* ") << inf->Name << _T(" = ") << value;
break;
}
#ifdef UNICODE
msg << symName << _T("* ") << inf->Name << _T(" = ") << value;
#else
int len = wcslen(symName) + 1;
char* symTmp = new char[len];
WideCharToMultiByte(CP_ACP, 0, symName, len, symTmp, len, NULL, NULL);
msg << symTmp << _T("* ") << inf->Name << _T(" = ") << value;
delete [] symTmp;
#endif
LocalFree(symName);



Now my issue is that after LocalFree SymEnumTypes does not call my callback anymore. I suspect that an exception is happening in there. Ive enabled first chance exceptions, but i dont get any.

Is LocalFree wrong? Should it be GlobalFree? Or how do i have to free the buffer?

Thx for any help
Plerion

Share this post


Link to post
Share on other sites
Advertisement
Another problem occured. I dynamically loaded the functions from the DLL at runtime and now i have some errors with SymEnumSymbolsW. It is returning FALSE and GetLastError says ERROR_SUCCESS and the callback is never called.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement