Skip to content

Instantly share code, notes, and snippets.

@chrisnas
Last active February 10, 2022 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisnas/b40a45a0c0561347b34d33448154c592 to your computer and use it in GitHub Desktop.
Save chrisnas/b40a45a0c0561347b34d33448154c592 to your computer and use it in GitHub Desktop.
LPCBYTE loadAddress;
ULONG nameLen = 0;
AssemblyID assemblyId;
hr = pInfo->GetModuleInfo(moduleId, &loadAddress, nameLen, &nameLen, NULL, &assemblyId);
if (SUCCEEDED(hr))
{
WCHAR* pszName = new WCHAR[nameLen]; // count the trailing \0
pInfo->GetModuleInfo(moduleId, &loadAddress, nameLen, &nameLen, pszName,
&assemblyId);
oss << L"(" << pszName << L")";
delete [] pszName;
}
else
oss << L"(UNKNOWN)";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment