From 52d2b0fff1fb83dcacc9d08fec5acfbbdf6ad5da Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 3 Jun 2017 21:50:29 +0000 Subject: [PATCH] [UDFS] Revert r74780: it indeed works here, but when the problem happens in other places (it does!) where it cannot be solved that way, we're doomed. It will be required to find an appropriate solution... CORE-4375 svn path=/trunk/; revision=74805 --- reactos/drivers/filesystems/udfs/close.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reactos/drivers/filesystems/udfs/close.cpp b/reactos/drivers/filesystems/udfs/close.cpp index 7923958b457..fe4dfc976d9 100644 --- a/reactos/drivers/filesystems/udfs/close.cpp +++ b/reactos/drivers/filesystems/udfs/close.cpp @@ -1109,6 +1109,7 @@ UDFQueueDelayedClose( { PtrUDFIrpContextLite IrpContextLite; BOOLEAN StartWorker = FALSE; + BOOLEAN AcquiredVcb = FALSE; NTSTATUS RC; AdPrint((" UDFQueueDelayedClose\n")); @@ -1118,6 +1119,7 @@ UDFQueueDelayedClose( UDFAcquireResourceExclusive(&(UDFGlobalData.DelayedCloseResource), TRUE); UDFAcquireResourceShared(&(Fcb->Vcb->VCBResource), TRUE); + AcquiredVcb = TRUE; if(Fcb->FCBFlags & UDF_FCB_DELETE_ON_CLOSE) { try_return(RC = STATUS_DELETE_PENDING); @@ -1181,7 +1183,9 @@ try_exit: NOTHING; if(!NT_SUCCESS(RC)) { Fcb->FCBFlags &= ~UDF_FCB_DELAY_CLOSE; } - UDFReleaseResource(&(Fcb->Vcb->VCBResource)); + if(AcquiredVcb) { + UDFReleaseResource(&(Fcb->Vcb->VCBResource)); + } // Release DelayedCloseResource UDFReleaseResource(&(UDFGlobalData.DelayedCloseResource)); } _SEH2_END;