ReactOS  0.4.15-dev-985-gd905dd5
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)
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Definition: exfuncs.h:814
FORCEINLINE USHORT ExQueryDepthSList(_In_ PSLIST_HEADER SListHead)
Definition: exfuncs.h:153
BOOLEAN KmtAreInterruptsEnabled(VOID)
#define HIGH_LEVEL
Definition: env_spec_w32.h:703

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()

◆ 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;
51  PCHAR Buffer;
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 
80  ExFreePoolWithTag(Buffer, 'TLqS');
81 #endif
82 }
signed char * PCHAR
Definition: retypes.h:7
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
KSPIN_LOCK * PKSPIN_LOCK
Definition: env_spec_w32.h:73
_Out_ PKIRQL Irql
Definition: csq.h:179
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID _In_opt_ PKSPIN_LOCK SpinLock
Definition: iofuncs.h:798
UCHAR KIRQL
Definition: env_spec_w32.h:591
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:238
smooth NULL
Definition: ftsmooth.c:416
#define CheckSListHeader(ListHead, ExpectedPointer, ExpectedDepth)
Definition: bufpool.h:45
void * PVOID
Definition: retypes.h:9
FORCEINLINE VOID InitializeSListHead(_Out_ PSLIST_HEADER SListHead)
Definition: rtlfuncs.h:3353
#define RtlFillMemory(Dest, Length, Fill)
Definition: winternl.h:593
#define PSLIST_ENTRY
Definition: rtltypes.h:134
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define HIGH_LEVEL
Definition: env_spec_w32.h:703
LIST_ENTRY Entries[5]
Definition: ExDoubleList.c:8
unsigned short USHORT
Definition: pedump.c:61
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
#define ExInitializeSListHead
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34