#include <kmt_test.h>
#include <debug.h>
Go to the source code of this file.
◆ BASE_POOL_TYPE_MASK
◆ NDEBUG
◆ QUOTA_POOL_MASK
◆ TAG_POOLTEST
◆ GetRefCount()
Definition at line 20 of file ExPools.c.
22{
24 return Header->PointerCount;
25}
#define OBJECT_TO_OBJECT_HEADER(o)
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
Referenced by TestPoolQuota().
◆ PoolsTest()
Definition at line 27 of file ExPools.c.
28{
30 ULONG AllocSize,
i, AllocNumber;
32
33
34 for (
i=1;
i<10000;
i++)
35 {
36
38
40 AllocSize++;
41
43 AllocSize += 13;
44
45
47
48
50
51
53
54
56 }
57
58
59 for (
i=1;
i<10000;
i++)
60 {
61
63
65 AllocSize++;
66
68 AllocSize += 13;
69
70
72
73
75
76
78
79
81 }
82
83
84
85
86
87
88
89
90
91
92 AllocNumber = 100000;
94
95
96 for (
i=0;
i<AllocNumber;
i++)
97 {
98 AllocSize = 42;
100 }
101
102
103 for (
i=0;
i<AllocNumber;
i++)
104 {
106 }
107
108
110}
#define ExAllocatePoolWithTag(hernya, size, tag)
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
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)
#define ExFreePoolWithTag(_P, _T)
Referenced by START_TEST().
◆ START_TEST()
Definition at line 260 of file ExPools.c.
261{
266}
static VOID PoolsTest(VOID)
static VOID TestBigPoolExpansion(VOID)
static VOID TestPoolTags(VOID)
static VOID TestPoolQuota(VOID)
◆ TestBigPoolExpansion()
static VOID TestBigPoolExpansion |
( |
VOID |
| ) |
|
|
static |
Definition at line 221 of file ExPools.c.
222{
224 PVOID *BigAllocations;
225 const ULONG MaxAllocations = 1024 * 128;
226 ULONG NumAllocations;
227
229 {
231 MaxAllocations * sizeof(*BigAllocations),
232 'ABmK');
233
234
235 for (NumAllocations = 0; NumAllocations < MaxAllocations; NumAllocations++)
236 {
239 'aPmK');
240 if (BigAllocations[NumAllocations] ==
NULL)
241 {
242 NumAllocations--;
243 break;
244 }
245 }
246
247 trace(
"Got %lu allocations for PoolType %d\n", NumAllocations,
PoolType);
248
249
250 for (; NumAllocations < MaxAllocations; NumAllocations--)
251 {
252 ASSERT(BigAllocations[NumAllocations] !=
NULL);
254 'aPmK');
255 }
257 }
258}
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Referenced by START_TEST().
◆ TestPoolQuota()
Definition at line 141 of file ExPools.c.
142{
146 LONG InitialRefCount;
149
151
152
153
156 'tQmK');
157 ok(
Memory !=
NULL,
"ExAllocatePoolWithQuotaTag returned NULL\n");
159 {
161 "Allocation %p is badly aligned\n",
165
166
169
170
176
180 }
181
182
185 'tQmK');
186 ok(
Memory !=
NULL,
"ExAllocatePoolWithQuotaTag returned NULL\n");
188 {
190 "Allocation %p is badly aligned\n",
197 }
198
199
202 0x7FFFFFFF,
203 'tQmK');
207
208
211 0x7FFFFFFF,
212 'tQmK');
217}
#define BASE_POOL_TYPE_MASK
static LONG GetRefCount(_In_ PVOID Object)
#define ok_eq_pointer(value, expected)
#define ok_eq_long(value, expected)
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
#define KmtEndSeh(ExpectedStatus)
USHORT KmtGetPoolType(PVOID Memory)
#define STATUS_INSUFFICIENT_RESOURCES
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG _In_ _Out_ WDFMEMORY * Memory
#define ExAllocatePoolWithQuotaTag(a, b, c)
#define POOL_QUOTA_FAIL_INSTEAD_OF_RAISE
#define PsGetCurrentProcess
static unsigned int block
Referenced by START_TEST().
◆ TestPoolTags()
Definition at line 114 of file ExPools.c.
115{
117
121
125
129
133
137}
#define ok_eq_tag(value, expected)
ULONG KmtGetPoolTag(PVOID Memory)
Referenced by START_TEST().