mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 00:43:00 -05:00
sys: WIP
This commit is contained in:
parent
b52947db34
commit
f188bddb3b
@ -22,7 +22,6 @@ static NTSTATUS FspFsvolDeviceInit(PDEVICE_OBJECT DeviceObject);
|
||||
static VOID FspFsvolDeviceFini(PDEVICE_OBJECT DeviceObject);
|
||||
BOOLEAN FspDeviceRetain(PDEVICE_OBJECT DeviceObject);
|
||||
VOID FspDeviceRelease(PDEVICE_OBJECT DeviceObject);
|
||||
BOOLEAN FspDeviceDeleted(PDEVICE_OBJECT DeviceObject);
|
||||
NTSTATUS FspDeviceCopyList(
|
||||
PDEVICE_OBJECT **PDeviceObjects, PULONG PDeviceObjectCount);
|
||||
VOID FspDeviceDeleteList(
|
||||
@ -243,22 +242,6 @@ VOID FspDeviceRelease(PDEVICE_OBJECT DeviceObject)
|
||||
FspDeviceDelete(DeviceObject);
|
||||
}
|
||||
|
||||
BOOLEAN FspDeviceDeleted(PDEVICE_OBJECT DeviceObject)
|
||||
{
|
||||
// !PAGED_CODE();
|
||||
|
||||
BOOLEAN Result;
|
||||
FSP_DEVICE_EXTENSION *DeviceExtension;
|
||||
KIRQL Irql;
|
||||
|
||||
DeviceExtension = FspDeviceExtension(DeviceObject);
|
||||
KeAcquireSpinLock(&DeviceExtension->SpinLock, &Irql);
|
||||
Result = 0 == DeviceExtension->RefCount;
|
||||
KeReleaseSpinLock(&DeviceExtension->SpinLock, Irql);
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
NTSTATUS FspDeviceCopyList(
|
||||
PDEVICE_OBJECT **PDeviceObjects, PULONG PDeviceObjectCount)
|
||||
{
|
||||
|
@ -310,7 +310,6 @@ NTSTATUS FspDeviceCreate(UINT32 Kind, ULONG ExtraSize,
|
||||
VOID FspDeviceDelete(PDEVICE_OBJECT DeviceObject);
|
||||
BOOLEAN FspDeviceRetain(PDEVICE_OBJECT DeviceObject);
|
||||
VOID FspDeviceRelease(PDEVICE_OBJECT DeviceObject);
|
||||
BOOLEAN FspDeviceDeleted(PDEVICE_OBJECT DeviceObject);
|
||||
NTSTATUS FspDeviceCopyList(
|
||||
PDEVICE_OBJECT **PDeviceObjects, PULONG PDeviceObjectCount);
|
||||
VOID FspDeviceDeleteList(
|
||||
|
@ -192,9 +192,15 @@ static NTSTATUS FspFsctlMountVolume(
|
||||
Result = STATUS_UNRECOGNIZED_VOLUME;
|
||||
goto exit;
|
||||
}
|
||||
if (FspDeviceDeleted(FsvrtDeviceObject) || FsvrtDeviceExtension->Deleted ||
|
||||
if (!FspDeviceRetain(FsvrtDeviceObject))
|
||||
{
|
||||
Result = STATUS_UNRECOGNIZED_VOLUME;
|
||||
goto exit;
|
||||
}
|
||||
if (FsvrtDeviceExtension->Deleted ||
|
||||
FILE_DEVICE_VIRTUAL_DISK != FsvrtDeviceObject->DeviceType)
|
||||
{
|
||||
FspDeviceRelease(FsvrtDeviceObject);
|
||||
Result = STATUS_UNRECOGNIZED_VOLUME;
|
||||
goto exit;
|
||||
}
|
||||
@ -215,6 +221,8 @@ static NTSTATUS FspFsctlMountVolume(
|
||||
Irp->IoStatus.Information = 0;
|
||||
}
|
||||
|
||||
FspDeviceRelease(FsvrtDeviceObject);
|
||||
|
||||
exit:;
|
||||
}
|
||||
finally
|
||||
|
Loading…
x
Reference in New Issue
Block a user