如何在WaitForDebugEvent
中的LOAD_DLL_DEBUG_INFO事件中得到被调试进程所加载的DLL的文件名?

解决方案 »

  1.   

    LOAD_DLL_DEBUG_INFO中有一个hFile为,你的句柄。可用一个CFile对象Attach试试,然后,调用。getfilename我想应可以得到。我没试过,不一定能成功。
      

  2.   

    上面可能错了。
    我仔细,看了下面的,可能这才是你要的名字。
    lpImageName 
    Pointer to the filename associated with hFile. This member may be NULL, or it may contain the address of a string pointer in the address space of the process being debugged. That address may, in turn, either be NULL or point to the actual filename. If fUnicode is a nonzero value, the name string is Unicode; otherwise, it is ANSI. 
    This member is strictly optional. Debuggers must be prepared to handle the case where lpImageName is NULL or *lpImageName (in the address space of the process being debugged) is NULL. Specifically, the system will never provide an image name for a create process event, and it will not likely pass an image name for the first DLL event. The system will also never provide this information in the case of debugging events that originate from a call to the DebugActiveProcess function
      

  3.   

    Pointer to the filename associated with hFile,与他关联的文件名,不过,他有两个版本
      

  4.   

    lpImageName 
    Pointer to the filename associated with hFile. This member may be NULL, or it may contain the address of a string pointer in the address space of the process being debugged. That address may, in turn, either be NULL or point to the actual filename. If fUnicode is a nonzero value, the name string is Unicode; otherwise, it is ANSI. 
    This member is strictly optional. Debuggers must be prepared to handle the case where lpImageName is NULL or *lpImageName (in the address space of the process being debugged) is NULL. Specifically, the system will never provide an image name for a create process event, and it will not likely pass an image name for the first DLL event. The system will also never provide this information in the case of debugging events that originate from a call to the DebugActiveProcess function这不是MSDN上面的一段话吗?
    就是这段话看不明白,它指的是一个内存地址,我看了内存中的内容,并不是我要的文件名
      

  5.   

    可以看看核心编程里面由关于WaitForDebugEvent的介绍
      

  6.   

    谢谢!
    原帖:http://expert.csdn.net/Expert/topic/2541/2541936.xml?temp=.9575922