RtlSplay - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTRTL_H

NTSYSAPI
PRTL_SPLAY_LINKS
NTAPI
RtlSplay(
    _Inout_ PRTL_SPLAY_LINKS Links
    );

#endif

View code on GitHub
// ntddk.h

NTSYSAPI PRTL_SPLAY_LINKS RtlSplay(
  [in, out] PRTL_SPLAY_LINKS Links
);
View the official Windows Driver Kit DDI reference

NtDoc

This function is documented in Windows Driver Kit.

Windows Driver Kit DDI reference (nf-ntddk-rtlsplay)

RtlSplay function

Description

The RtlSplay routine rebalances, or "splays," a splay link tree around the specified splay link, making that link the new root of the tree.

Parameters

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.

Return value

RtlSplay returns the Links pointer when it has rebalanced the tree.

Remarks

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.

Diagram illustrating the rebalancing of a splay link tree, where L is the given link, P is its parent node, and G is its grandparent node.

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.

See also

RtlDelete

RtlInitializeSplayLinks

RtlInsertAsLeftChild

RtlInsertAsRightChild