C ++如何从DLL(Windows)的文件名中获取进程ID? [英] C++ How to get process ID from filename of DLL(windows)?
问题描述
如何从文件名获取进程ID?
像:int processId = getProcessIdByFileName("Network.dll");
顺便说一句,哪个数据类型具有进程ID?
how can I get a process ID from a filename?
Like: int processId = getProcessIdByFileName("Network.dll");
Btw, which datatype has the process ID?
扩展信息: 我有一个DLL的源代码.像其他一些DLL一样,此DLL也被加载到应用程序中.我想钩住其他DLL的功能.因此,我需要它们的进程ID(如果它们都在一个应用程序中运行,那么每个DLL是否都有一个进程ID?
Extended info: I have the source code of a DLL. This DLL gets loaded to an application, like a few other DLL's. I want to hook the other DLL's functions. Therefore I need the process ID of them(is there a process ID for each DLL if they all run under one application?
如何在DLL内调用其他DLL的函数?如何处理他们?
How could I call functions of the other DLL's inside of my DLL? How to get a handle to them?
推荐答案
DLL没有进程ID.一个DLL可能被加载到多个进程中,或者根本没有加载. DLL可以加载到进程中,然后卸载,然后再次加载.谈论DLL的进程ID是没有意义的.您实际上想做什么?
DLLs do not have process IDs. A DLL may be loaded into multiple processes, or none at all. A DLL may be loaded into a process, later unloaded, and then loaded again. It is meaningless to talk of the process ID of a DLL. What are you actually trying to do?
这篇关于C ++如何从DLL(Windows)的文件名中获取进程ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!