[NTOS:OB] Correctly handle OBJ_PROTECT_CLOSE in ObDuplicateObject.

This commit is contained in:
Thomas Faber 2019-01-19 11:45:33 +01:00
parent a71f3a70d8
commit f5fc9e0cf2
No known key found for this signature in database
GPG key ID: 076E7C3D44720826

View file

@ -2443,6 +2443,12 @@ ObDuplicateObject(IN PEPROCESS SourceProcess,
return Status; return Status;
} }
if (NewHandleEntry.ObAttributes & OBJ_PROTECT_CLOSE)
{
NewHandleEntry.ObAttributes &= ~OBJ_PROTECT_CLOSE;
NewHandleEntry.GrantedAccess |= ObpAccessProtectCloseBit;
}
/* Now create the handle */ /* Now create the handle */
NewHandle = ExCreateHandle(HandleTable, &NewHandleEntry); NewHandle = ExCreateHandle(HandleTable, &NewHandleEntry);
if (!NewHandle) if (!NewHandle)