mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-24 17:32:29 -05:00
sys: Reference the virtual volume device so that it will not go away while the file system device object is alive
This commit is contained in:
parent
b72adb6c97
commit
f7d6c26d4b
@ -204,6 +204,14 @@ static NTSTATUS FspFsvolDeviceInit(PDEVICE_OBJECT DeviceObject)
|
||||
static VOID FspFsvolDeviceFini(PDEVICE_OBJECT DeviceObject)
|
||||
{
|
||||
PAGED_CODE();
|
||||
|
||||
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(DeviceObject);
|
||||
|
||||
/*
|
||||
* Dereference the virtual volume device so that it can now go away.
|
||||
*/
|
||||
if (0 != FsvolDeviceExtension->FsvrtDeviceObject)
|
||||
ObDereferenceObject(FsvolDeviceExtension->FsvrtDeviceObject);
|
||||
}
|
||||
|
||||
BOOLEAN FspDeviceRetain(PDEVICE_OBJECT DeviceObject)
|
||||
|
@ -230,6 +230,12 @@ static NTSTATUS FspFsctlMountVolume(
|
||||
&FsvolDeviceObject);
|
||||
if (NT_SUCCESS(Result))
|
||||
{
|
||||
/*
|
||||
* Reference the virtual volume device so that it will not go away while the
|
||||
* file system device object is alive!
|
||||
*/
|
||||
ObReferenceObject(FsvrtDeviceObject);
|
||||
|
||||
#pragma prefast(suppress:28175, "We are a filesystem: ok to access SectorSize")
|
||||
FsvolDeviceObject->SectorSize = FsvrtDeviceExtension->VolumeParams.SectorSize;
|
||||
FsvolDeviceExtension = FspFsvolDeviceExtension(FsvolDeviceObject);
|
||||
|
Loading…
x
Reference in New Issue
Block a user