mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 17:03:12 -05:00
sys: FspDeviceRelease: bug fix
This commit is contained in:
parent
4f790f7b58
commit
0aad82d600
@ -224,18 +224,20 @@ VOID FspDeviceRelease(PDEVICE_OBJECT DeviceObject)
|
|||||||
{
|
{
|
||||||
// !PAGED_CODE();
|
// !PAGED_CODE();
|
||||||
|
|
||||||
BOOLEAN Result;
|
BOOLEAN Delete = FALSE;
|
||||||
FSP_DEVICE_EXTENSION *DeviceExtension;
|
FSP_DEVICE_EXTENSION *DeviceExtension;
|
||||||
KIRQL Irql;
|
KIRQL Irql;
|
||||||
|
|
||||||
DeviceExtension = FspDeviceExtension(DeviceObject);
|
DeviceExtension = FspDeviceExtension(DeviceObject);
|
||||||
KeAcquireSpinLock(&DeviceExtension->SpinLock, &Irql);
|
KeAcquireSpinLock(&DeviceExtension->SpinLock, &Irql);
|
||||||
if (0 != DeviceExtension->RefCount)
|
if (0 != DeviceExtension->RefCount)
|
||||||
|
{
|
||||||
DeviceExtension->RefCount--;
|
DeviceExtension->RefCount--;
|
||||||
Result = 0 != DeviceExtension->RefCount;
|
Delete = 0 == DeviceExtension->RefCount;
|
||||||
|
}
|
||||||
KeReleaseSpinLock(&DeviceExtension->SpinLock, Irql);
|
KeReleaseSpinLock(&DeviceExtension->SpinLock, Irql);
|
||||||
|
|
||||||
if (!Result)
|
if (Delete)
|
||||||
FspDeviceDelete(DeviceObject);
|
FspDeviceDelete(DeviceObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user