[NTOS:OB] Correctly handle OBJ_PROTECT_CLOSE in ObDuplicateObject.

This commit is contained in:
Thomas Faber
2019-02-02 23:02:50 +01:00
parent a71f3a70d8
commit f5fc9e0cf2
+6
View File
@@ -2443,6 +2443,12 @@ ObDuplicateObject(IN PEPROCESS SourceProcess,
return Status;
}
if (NewHandleEntry.ObAttributes & OBJ_PROTECT_CLOSE)
{
NewHandleEntry.ObAttributes &= ~OBJ_PROTECT_CLOSE;
NewHandleEntry.GrantedAccess |= ObpAccessProtectCloseBit;
}
/* Now create the handle */
NewHandle = ExCreateHandle(HandleTable, &NewHandleEntry);
if (!NewHandle)