次の方法で共有


QueryDepthSList (Compact 2013)

3/28/2014

This function retrieves the number of entries in the specified singly linked list.

Syntax

USHORT WINAPI QueryDepthSList(
  PSLIST_HEADER ListHead
);

Parameters

  • ListHead
    [in] Pointer to an SLIST_HEADER structure that represents the head of a singly linked list. The SLIST_HEADER structure is for system use only.

Return Value

The number of entries in the list, up to a maximum value of 65,535.

Remarks

The ListHead must point to a list that has been previously initialized with the InitializeSListHead function.

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 65,535. If the specified singly linked list contains more than 65,535 entries, QueryDepthSList returns the number of entries in the list modulo 65,535. For example, if the specified list contains 65,536 entries, QueryDepthSList returns (0) zero.

You should not rely upon the return value of QueryDepthSList in multithreaded applications because another thread can change the item count at any time.

To view a code example that uses the QueryDepthSList function, see Interlocked Singly Linked List Reference.

Requirements

Header

windows.h

Library

coredll.dll

See Also

Reference

SList Functions
Interlocked Singly Linked List Reference