Cartesius00
Cartesius00

Reputation: 24364

DLLs for current process

how can one tell (using non-CLR C++) which DLLs is a given running process (by ID) using? With file system paths to those DLLs and EXE.

Thank you in advance.

Upvotes: 2

Views: 2984

Answers (1)

vcsjones
vcsjones

Reputation: 141588

If you are trying to do this in code, you are probably looking for the EnumProcessModules function (or K32EnumProcessModules depending on operating system. See the link for more details). There is an EnumProcessModulesEx that can give you a little more more information. Simply give it a handle to the process you want to know which modules (DLLs) are loaded. If you don't know the handle, you can find it using EnumProcesses or OpenProcess if you know the PID.

Upvotes: 3

Related Questions