mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[NTOS:IO] Do not free the active VPB (#9343)
IopDereferenceVpbAndFree frees a zero-reference VPB only while it is still installed in RealDevice->Vpb. This can leave the device with a dangling VPB pointer while detached VPBs are retained. Reverse the identity test so only a detached, nonpersistent VPB is released after its reference count reaches zero. Reference: - https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/ns-wdm-_vpb
This commit is contained in:
@@ -192,7 +192,7 @@ IopDereferenceVpbAndFree(IN PVPB Vpb)
|
||||
Vpb->ReferenceCount--;
|
||||
|
||||
/* Check if we're out of references */
|
||||
if (!Vpb->ReferenceCount && Vpb->RealDevice->Vpb == Vpb &&
|
||||
if (!Vpb->ReferenceCount && Vpb->RealDevice->Vpb != Vpb &&
|
||||
!(Vpb->Flags & VPB_PERSISTENT))
|
||||
{
|
||||
/* Release VPB lock */
|
||||
|
||||
Reference in New Issue
Block a user