mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 08:53:01 -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();
|
||||
|
||||
BOOLEAN Result;
|
||||
BOOLEAN Delete = FALSE;
|
||||
FSP_DEVICE_EXTENSION *DeviceExtension;
|
||||
KIRQL Irql;
|
||||
|
||||
DeviceExtension = FspDeviceExtension(DeviceObject);
|
||||
KeAcquireSpinLock(&DeviceExtension->SpinLock, &Irql);
|
||||
if (0 != DeviceExtension->RefCount)
|
||||
{
|
||||
DeviceExtension->RefCount--;
|
||||
Result = 0 != DeviceExtension->RefCount;
|
||||
Delete = 0 == DeviceExtension->RefCount;
|
||||
}
|
||||
KeReleaseSpinLock(&DeviceExtension->SpinLock, Irql);
|
||||
|
||||
if (!Result)
|
||||
if (Delete)
|
||||
FspDeviceDelete(DeviceObject);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user