mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 08:23:05 -05:00
sys: keep extra fsvol device reference
Reference an fsvol device at CREATE time and dereference at CLOSE time, to ensure that fsvol remains around for DeviceIoControl operations done after CLEANUP.
This commit is contained in:
parent
22bf0b09ef
commit
a7a526351f
@ -43,6 +43,9 @@ static NTSTATUS FspFsctlClose(
|
||||
{
|
||||
PAGED_CODE();
|
||||
|
||||
if (0 != IrpSp->FileObject->FsContext2)
|
||||
FspDeviceDereference(IrpSp->FileObject->FsContext2);
|
||||
|
||||
Irp->IoStatus.Information = 0;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
@ -116,7 +116,11 @@ static NTSTATUS FspFsctlCreate(
|
||||
if (0 == FileObject->RelatedFileObject &&
|
||||
PREFIXW_SIZE <= FileObject->FileName.Length &&
|
||||
RtlEqualMemory(PREFIXW, FileObject->FileName.Buffer, PREFIXW_SIZE))
|
||||
{
|
||||
Result = FspVolumeCreate(DeviceObject, Irp, IrpSp);
|
||||
if (NT_SUCCESS(Result) && 0 != IrpSp->FileObject->FsContext2)
|
||||
FspDeviceReference(IrpSp->FileObject->FsContext2);
|
||||
}
|
||||
else
|
||||
{
|
||||
Result = STATUS_SUCCESS;
|
||||
|
@ -417,7 +417,6 @@ static VOID FspVolumeDeleteNoLock(
|
||||
|
||||
PDEVICE_OBJECT FsvolDeviceObject = IrpSp->FileObject->FsContext2;
|
||||
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(FsvolDeviceObject);
|
||||
IrpSp->FileObject->FsContext2 = 0;
|
||||
|
||||
/* stop the I/O queue */
|
||||
FspIoqStop(FsvolDeviceExtension->Ioq, TRUE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user