[NTOSKRNL] On device map freeing, make directory object temporary again
authorPierre Schweitzer <pierre@reactos.org>
Sat, 1 Jun 2019 11:59:13 +0000 (13:59 +0200)
committerPierre Schweitzer <pierre@reactos.org>
Sat, 1 Jun 2019 11:59:13 +0000 (13:59 +0200)
ntoskrnl/ob/devicemap.c

index 8cda474..dd501f1 100644 (file)
@@ -189,7 +189,8 @@ ObfDereferenceDeviceMap(IN PDEVICE_MAP DeviceMap)
     KeReleaseGuardedMutex(&ObpDeviceMapLock);
 
     /* Dereference the DOS Devices Directory and free the Device Map */
     KeReleaseGuardedMutex(&ObpDeviceMapLock);
 
     /* Dereference the DOS Devices Directory and free the Device Map */
-    ObDereferenceObject(DeviceMap->DosDevicesDirectory );
+    ObMakeTemporaryObject(DeviceMap->DosDevicesDirectory);
+    ObDereferenceObject(DeviceMap->DosDevicesDirectory);
     ExFreePoolWithTag(DeviceMap, 'mDbO');
 }
 
     ExFreePoolWithTag(DeviceMap, 'mDbO');
 }