tangled
alpha
login
or
join now
huwcampbell.com
/
reactos
0
fork
atom
Reactos
0
fork
atom
overview
issues
pulls
pipelines
[NTDLL_APITEST] Fix tests for StackOverflow
Timo Kreuzer
3 years ago
e6c192b5
dda076a8
+13
-1
1 changed file
expand all
collapse all
unified
split
modules
rostests
apitests
ntdll
StackOverflow.c
+13
-1
modules/rostests/apitests/ntdll/StackOverflow.c
reviewed
···
79
79
/* Check TEB attributes */
80
80
ok_ptr(NtCurrentTeb()->DeallocationStack, StackAllocationBase);
81
81
ok_ptr(NtCurrentTeb()->NtTib.StackBase, (PVOID)((ULONG_PTR)MemoryBasicInfo.BaseAddress + MemoryBasicInfo.RegionSize));
82
82
+
#ifdef _WIN64
83
83
+
ok_ptr(NtCurrentTeb()->NtTib.StackLimit, (PVOID)((ULONG_PTR)MemoryBasicInfo.BaseAddress - 2 * PAGE_SIZE));
84
84
+
#else
82
85
ok_ptr(NtCurrentTeb()->NtTib.StackLimit, (PVOID)((ULONG_PTR)MemoryBasicInfo.BaseAddress - PAGE_SIZE));
86
86
+
#endif
83
87
trace("Guaranteed stack size is %lu.\n", NtCurrentTeb()->GuaranteedStackBytes);
84
88
85
89
/* Get its size */
···
111
115
ok_ptr(MemoryBasicInfo.BaseAddress, NtCurrentTeb()->NtTib.StackLimit);
112
116
ok_ptr(MemoryBasicInfo.AllocationBase, StackAllocationBase);
113
117
ok_long(MemoryBasicInfo.AllocationProtect, PAGE_READWRITE);
118
118
+
#ifdef _WIN64
119
119
+
ok_long(MemoryBasicInfo.RegionSize, 3 * PAGE_SIZE);
120
120
+
#else
114
121
ok_long(MemoryBasicInfo.RegionSize, 2 * PAGE_SIZE);
122
122
+
#endif
115
123
ok_long(MemoryBasicInfo.State, MEM_COMMIT);
116
124
ok_long(MemoryBasicInfo.Protect, PAGE_READWRITE);
117
125
ok_long(MemoryBasicInfo.Type, MEM_PRIVATE);
···
146
154
147
155
/* Windows lets 2 pages between the reserved memory and the smallest possible stack address */
148
156
ok((ULONG_PTR)LastStackAllocation > (ULONG_PTR)StackAllocationBase, "\n");
149
149
-
ok_long(PAGE_ROUND_DOWN(LastStackAllocation), (ULONG_PTR)StackAllocationBase + 2 * PAGE_SIZE);
157
157
+
#ifdef _WIN64
158
158
+
ok_long(PAGE_ROUND_DOWN(LastStackAllocation), (ULONG_PTR)StackAllocationBase + 4 * PAGE_SIZE);
159
159
+
#else
160
160
+
ok_long(PAGE_ROUND_DOWN(LastStackAllocation), (ULONG_PTR)StackAllocationBase + 3 * PAGE_SIZE);
161
161
+
#endif
150
162
151
163
/* And in fact, this is the true condition of the stack overflow */
152
164
ok_ptr(NtCurrentTeb()->NtTib.StackLimit, (PVOID)((ULONG_PTR)StackAllocationBase + PAGE_SIZE));