ReactOS 0.4.15-dev-7924-g5949c20
ExSequencedList.c File Reference
#include <kmt_test.h>
#include "ExXList.h"
Include dependency graph for ExSequencedList.c:

Go to the source code of this file.

Macros

#define CheckSListHeader(ListHead, ExpectedPointer, ExpectedDepth)
 
#define PXLIST_HEADER   PSLIST_HEADER
 
#define PXLIST_ENTRY   PSLIST_ENTRY
 
#define PushXList   ExInterlockedPushEntrySList
 
#define PopXList   ExInterlockedPopEntrySList
 
#define FlushXList   ExInterlockedFlushSList
 
#define ok_free_xlist   ok_eq_pointer
 
#define CheckXListHeader   CheckSListHeader
 
#define TestXListFunctional   TestSListFunctional
 
#define TestXListFunctional   TestSListFunctionalExports
 

Functions

struct _SINGLE_LIST_ENTRY *__fastcall ExInterlockedPushEntrySList (union _SLIST_HEADER *, struct _SINGLE_LIST_ENTRY *, unsigned long *)
 
struct _SINGLE_LIST_ENTRY *__fastcall ExInterlockedPopEntrySList (union _SLIST_HEADER *, unsigned long *)
 
 START_TEST (ExSequencedList)
 

Macro Definition Documentation

◆ CheckSListHeader

#define CheckSListHeader (   ListHead,
  ExpectedPointer,
  ExpectedDepth 
)
Value:
do \
{ \
ok_eq_pointer((ListHead)->Next.Next, ExpectedPointer); \
/*ok_eq_pointer(FirstEntrySList(ListHead), ExpectedPointer);*/ \
ok_eq_uint((ListHead)->Depth, ExpectedDepth); \
ok_eq_uint((ListHead)->Sequence, ExpectedSequence); \
ok_eq_uint(ExQueryDepthSList(ListHead), ExpectedDepth); \
ok_irql(HIGH_LEVEL); \
ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:"); \
} while (0)
#define HIGH_LEVEL
Definition: env_spec_w32.h:703
BOOLEAN KmtAreInterruptsEnabled(VOID)
FORCEINLINE USHORT ExQueryDepthSList(_In_ PSLIST_HEADER SListHead)
Definition: exfuncs.h:153
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Definition: exfuncs.h:819

Definition at line 17 of file ExSequencedList.c.

◆ CheckXListHeader

#define CheckXListHeader   CheckSListHeader

Definition at line 34 of file ExSequencedList.c.

◆ FlushXList

#define FlushXList   ExInterlockedFlushSList

Definition at line 32 of file ExSequencedList.c.

◆ ok_free_xlist

#define ok_free_xlist   ok_eq_pointer

Definition at line 33 of file ExSequencedList.c.

◆ PopXList

Definition at line 31 of file ExSequencedList.c.

◆ PushXList

Definition at line 30 of file ExSequencedList.c.

◆ PXLIST_ENTRY

#define PXLIST_ENTRY   PSLIST_ENTRY

Definition at line 29 of file ExSequencedList.c.

◆ PXLIST_HEADER

#define PXLIST_HEADER   PSLIST_HEADER

Definition at line 28 of file ExSequencedList.c.

◆ TestXListFunctional [1/2]

#define TestXListFunctional   TestSListFunctional

Definition at line 40 of file ExSequencedList.c.

◆ TestXListFunctional [2/2]

#define TestXListFunctional   TestSListFunctionalExports

Definition at line 40 of file ExSequencedList.c.

Function Documentation

◆ ExInterlockedPopEntrySList()

struct _SINGLE_LIST_ENTRY *__fastcall ExInterlockedPopEntrySList ( union _SLIST_HEADER ,
unsigned long  
)

◆ ExInterlockedPushEntrySList()

struct _SINGLE_LIST_ENTRY *__fastcall ExInterlockedPushEntrySList ( union _SLIST_HEADER ,
struct _SINGLE_LIST_ENTRY ,
unsigned long  
)

◆ START_TEST()

START_TEST ( ExSequencedList  )

Definition at line 44 of file ExSequencedList.c.

45{
46#ifndef _M_AMD64
47 PSLIST_HEADER ListHead;
49 USHORT ExpectedSequence = 0;
50 PKSPIN_LOCK pSpinLock = &SpinLock;
53 SIZE_T EntriesSize = 5 * sizeof *Entries;
54 KIRQL Irql;
55
57#ifdef _M_IX86
58 pSpinLock = NULL;
59#endif
60
61 /* make sure stuff is as un-aligned as possible ;) */
62 Buffer = ExAllocatePoolWithTag(NonPagedPool, sizeof *ListHead + EntriesSize + 1, 'TLqS');
63 ListHead = (PVOID)&Buffer[1];
64 Entries = (PVOID)&ListHead[1];
66
67 RtlFillMemory(Entries, EntriesSize, 0x55);
68 RtlFillMemory(ListHead, sizeof *ListHead, 0x55);
69 InitializeSListHead(ListHead);
70 CheckSListHeader(ListHead, NULL, 0);
71 TestSListFunctional(ListHead, Entries, pSpinLock);
72
73 RtlFillMemory(Entries, EntriesSize, 0x55);
74 RtlFillMemory(ListHead, sizeof *ListHead, 0x55);
75 ExInitializeSListHead(ListHead);
76 CheckSListHeader(ListHead, NULL, 0);
77 TestSListFunctionalExports(ListHead, Entries, pSpinLock);
78
81#endif
82}
#define CheckSListHeader(ListHead, ExpectedPointer, ExpectedDepth)
static const ENTRY Entries[]
Definition: bufpool.h:45
_Out_ PKIRQL Irql
Definition: csq.h:179
#define NULL
Definition: types.h:112
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
UCHAR KIRQL
Definition: env_spec_w32.h:591
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
KSPIN_LOCK * PKSPIN_LOCK
Definition: env_spec_w32.h:73
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
#define NonPagedPool
Definition: env_spec_w32.h:307
#define KeInitializeSpinLock(sl)
Definition: env_spec_w32.h:604
#define RtlFillMemory(Dest, Length, Fill)
Definition: winternl.h:599
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
unsigned short USHORT
Definition: pedump.c:61
void * PVOID
Definition: typedefs.h:50
ULONG_PTR SIZE_T
Definition: typedefs.h:80
char * PCHAR
Definition: typedefs.h:51
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFSPINLOCK * SpinLock
Definition: wdfsync.h:228
#define ExInitializeSListHead
FORCEINLINE VOID InitializeSListHead(_Out_ PSLIST_HEADER SListHead)
Definition: rtlfuncs.h:3351
#define PSLIST_ENTRY
Definition: rtltypes.h:134