[NTOS:OB] Correctly handle OBJ_PROTECT_CLOSE in ObDuplicateObject.
[reactos.git] / 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)