Tech Off Post

Single Post Permalink

View Thread: How to get the name of the related DLL for a thread in a process like Process Explorer?
  • User profile image

    Hi again,

    OK, I found this nice code a DbgHelp wrapper:

    But can anyone show me how to use the SymFromAddr function?

    I cannot get it to work to get name for processthread, this is what I do:

    IntPtr pOpenThread = OpenThread(ThreadAccess.SUSPEND_RESUME, false, (uint)_processthread.Id);

    DbgHelp.SymInitialize(pOpenThread, null, true);

    DbgHelp.SYMBOL_INFO _symbol = new DbgHelp.SYMBOL_INFO();

    ulong ul = new ulong();

    DbgHelp.SymFromAddr(pOpenThread, (ulong)(_processthread.StartAddress),ref ul, ref _symbol);

    "_symbol" variable comes out all empty.