40 CHAR FileAndLine[128];
43 KmtOk(ActualRange->Start == ExpectedRange->Start, FileAndLine,
44 "[%lu] Start = 0x%I64x, expected 0x%I64x\n",
Index, ActualRange->Start, ExpectedRange->Start);
45 KmtOk(ActualRange->End == ExpectedRange->End, FileAndLine,
46 "[%lu] End = 0x%I64x, expected 0x%I64x\n",
Index, ActualRange->End, ExpectedRange->End);
47 KmtOk(ActualRange->UserData == ExpectedRange->UserData, FileAndLine,
48 "[%lu] UserData = %p, expected %p\n",
Index, ActualRange->UserData, ExpectedRange->UserData);
49 KmtOk(ActualRange->Owner == ExpectedRange->Owner, FileAndLine,
50 "[%lu] Owner = %p, expected %p\n",
Index, ActualRange->Owner, ExpectedRange->Owner);
51 KmtOk(ActualRange->Attributes == ExpectedRange->Attributes, FileAndLine,
52 "[%lu] Attributes = 0x%x, expected 0x%x\n",
Index, ActualRange->Attributes, ExpectedRange->Attributes);
53 KmtOk(ActualRange->Flags == ExpectedRange->Flags, FileAndLine,
54 "[%lu] Flags = 0x%x, expected 0x%x\n",
Index, ActualRange->Flags, ExpectedRange->Flags);
70 CHAR FileAndLine[128];
80 "Padding is 0x%lx\n", (&
Iterator.Stamp)[1]);
83 for (
i = 0;
i < NumRanges;
i++)
90 KmtOk(
Iterator.RangeListHead == &RangeList->ListHead, FileAndLine,
91 "[%lu] Iterator.RangeListHead = %p, expected %p\n",
i,
Iterator.RangeListHead, &RangeList->ListHead);
93 "[%lu] Iterator.MergedHead = %p\n",
i,
Iterator.MergedHead);
95 "[%lu] Iterator.Current = %p, expected %p\n",
i,
Iterator.Current,
Range);
97 "[%lu] Iterator.Stamp = %lu, expected %lu\n",
i,
Iterator.Stamp, RangeList->Stamp);
106 "Status = 0x%lx after enumeration\n",
Status);
108 "[%lu] Range = %p\n",
i,
Range);
109 KmtOk(
Iterator.RangeListHead == &RangeList->ListHead, FileAndLine,
110 "[%lu] Iterator.RangeListHead = %p, expected %p\n",
i,
Iterator.RangeListHead, &RangeList->ListHead);
112 "[%lu] Iterator.MergedHead = %p\n",
i,
Iterator.MergedHead);
114 "[%lu] Iterator.Current = %p\n",
i,
Iterator.Current);
116 "[%lu] Iterator.Stamp = %lu, expected %lu\n",
i,
Iterator.Stamp, RangeList->Stamp);
122 "Status = 0x%lx after enumeration\n",
Status);
124 "[%lu] Range = %p\n",
i,
Range);
125 KmtOk(
Iterator.RangeListHead == &RangeList->ListHead, FileAndLine,
126 "[%lu] Iterator.RangeListHead = %p, expected %p\n",
i,
Iterator.RangeListHead, &RangeList->ListHead);
128 "[%lu] Iterator.MergedHead = %p\n",
i,
Iterator.MergedHead);
130 "[%lu] Iterator.Current = %p\n",
i,
Iterator.Current);
132 "[%lu] Iterator.Stamp = %lu, expected %lu\n",
i,
Iterator.Stamp, RangeList->Stamp);
135#define expect_range_entries(RangeList, NumRanges, Ranges) \
136 ExpectRangeEntryList(__FILE__, __LINE__, RangeList, NumRanges, Ranges)
146 ULONG StartStamp = RangeList->Stamp;
148 Ranges[1].Start = 0x300;
149 Ranges[1].End = 0x2ff;
150 Ranges[1].Attributes = 2;
173 ULONG StartStamp = RangeList->Stamp;
175 Ranges[1].Start = 0x300;
176 Ranges[1].End = 0x300;
177 Ranges[1].Attributes = 0xff;
208 ULONG StartStamp = RangeList->Stamp;
210 Ranges[1].Start = 0x300;
211 Ranges[1].End = 0x400;
212 Ranges[1].Attributes = 2;
244 ULONG StartStamp = RangeList->Stamp;
246#define is_range_available(RangeList, Start, End, pAvail) \
247 RtlIsRangeAvailable(RangeList, \
307 (Ranges[0].
Start + Ranges[0].End) / 2,
315 Ranges[0].End + 0x100,
322 (Ranges[0].
Start + Ranges[0].End) / 2,
323 Ranges[0].End + 0x100,
331 Ranges[0].End + 0x100,
339 Ranges[0].End + 0x100,
387 Ranges[0].End + 0x100,
399 Ranges[0].End + 0x100,
422 "RangeList.ListHead %p %p %p, expected empty\n",
434 Ranges[0].
Start = 0x100;
435 Ranges[0].
End = 0x200;
457 Stamp = RangeList.
Stamp;
static NTSTATUS RtlAddRangeWrapper(_Inout_ PRTL_RANGE_LIST RangeList, _In_ const RTL_RANGE *Range, _In_ ULONG Flags)
static void ExpectRangeEntryList(_In_ PCSTR File, _In_ INT Line, _In_ RTL_RANGE_LIST *RangeList, _In_ ULONG NumRanges, _In_reads_(NumRanges) const RTL_RANGE *Ranges)
static void ExpectRange(_In_ PCSTR File, _In_ INT Line, _In_ ULONG Index, _In_ const RTL_RANGE *ActualRange, _In_ const RTL_RANGE *ExpectedRange)
static void TestStartEqualsEnd(_Inout_ PRTL_RANGE_LIST RangeList, _Inout_ PRTL_RANGE Ranges)
#define expect_range_entries(RangeList, NumRanges, Ranges)
static void TestStartGreaterThanEnd(_Inout_ PRTL_RANGE_LIST RangeList, _Inout_ PRTL_RANGE Ranges)
#define is_range_available(RangeList, Start, End, pAvail)
static void TestIsAvailable(_Inout_ PRTL_RANGE_LIST RangeList, _Inout_ PRTL_RANGE Ranges)
static void TestSharedFlag(_Inout_ PRTL_RANGE_LIST RangeList, _Inout_ PRTL_RANGE Ranges)
#define ok_eq_hex(value, expected)
#define ok_eq_ulong(value, expected)
#define ok_eq_bool(value, expected)
#define NT_SUCCESS(StatCode)
#define IsListEmpty(ListHead)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define RtlFillMemory(Dest, Length, Fill)
BOOLEAN BOOLEAN KmtOk(INT Condition, PCSTR FileAndLine, PCSTR Format,...) KMT_FORMAT(ms_printf
BOOLEAN BOOLEAN VOID VOID BOOLEAN BOOLEAN KmtSkip(INT Condition, PCSTR FileAndLine, PCSTR Format,...) KMT_FORMAT(ms_printf
#define KmtInvalidPointer
NTSYSAPI NTSTATUS NTAPI RtlIsRangeAvailable(_In_ PRTL_RANGE_LIST RangeList, _In_ ULONGLONG Start, _In_ ULONGLONG End, _In_ ULONG Flags, _In_ UCHAR AttributeAvailableMask, _In_opt_ PVOID Context, _In_opt_ PRTL_CONFLICT_RANGE_CALLBACK Callback, _Out_ PBOOLEAN Available)
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ SaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ OwnerSize PSID Owner
NTSYSAPI NTSTATUS NTAPI RtlDeleteRange(_Inout_ PRTL_RANGE_LIST RangeList, _In_ ULONGLONG Start, _In_ ULONGLONG End, _In_ PVOID Owner)
NTSYSAPI NTSTATUS NTAPI RtlAddRange(_Inout_ PRTL_RANGE_LIST RangeList, _In_ ULONGLONG Start, _In_ ULONGLONG End, _In_ UCHAR Attributes, _In_ ULONG Flags, _In_opt_ PVOID UserData, _In_opt_ PVOID Owner)
NTSYSAPI VOID NTAPI RtlInitializeRangeList(_Out_ PRTL_RANGE_LIST RangeList)
NTSYSAPI NTSTATUS NTAPI RtlGetNextRange(_Inout_ PRTL_RANGE_LIST_ITERATOR Iterator, _Outptr_ PRTL_RANGE *Range, _In_ BOOLEAN MoveForwards)
NTSYSAPI NTSTATUS NTAPI RtlGetFirstRange(_In_ PRTL_RANGE_LIST RangeList, _Out_ PRTL_RANGE_LIST_ITERATOR Iterator, _Outptr_ PRTL_RANGE *Range)
NTSYSAPI VOID NTAPI RtlFreeRangeList(_In_ PRTL_RANGE_LIST RangeList)
#define RTL_RANGE_LIST_ADD_SHARED
#define RTL_SIZEOF_THROUGH_FIELD(type, field)
#define STATUS_NO_MORE_ENTRIES
NTSTRSAFEVAPI RtlStringCbPrintfA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat,...)
struct _LIST_ENTRY * Blink
struct _LIST_ENTRY * Flink
#define STATUS_INVALID_PARAMETER
_In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR Iterator
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
_Must_inspect_result_ _In_ ULONG Flags