[NTOS:OB] Correctly handle OBJ_PROTECT_CLOSE in ObDuplicateObject.
authorThomas Faber <thomas.faber@reactos.org>
Sat, 19 Jan 2019 10:45:33 +0000 (11:45 +0100)
committerThomas Faber <thomas.faber@reactos.org>
Sat, 2 Feb 2019 22:02:50 +0000 (23:02 +0100)
ntoskrnl/ob/obhandle.c

index 057cdec..38171d2 100644 (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)