LordSidious
LordSidious

Reputation: 508

Get Process Mutex List

I got a List of Process IDs and I want to list all the mutexes owned by this process.

I am trying to do this in C#, but I just can't find a way to do this.

So far i got:

foreach(Process thisProcess in processlist)
{
    Console.WriteLine("{0} {1}", thisProcess.ProcessName, thisProcess.Id);
}

That will list all Process IDs, but need the mutexes that are owned by them.

I read something about using a NTDLL.dll but dont now how to.

Upvotes: 2

Views: 2261

Answers (1)

Alexei Levenkov
Alexei Levenkov

Reputation: 100545

Enumerating Mutexes is part of general working with "kernel objects". Reading the book- "Windows Internals" is good idea before diving into such code.

Here is a link that give some info about enumerate kernel object

use ZwQuerySystemInformation with SystemHandleInformation, ZwDuplicateObject, ZwQueryObject with ObjectNameInformation.

Upvotes: 2

Related Questions