Reputation: 1539
I'm trying to create a new named mutant from a low integrity process. This code works great on a high integrity process, but fails on low and medium integrity.
RtlInitUnicodeString(&Name, L"\\MutantName");
InitializeObjectAttributes(&Attr, &Name, OBJ_INHERIT | OBJ_OPENIF, NULL, NULL);
NTStatus = NtCreateMutant(&Mutant, MUTANT_ALL_ACCESS, &Attr, 0);
I'm getting NTStatus = ERROR_ACCESS_DENIED (0xc0000022)
.
Is it possible to create a mutant from a low integrity process? If yes - does someone know what am I doing wrong? Thanks!
Upvotes: 0
Views: 210
Reputation: 33754
A Low Integrity process can create objects only in an object directory that has a Low Mandatory label. The root object directory does not have this label. \BaseNamedObjects
does, so you can create your mutant in there from a Low Integrity process:
RtlInitUnicodeString(&Name, L"\\BaseNamedObjects\\MutantName");
Upvotes: 2