#ifndef _NTRTL_H
/**
* The IsListEmpty routine determines whether a doubly linked list is empty.
*
* \param ListHead A pointer to the list head.
*
* \return `TRUE` if the list is empty, otherwise `FALSE`.
* \sa https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-islistempty
*/
_Must_inspect_result_
FORCEINLINE
BOOLEAN
NTAPI_INLINE
IsListEmpty(
_In_ PLIST_ENTRY ListHead
)
{
return ListHead->Flink == ListHead;
}
View code on GitHub// wdm.h
BOOLEAN IsListEmpty(
[in] const LIST_ENTRY *ListHead
);
View the official Windows Driver Kit DDI referenceThis function is documented in Windows Driver Kit.
The IsListEmpty routine indicates whether a doubly linked list of LIST_ENTRY structures is empty.
ListHead [in]Pointer to a LIST_ENTRY structure that represents the head of the list.
IsListEmpty returns TRUE if there are currently no entries in the list and FALSE otherwise.
IsListEmpty returns TRUE if ListHead->Flink refers back to ListHead.
For information about using this routine when implementing a doubly linked list, see Singly and Doubly Linked Lists.
Callers of IsListEmpty can be running at any IRQL. If IsListEmpty is called at IRQL >= DISPATCH_LEVEL, the storage for ListHead must be resident.