mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 17:03:12 -05:00
sys: WIP
This commit is contained in:
parent
427f8a20e6
commit
18091c65db
@ -150,6 +150,8 @@ VOID FspDeviceDelete(PDEVICE_OBJECT DeviceObject)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ExDeleteResourceLite(&DeviceExtension->Resource);
|
ExDeleteResourceLite(&DeviceExtension->Resource);
|
||||||
|
RtlZeroMemory(DeviceExtension, DeviceObject->Size - sizeof DEVICE_OBJECT);
|
||||||
|
|
||||||
IoDeleteDevice(DeviceObject);
|
IoDeleteDevice(DeviceObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,6 +269,7 @@ typedef struct
|
|||||||
FSP_FSCTL_VOLUME_PARAMS VolumeParams;
|
FSP_FSCTL_VOLUME_PARAMS VolumeParams;
|
||||||
FSP_IOQ Ioq;
|
FSP_IOQ Ioq;
|
||||||
PVPB SwapVpb;
|
PVPB SwapVpb;
|
||||||
|
BOOLEAN Deleted;
|
||||||
UINT8 SecurityDescriptorBuf[];
|
UINT8 SecurityDescriptorBuf[];
|
||||||
} FSP_FSVRT_DEVICE_EXTENSION;
|
} FSP_FSVRT_DEVICE_EXTENSION;
|
||||||
typedef struct
|
typedef struct
|
||||||
|
@ -118,7 +118,8 @@ static NTSTATUS FspFsctlMountVolume(
|
|||||||
PVPB Vpb = IrpSp->Parameters.MountVolume.Vpb;
|
PVPB Vpb = IrpSp->Parameters.MountVolume.Vpb;
|
||||||
PDEVICE_OBJECT FsvrtDeviceObject = Vpb->RealDevice;
|
PDEVICE_OBJECT FsvrtDeviceObject = Vpb->RealDevice;
|
||||||
PDEVICE_OBJECT FsvolDeviceObject;
|
PDEVICE_OBJECT FsvolDeviceObject;
|
||||||
FSP_FSVRT_DEVICE_EXTENSION *FsvrtDeviceExtension;
|
FSP_FSVRT_DEVICE_EXTENSION *FsvrtDeviceExtension =
|
||||||
|
FspFsvrtDeviceExtension(FsvrtDeviceObject);
|
||||||
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension;
|
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension;
|
||||||
|
|
||||||
/* check the passed in volume object; it must be one of our own */
|
/* check the passed in volume object; it must be one of our own */
|
||||||
@ -129,7 +130,7 @@ static NTSTATUS FspFsctlMountVolume(
|
|||||||
Result = STATUS_UNRECOGNIZED_VOLUME;
|
Result = STATUS_UNRECOGNIZED_VOLUME;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
if (FspDeviceDeleted(FsvrtDeviceObject) ||
|
if (FspDeviceDeleted(FsvrtDeviceObject) || FsvrtDeviceExtension->Deleted ||
|
||||||
FILE_DEVICE_VIRTUAL_DISK != FsvrtDeviceObject->DeviceType)
|
FILE_DEVICE_VIRTUAL_DISK != FsvrtDeviceObject->DeviceType)
|
||||||
{
|
{
|
||||||
Result = STATUS_UNRECOGNIZED_VOLUME;
|
Result = STATUS_UNRECOGNIZED_VOLUME;
|
||||||
@ -142,7 +143,6 @@ static NTSTATUS FspFsctlMountVolume(
|
|||||||
&FsvolDeviceObject);
|
&FsvolDeviceObject);
|
||||||
if (NT_SUCCESS(Result))
|
if (NT_SUCCESS(Result))
|
||||||
{
|
{
|
||||||
FsvrtDeviceExtension = FspFsvrtDeviceExtension(FsvrtDeviceObject);
|
|
||||||
FsvolDeviceExtension = FspFsvolDeviceExtension(FsvolDeviceObject);
|
FsvolDeviceExtension = FspFsvolDeviceExtension(FsvolDeviceObject);
|
||||||
#pragma prefast(suppress:28175, "We are a filesystem: ok to access SectorSize")
|
#pragma prefast(suppress:28175, "We are a filesystem: ok to access SectorSize")
|
||||||
FsvolDeviceObject->SectorSize = FsvrtDeviceExtension->VolumeParams.SectorSize;
|
FsvolDeviceObject->SectorSize = FsvrtDeviceExtension->VolumeParams.SectorSize;
|
||||||
@ -186,6 +186,9 @@ static NTSTATUS FspFsvrtDeleteVolume(
|
|||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
|
/* mark the virtual volume device as deleted */
|
||||||
|
FsvrtDeviceExtension->Deleted = TRUE;
|
||||||
|
|
||||||
/* stop the I/O queue */
|
/* stop the I/O queue */
|
||||||
FspIoqStop(&FsvrtDeviceExtension->Ioq);
|
FspIoqStop(&FsvrtDeviceExtension->Ioq);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user