diff --git a/src/Driver/Ntvol.c b/src/Driver/Ntvol.c index 2daebfd7..470d50c8 100644 --- a/src/Driver/Ntvol.c +++ b/src/Driver/Ntvol.c @@ -910,8 +910,13 @@ void TCCloseVolume (PDEVICE_OBJECT DeviceObject, PEXTENSION Extension) RestoreTimeStamp (Extension); } ZwClose (Extension->hDeviceFile); + Extension->hDeviceFile = NULL; + } + if (Extension->pfoDeviceFile != NULL) + { + ObDereferenceObject (Extension->pfoDeviceFile); + Extension->pfoDeviceFile = NULL; } - ObDereferenceObject (Extension->pfoDeviceFile); if (Extension->cryptoInfo) { crypto_close (Extension->cryptoInfo);