进程(process)和模块(module)的联系和区别?以及对这段话的理解Once you have a handle you will need to get the "first" module of the process. To get the first module of a process call the EnumProcessModules() API with the following parameters:     EnumProcessModules( hProcess, &hModule, sizeof(hModule), &cbReturned ); 
This will put the handle of the first module of the process in the hModule variable. Remember that a process doesn't really have a name, but that the first module in the process is going to be the executable of the process. Now you can use the hModule with the GetModuleFileNameEx(), GetModuleBaseName() to get the full path name, or the simple module name for the process executable. Both functions take the handle to the process, handle to the module, and a buffer pointer in which to return the name, followed by the size of the buffer. 

解决方案 »

  1.   

    进程是程序载入后获得的一块内存区域和一些相关的系统资源,线程是cpu的执行单位,是分配cpu的基本单元;模块是进程的一个实例映像。
      

  2.   

    我想模块就是被加载到内存的二进制代码和数据还有资源的集合
    具体而言,例如一个exe文件被加载后就是一个module,还有DLL
    被加载到某进程的内存空间里时也是一个module
      

  3.   

    好像mfc深入浅出里有一段解释。
      

  4.   

    我的理解是启动的一个程序(exe)是process, 在程序中加载的其他(exe、dll)可以理解为module。
      

  5.   

    这段话就是说EnumProcessModules( hProcess, &hModule, sizeof(hModule), &cbReturned ); 可以取回该进程的第一个模块,也就是进程EXE文件所属的模块,然后就可以用GetModuleFileName,GetModuleBaseName取得进程的可执行文件路径及简化的模块名称。EnumProcessModules本来需要传入一个HMODULE数组接受进程的所有Module句柄,如果只给一个,当然返回进程的第一个模块,也就是EXE的模块了。同意 ixMind(路在何方) 对模块的理解。模块可以看作相应的EXE或DLL文件加载在进程空间的映像。