#ifndef _NTRTL_H
NTSYSAPI
PRTL_SPLAY_LINKS
NTAPI
RtlSplay(
_Inout_ PRTL_SPLAY_LINKS Links
);
View code on GitHub// ntddk.h
NTSYSAPI PRTL_SPLAY_LINKS RtlSplay(
[in, out] PRTL_SPLAY_LINKS Links
);
View the official Windows Driver Kit DDI referenceThis function is documented in Windows Driver Kit.
The RtlSplay routine rebalances, or "splays," a splay link tree around the specified splay link, making that link the new root of the tree.
Links [in, out]A pointer to the node that is to become the root node of the rebalanced splay link tree. The node must have been initialized by calling RtlInitializeSplayLinks.
RtlSplay returns the Links pointer when it has rebalanced the tree.
If L is the given link, P is its parent node, and G is its grandparent node, RtlSplay rebalances a splay link tree according to one of the six patterns shown in the following figure.

Callers of the Rtl splay link routines are responsible for synchronizing access to the splay link tree. A fast mutex is the most efficient synchronization mechanism to use for this purpose.
Callers of RtlSplay must be running at IRQL <= DISPATCH_LEVEL if the tree is nonpaged. Usually, callers are running at IRQL PASSIVE_LEVEL.