QueryDepthSList function

Retrieves the number of entries in the specified singly linked list.


USHORT QueryDepthSList(



A pointer to an SLIST_HEADER structure that represents the head of a singly linked list. This structure is for system use only.

The list must be previously initialized with the InitializeSListHead function.

Return Value

The function returns the number of entries in the list, up to a maximum value of 65535.


The system does not limit the number of entries in a singly linked list. However, the return value of QueryDepthSList is truncated to 16 bits, so the maximum value it can return is 65535. If the specified singly linked list contains more than 65535 entries, QueryDepthSList returns the number of entries in the list modulo 65535. For example, if the specified list contains 65536 entries, QueryDepthSList returns zero.

The return value of QueryDepthSList should not be relied upon in multithreaded applications because the item count can be changed at any time by another thread.


Minimum supported client Windows XP [desktop apps | UWP apps]
Minimum supported server Windows Server 2003 [desktop apps | UWP apps]
Target Platform Windows
Header interlockedapi.h (include Windows Server 2003, Windows Vista, Windows 7, Windows Server 2008 Windows Server 2008 R2, Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See Also


Interlocked Singly Linked Lists