Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get opened/used files of a running process

Tags:

c#

process

I try to figure out a way to get the used files of a process to show which files are currently opened / used by this process.

I have found Listing Used Files.
Is there a link to get this in C#?

like image 225
MartinHappyCoding Avatar asked Nov 14 '22 03:11

MartinHappyCoding


1 Answers

The NtQuerySystemInformation function seems like a logical starting point, but you'd have to access it via P/Invoke.

From my googling it seems like many people have thought of this approach in the past, but it has never been documented (at least not on PInvoke.net).

like image 78
MetaFight Avatar answered Dec 15 '22 06:12

MetaFight