Reactos

[NTDLL_APITEST] Fix tests for StackOverflow

+13 -1
+13 -1
modules/rostests/apitests/ntdll/StackOverflow.c
··· 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 + #ifdef _WIN64 83 + ok_ptr(NtCurrentTeb()->NtTib.StackLimit, (PVOID)((ULONG_PTR)MemoryBasicInfo.BaseAddress - 2 * PAGE_SIZE)); 84 + #else 82 85 ok_ptr(NtCurrentTeb()->NtTib.StackLimit, (PVOID)((ULONG_PTR)MemoryBasicInfo.BaseAddress - PAGE_SIZE)); 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 + #ifdef _WIN64 119 + ok_long(MemoryBasicInfo.RegionSize, 3 * PAGE_SIZE); 120 + #else 114 121 ok_long(MemoryBasicInfo.RegionSize, 2 * PAGE_SIZE); 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 - ok_long(PAGE_ROUND_DOWN(LastStackAllocation), (ULONG_PTR)StackAllocationBase + 2 * PAGE_SIZE); 157 + #ifdef _WIN64 158 + ok_long(PAGE_ROUND_DOWN(LastStackAllocation), (ULONG_PTR)StackAllocationBase + 4 * PAGE_SIZE); 159 + #else 160 + ok_long(PAGE_ROUND_DOWN(LastStackAllocation), (ULONG_PTR)StackAllocationBase + 3 * PAGE_SIZE); 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));