Author: tfaber Date: Wed Aug 10 21:09:50 2016 New Revision: 72193
URL: http://svn.reactos.org/svn/reactos?rev=72193&view=rev Log: [NTOS:FSRTL] - Use the correct parent node when replacing an identical cache entry in FsRtlAddToTunnelCache CORE-11819
Modified: trunk/reactos/ntoskrnl/fsrtl/tunnel.c
Modified: trunk/reactos/ntoskrnl/fsrtl/tunnel.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fsrtl/tunnel.c?rev... ============================================================================== --- trunk/reactos/ntoskrnl/fsrtl/tunnel.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/fsrtl/tunnel.c [iso-8859-1] Wed Aug 10 21:09:50 2016 @@ -467,21 +467,21 @@ else { /* update parent node */ - if (LastEntry->LeftChild == CurEntry) + if (RtlIsLeftChild(CurEntry)) { - RtlInsertAsLeftChild(LastEntry, NodeEntry); + RtlInsertAsLeftChild(RtlParent(CurEntry), NodeEntry); } else { - RtlInsertAsRightChild(LastEntry, NodeEntry); + RtlInsertAsRightChild(RtlParent(CurEntry), NodeEntry); } }
/* remove entry */ - RemoveEntryList(&((PTUNNEL_NODE_ENTRY)LastEntry)->TimerQueueEntry); + RemoveEntryList(&((PTUNNEL_NODE_ENTRY)CurEntry)->TimerQueueEntry);
/* free node entry */ - FsRtlFreeTunnelNode((PTUNNEL_NODE_ENTRY)LastEntry, &PoolList); + FsRtlFreeTunnelNode((PTUNNEL_NODE_ENTRY)CurEntry, &PoolList);
/* decrement node count */ Cache->NumEntries--;