24#define WIN32_NO_STATUS
83 while ((
p >> (31 -
z)) != 1)
z++;
93 if (
z >= 32)
return z;
115 addr2 = (
char *)addr1 + 0x1000;
122 addr2 = (
char *)addr1 + 0x1000;
136 "NtAllocateVirtualMemory returned %08lx\n",
status);
139 ok(((
UINT_PTR)addr2 >> (32 - zero_bits)) == 0,
140 "NtAllocateVirtualMemory returned address: %p\n", addr2);
147 for (zero_bits = 2; zero_bits <= 20; zero_bits++)
156 "NtAllocateVirtualMemory with %d zero_bits returned %08lx\n", (
int)zero_bits,
status);
159 ok(((
UINT_PTR)addr2 >> (32 - zero_bits)) == 0,
160 "NtAllocateVirtualMemory with %d zero_bits returned address %p\n", (
int)zero_bits, addr2);
174 "NtAllocateVirtualMemory returned %08lx\n",
status);
188 "NtAllocateVirtualMemory returned %08lx\n",
status);
193 zero_bits = 0x1aaaaaaa;
205 "NtAllocateVirtualMemory returned %08lx\n",
status);
209 ((
UINT_PTR)addr2 & ~zero_bits) != 0,
210 "NtAllocateVirtualMemory returned address %p\n", addr2);
220 addr2 = (
char *)addr1 + 0x1000;
224 "NtAllocateVirtualMemory returned %08lx\n",
status);
239 addr2 = (
char *)addr1 + 0x1fff;
242 ok(
size == 0x2000,
"wrong size %Ix\n",
size );
243 ok( addr2 == (
char *)addr1 + 0x1000,
"wrong addr %p\n", addr2 );
246 addr2 = (
char *)addr1 + 0x1001;
250 ok( addr2 == (
char *)addr1 + 0x1001,
"wrong addr %p\n", addr2 );
253 addr2 = (
char *)addr1 + 0xffe;
257 ok( addr2 == addr1,
"wrong addr %p\n", addr2 );
260 addr2 = (
char *)addr1 + 0x1001;
264 ok( addr2 == (
char *)addr1 + 0x1001,
"wrong addr %p\n", addr2 );
267 addr2 = (
char *)addr1 + 0xfff;
270 ok(
size == 0x10000,
"wrong size %Ix\n",
size );
271 ok( addr2 == addr1,
"wrong addr %p\n", addr2 );
280#define check_region_size(p, s) check_region_size_(p, s, __LINE__)
287 memset(&mbi, 0,
sizeof(mbi));
290 ok_(__FILE__,
line)(
size ==
sizeof(mbi),
"Unexpected return value.\n");
298 char *
p, *p1, *p2, *p3;
306 if (!pNtAllocateVirtualMemoryEx)
308 win_skip(
"NtAllocateVirtualMemoryEx() is missing\n");
362 ok(!*(
unsigned int *)addr1,
"Got %#x.\n", *(
unsigned int *)addr1);
413,
"Unexpected status %08lx.\n",
status);
431 addresses, &
count, &granularity );
433 ok(!
count,
"Unexpected count %u.\n", (
unsigned int)
count);
434 *((
char *)addr1 + 0x1000) = 1;
437 addresses, &
count, &granularity );
439 ok(
count == 1,
"Unexpected count %u.\n", (
unsigned int)
count);
440 ok(addresses[0] == (
char *)addr1 + 0x1000,
"Unexpected address %p.\n", addresses[0]);
456 ok(
size == 0x10000,
"Unexpected size %#Ix.\n",
size);
459 ok(
size == 0x10000,
"Unexpected size %#Ix.\n",
size);
460 ok(
p == addr1,
"Unexpected addr %p, expected %p.\n",
p, addr1);
479 ok(size2 == 0x4000,
"Unexpected size %#Ix.\n", size2);
480 ok(p1 ==
p +
size / 2,
"Unexpected addr %p, expected %p.\n",
p,
p +
size / 2);
488 ok(size2 == 0x4000,
"Unexpected size %#Ix.\n", size2);
489 ok(
p == addr1,
"Unexpected addr %p, expected %p.\n",
p, addr1);
492 ok(size2 == 0x4000,
"Unexpected size %#Ix.\n", size2);
493 ok(p1 ==
p +
size / 2,
"Unexpected addr %p, expected %p.\n", p1,
p +
size / 2);
496 ok(size2 == 0x4000,
"Unexpected size %#Ix.\n", size2);
497 ok(p2 == p1 +
size / 4,
"Unexpected addr %p, expected %p.\n", p2, p1 +
size / 4);
509 ok(!size2,
"Unexpected size %#Ix.\n", size2);
517 ok(p1 == addr1,
"Unexpected address.\n");
518 ok(size2 == 0x4000,
"Unexpected size %#Ix.\n", size2);
519 ok(p1 == addr1,
"Unexpected addr %p, expected %p.\n", p1, addr1);
534 size2 =
size + 0x1000;
538 size2 =
size - 0x1000;
542 p1 = (
char *)addr1 + 0x1000;
556 ok(
size == 0x10000,
"Unexpected size %#Ix.\n",
size);
557 ok(p1 == addr1,
"Unexpected addr %p, expected %p.\n", p1, addr1);
563 ok(size2 == 0x4000,
"Unexpected size %#Ix.\n", size2);
564 ok(p1 == addr1,
"Unexpected addr %p, expected %p.\n", p1, addr1);
579 ok(size2 == 0xc000,
"Unexpected size %#Ix.\n", size2);
580 ok(p2 == p1 +
size / 4,
"Unexpected addr %p, expected %p.\n", p2, p1 +
size / 4);
588 ok(size2 == 0x4000,
"Unexpected size %#Ix.\n", size2);
589 ok(p1 == addr1,
"Unexpected addr %p, expected %p.\n", p1, addr1);
601 ok(
size == 0x10000,
"Unexpected size %#Ix.\n",
size);
609 ok(size2 == 0x8000,
"Unexpected size %#Ix.\n", size2);
610 ok(p2 == p1 +
size / 2,
"Unexpected addr %p, expected %p.\n", p2, p1 +
size / 2);
615 ok(size2 == 0x8000,
"Unexpected size %#Ix.\n", size2);
616 ok(p1 == addr1,
"Unexpected addr %p, expected %p.\n", p1, addr1);
619 ok(size2 == 0x8000,
"Unexpected size %#Ix.\n", size2);
620 ok(p2 == p1 +
size / 2,
"Unexpected addr %p, expected %p.\n", p2, p1 +
size / 2);
645 if (pRtlGetNativeSystemInformation)
653 if (pRtlIsEcCode)
ok( pRtlIsEcCode( addr1 ),
"not EC code %p\n", addr1 );
662 if (pRtlIsEcCode)
ok( !pRtlIsEcCode( addr1 ),
"EC code %p\n", addr1 );
669 ok( pRtlIsEcCode( addr1 ),
"not EC code %p\n", addr1 );
670 ok( !pRtlIsEcCode( (
char *)addr1 + 0x1000 ),
"EC code %p\n", (
char *)addr1 + 0x1000 );
678 ok( pRtlIsEcCode( addr1 ),
"not EC code %p\n", addr1 );
679 ok( !pRtlIsEcCode( (
char *)addr1 + 0x1000 ),
"EC code %p\n", (
char *)addr1 + 0x1000 );
683 if (pRtlIsEcCode)
ok( pRtlIsEcCode( addr1 ),
"not EC code %p\n", addr1 );
692 ok( pRtlIsEcCode( addr1 ),
"not EC code %p\n", addr1 );
693 ok( !pRtlIsEcCode( (
char *)addr1 + 0x1000 ),
"EC code %p\n", (
char *)addr1 + 0x1000 );
703 "Unexpected status %08lx.\n",
status);
715 if (!pNtAllocateVirtualMemoryEx)
717 win_skip(
"NtAllocateVirtualMemoryEx() is missing\n");
758 a.LowestStartingAddress =
NULL;
761 a.HighestEndingAddress = (
void *)(0x20001000 + 1);
768 a.HighestEndingAddress = (
void *)(0x20001000 - 2);
775 a.HighestEndingAddress = (
void *)(0x20000800 - 1);
799 a.HighestEndingAddress = (
void *)(0x20001000 - 1);
818 a.HighestEndingAddress = (
void *)(0x20001000 - 1);
826 "Unexpected status %08lx.\n",
status);
834 "Unexpected status %08lx.\n",
status);
843 a.HighestEndingAddress =
NULL;
855 a.HighestEndingAddress = (
void *)(0x20001000 - 1);
856 a.Alignment = 0x10000;
868 a.HighestEndingAddress = (
void *)(0x20001000 - 1);
869 a.Alignment = 0x20000000;
876 a.HighestEndingAddress =
NULL;
877 a.Alignment = 0x8000;
884 a.Alignment = 0x30000;
891 a.Alignment = 0x40000;
910 a.LowestStartingAddress = (
void *)0x20001000;
918 a.LowestStartingAddress = (
void *)(0x20001000 - 1);
925 a.LowestStartingAddress = (
void *)(0x20001000 + 1);
932 a.LowestStartingAddress = (
void *)0x30000000;
933 a.HighestEndingAddress = (
void *)0x20000000;
940 a.LowestStartingAddress = (
void *)0x20000000;
941 a.HighestEndingAddress = 0;
947 ok(
addr >= (
void *)0x20000000,
"Unexpected addr %p.\n",
addr);
952 a.LowestStartingAddress = (
void *)0x20000000;
953 a.HighestEndingAddress = (
void *)0x2fffffff;
959 ok(
addr >= (
void *)0x20000000 &&
addr < (
void *)0x30000000,
"Unexpected addr %p.\n",
addr);
965 a.HighestEndingAddress = 0;
981 volatile int buffer[0x2000];
990 volatile int buffer[0x400];
1008 todo_wine ok( committed ==
args->expect_committed ||
broken(committed == 0x1000),
"unexpected stack committed size %lx, expected %lx\n", committed,
args->expect_committed );
1009 ok(
reserved ==
args->expect_reserved,
"unexpected stack reserved size %lx, expected %lx\n",
reserved,
args->expect_reserved );
1026 todo_wine ok( committed == 0x9000,
"unexpected stack committed size %lx, expected 9000\n", committed );
1027 ok(
reserved ==
args->expect_reserved,
"unexpected stack reserved size %lx, expected %lx\n",
reserved,
args->expect_reserved );
1043 ok( guard_size == 0x1000 || guard_size == 0x2000 || guard_size == 0x3000,
"unexpected guard_size %I64x, expected 1000, 2000 or 3000\n", (
UINT64)guard_size );
1090 ok( guard_size == 0x1000 || guard_size == 0x2000 || guard_size == 0x3000,
"unexpected guard_size %I64x, expected 1000, 2000 or 3000\n", (
UINT64)guard_size );
1097 ok( !
status,
"NtAllocateVirtualMemory returned %08lx\n",
status );
1100 todo_wine ok( committed == 0x6000,
"unexpected stack committed size %lx, expected 6000\n", committed );
1125 tmp = (
char *)
addr - guard_size - 0x1000;
1128 ok( !
status,
"NtAllocateVirtualMemory returned %08lx\n",
status );
1131 todo_wine ok( committed == 0x1000,
"unexpected stack committed size %lx, expected 1000\n", committed );
1142 todo_wine ok( committed == 0x2000,
"unexpected stack committed size %lx, expected 2000\n", committed );
1159 addr = (
char *)tmp + guard_size + 0x1000;
1162 ok( !
status,
"NtAllocateVirtualMemory returned %08lx\n",
status );
1175 todo_wine ok( committed == 0x2000,
"unexpected stack committed size %lx, expected 2000\n", committed );
1185 ok( !
status,
"NtProtectVirtualMemory returned %08lx\n",
status );
1189 todo_wine ok( committed == 0x6000,
"unexpected stack committed size %lx, expected 6000\n", committed );
1218 ok( !
status,
"NtProtectVirtualMemory returned %08lx\n",
status );
1222 todo_wine ok( committed == 0x6000,
"unexpected stack committed size %lx, expected 6000\n", committed );
1225 ok( !
status,
"NtProtectVirtualMemory returned %08lx\n",
status );
1229 todo_wine ok( committed == 0x6000,
"unexpected stack committed size %lx, expected 6000\n", committed );
1236 todo_wine ok( committed == 0x6000,
"unexpected stack committed size %lx, expected 6000\n", committed );
1260 SIZE_T commit,
reserve, commit_align, reserve_align, expect_commit, expect_reserve;
1264 { 0, 0, 1, 1, default_commit, default_reserve},
1265 { 0x2000, 0, 1, 1, 0x2000, default_reserve},
1266 { 0x4000, 0, 1, 1, 0x4000, default_reserve},
1267 { 0, 0x200000, 1, 1, default_commit, 0x200000},
1268 { 0x4000, 0x200000, 1, 1, 0x4000, 0x200000},
1269 {0x100000, 0x100000, 1, 1, 0x100000, 0x100000},
1270 { 0x20000, 0x20000, 1, 1, 0x20000, 0x100000},
1272 { 0, 0x110000, 1, 1, default_commit, 0x110000},
1273 { 0, 0x110000, 1, 0x40000, default_commit, 0x140000},
1274 { 0, 0x140000, 1, 0x40000, default_commit, 0x140000},
1275 { 0x11000, 0x140000, 1, 0x40000, 0x11000, 0x140000},
1276 { 0x11000, 0x140000, 0x4000, 0x40000, 0x14000, 0x140000},
1277 { 0, 0, 0x4000, 0x400000,
1278 (default_commit + 0x3fff) & ~0x3fff,
1279 (default_reserve + 0x3fffff) & ~0x3fffff},
1282 if (!pRtlCreateUserStack)
1284 win_skip(
"RtlCreateUserStack() is missing\n");
1293 ok(!
ret,
"%u: got status %#lx\n",
i,
ret);
1294 ok(!
stack.OldStackBase,
"%u: got OldStackBase %p\n",
i,
stack.OldStackBase);
1295 ok(!
stack.OldStackLimit,
"%u: got OldStackLimit %p\n",
i,
stack.OldStackLimit);
1297 "%u: got unaligned memory %p\n",
i,
stack.DeallocationStack);
1302 pRtlFreeUserStack(
stack.DeallocationStack);
1305 ret = pRtlCreateUserStack(0x11000, 0x110000, 0, 1, 0, &
stack);
1308 ret = pRtlCreateUserStack(0x11000, 0x110000, 0, 0, 1, &
stack);
1311 args.expect_committed = 0x4000;
1312 args.expect_reserved = default_reserve;
1317 args.expect_committed = default_commit < 0x2000 ? 0x2000 : default_commit;
1318 args.expect_reserved = 0x400000;
1326 ok(
thread !=
NULL,
"CreateThread with huge stack failed\n");
1331 args.expect_committed = default_commit < 0x2000 ? 0x2000 : default_commit;
1332 args.expect_reserved = 0x100000;
1333 for (
i = 0;
i < 32;
i++)
1340 ret = pRtlCreateUserStack(
args.expect_committed,
args.expect_reserved,
i, 0x1000, 0x1000, &
stack );
1344 "%u: got %lx / %lx\n",
i,
ret, expect_ret );
1345 if (!
ret) pRtlFreeUserStack(
stack.DeallocationStack );
1347 args.expect_reserved,
args.expect_committed,
1352 "%u: got %lx / %lx\n",
i,
ret, expect_ret );
1359 if (
mask <= 31)
continue;
1361 ret = pRtlCreateUserStack(
args.expect_committed,
args.expect_reserved,
mask, 0x1000, 0x1000, &
stack );
1364 "%08lx: got %lx / %lx\n",
mask,
ret, expect_ret );
1365 if (!
ret) pRtlFreeUserStack(
stack.DeallocationStack );
1367 args.expect_reserved,
args.expect_committed,
1371 "%08lx: got %lx / %lx\n",
mask,
ret, expect_ret );
1382 static const char testfile[] =
"testfile.xxx";
1383 static const char data[] =
"test data for NtMapViewOfSection";
1404 ok(
mapping != 0,
"CreateFileMapping failed\n");
1420 ok(!((
ULONG_PTR)
ptr & 0xffff),
"returned memory %p is not aligned to 64k\n",
ptr);
1423 ok(
ret,
"ReadProcessMemory failed\n");
1434 "NtMapViewOfSection returned %08lx\n",
status);
1437 ok(((
UINT_PTR)ptr2 >> (32 - zero_bits)) == 0,
1438 "NtMapViewOfSection returned address: %p\n", ptr2);
1444 for (zero_bits = 2; zero_bits <= 20; zero_bits++)
1451 "NtMapViewOfSection with %d zero_bits returned %08lx\n", (
int)zero_bits,
status);
1454 ok(((
UINT_PTR)ptr2 >> (32 - zero_bits)) == 0,
1455 "NtMapViewOfSection with %d zero_bits returned address %p\n", (
int)zero_bits, ptr2);
1468 "NtMapViewOfSection returned %08lx\n",
status);
1476 "NtMapViewOfSection returned %08lx\n",
status);
1481 zero_bits = 0x1aaaaaaa;
1492 "NtMapViewOfSection returned %08lx\n",
status);
1496 ((
UINT_PTR)ptr2 & ~zero_bits) != 0,
1497 "NtMapViewOfSection returned address %p\n", ptr2);
1519 ptr2 = (
char *)
ptr + 42;
1526 ptr2 = (
char *)
ptr + 0x1000;
1533 ptr2 = (
char *)
ptr + 0x1000;
1539 "NtMapViewOfSection returned %08lx\n",
status);
1541 ptr2 = (
char *)
ptr + 0x1000;
1558 ptr2 = (
char *)
ptr + 42;
1566 ptr2 = (
char *)
ptr + 0x1000;
1572 ok((
char *)ptr2 == (
char *)
ptr + 0x1000,
1573 "expected address %p, got %p\n", (
char *)
ptr + 0x1000, ptr2);
1578 ptr2 = (
char *)
ptr + 0x1001;
1584 ok((
char *)ptr2 == (
char *)
ptr + 0x1000,
1585 "expected address %p, got %p\n", (
char *)
ptr + 0x1000, ptr2);
1589 ptr2 = (
char *)
ptr + 0x2000;
1595 ok((
char *)ptr2 == (
char *)
ptr + 0x2000,
1596 "expected address %p, got %p\n", (
char *)
ptr + 0x2000, ptr2);
1602 ptr2 = (
char *)
ptr + 0x1000;
1609 "NtMapViewOfSection returned %08lx\n",
status);
1627 ok(
mapping != 0,
"CreateFileMapping failed\n");
1632 zero_bits = 0x7fffffff;
1636 ok(!((
ULONG_PTR)
ptr & 0xffff),
"returned memory %p is not aligned to 64k\n",
ptr);
1639 win_skip(
"Skipping test on pre-Win7, because it's broken\n");
1657 static const char testfile[] =
"testfile.xxx";
1658 static const char data[] =
"test data for NtMapViewOfSectionEx";
1670 if (!pNtMapViewOfSectionEx)
1672 win_skip(
"NtMapViewOfSectionEx() is not supported.\n");
1688 ok(
mapping != 0,
"CreateFileMapping failed\n");
1704 ok(!((
ULONG_PTR)
ptr & 0xffff),
"returned memory %p is not aligned to 64k\n",
ptr);
1707 ok(
ret,
"ReadProcessMemory failed\n");
1726 ptr2 = (
char *)
ptr + 42;
1733 ptr2 = (
char *)
ptr + 0x1000;
1748 ptr2 = (
char *)
ptr + 42;
1755 ptr2 = (
char *)
ptr + 0x1000;
1760 ok((
char *)ptr2 == (
char *)
ptr + 0x1000,
1761 "expected address %p, got %p\n", (
char *)
ptr + 0x1000, ptr2);
1766 ptr2 = (
char *)
ptr + 0x1001;
1771 ok((
char *)ptr2 == (
char *)
ptr + 0x1000,
1772 "expected address %p, got %p\n", (
char *)
ptr + 0x1000, ptr2);
1776 ptr2 = (
char *)
ptr + 0x2000;
1781 ok((
char *)ptr2 == (
char *)
ptr + 0x2000,
1782 "expected address %p, got %p\n", (
char *)
ptr + 0x2000, ptr2);
1788 ptr2 = (
char *)
ptr + 0x1000;
1794 "NtMapViewOfSection returned %08lx\n",
status);
1819 ext[0].Pointer = &
a;
1833 a.LowestStartingAddress =
NULL;
1835 a.HighestEndingAddress = (
void *)(0x20001000 + 1);
1841 a.HighestEndingAddress = (
void *)(0x20001000 - 2);
1847 a.HighestEndingAddress = (
void *)(0x20000800 - 1);
1867 a.HighestEndingAddress = (
void *)(0x20001000 - 1);
1878 a.HighestEndingAddress = (
void *)(0x20001000 - 1);
1882 a.HighestEndingAddress =
NULL;
1883 a.Alignment = 0x30000;
1889 for (
a.Alignment = 1;
a.Alignment;
a.Alignment *= 2)
1905 ok(
mapping != 0,
"CreateFileMapping failed\n" );
1937 else win_skip(
"MemExtendedParameterImageMachine not supported\n" );
1946#define SUPPORTED_XSTATE_FEATURES ((1 << XSTATE_LEGACY_FLOATING_POINT) | (1 << XSTATE_LEGACY_SSE) | (1 << XSTATE_AVX))
1950 struct old_xstate_configuration
1954 ULONG OptimizedSave:1;
1955 ULONG CompactionEnabled:1;
1959 static const ULONG feature_offsets[] =
1965 static const ULONG feature_sizes[] =
1977 "Got number of physical pages %#lx, expected %#lx.\n",
1980#if defined(__i386__) || defined(__x86_64__)
1982 "_RDTSC not available.\n");
1986 "Got unexpected ActiveProcessorCount %lu.\n",
user_shared_data->ActiveProcessorCount);
1989 "Got unexpected ActiveGroupCount %u.\n",
user_shared_data->ActiveGroupCount);
1991 if (!pRtlGetEnabledExtendedFeatures)
1993 win_skip(
"RtlGetEnabledExtendedFeatures is not available.\n");
2000 skip(
"XState features are not available.\n");
2006 struct old_xstate_configuration *xs_old
2009 ok(
feature_mask == xs_old->EnabledFeatures,
"Got unexpected xs_old->EnabledFeatures %s.\n",
2011 win_skip(
"Old structure layout.\n");
2015 trace(
"XState EnabledFeatures %#I64x, EnabledSupervisorFeatures %#I64x, EnabledVolatileFeatures %I64x.\n",
2029 ok(xstate.
Size >= 512 +
sizeof(
XSTATE),
"Got unexpected Size %lu.\n", xstate.
Size);
2031 ok(xstate.
OptimizedSave,
"Got zero OptimizedSave with compaction enabled.\n");
2042 "Got unexpected AllFeatures[%u] %lu, expected %lu.\n",
i,
2044 ok(xstate.
Features[
i].
Size == feature_sizes[
i],
"Got unexpected Features[%u].Size %lu, expected %lu.\n",
i,
2046 ok(xstate.
Features[
i].
Offset == feature_offsets[
i],
"Got unexpected Features[%u].Offset %lu, expected %lu.\n",
2057 ULONG protect_old[96],
i;
2072 while (rel && rel < end - 1 && rel->SizeOfBlock)
2075 (
USHORT *)(rel + 1), delta );
2081 &
size, protect_old[
i], &protect_old[
i] );
2108 ok(
ptr !=
NULL,
"VirtualAlloc failed\n" );
2132 skip(
"modules are not identical (non-PE build?)\n" );
2143 ok(
func == (
void *)pNtClose,
"wrong ptr %p / %p\n",
func, pNtClose );
2145 ok( (
char *)
func - (
char *)pNtClose == delta,
"wrong ptr %p / %p\n",
func, pNtClose );
2147 else win_skip(
"RtlFindExportedRoutineByName not supported\n" );
2149 if (!
memcmp( pNtClose, (
char *)pNtClose + delta, 32 ))
2151 pNtClose = (
void *)((
char *)pNtClose + delta);
2164 void *exec_mem, *va_ptr;
2169 ok( !!exec_mem,
"got NULL.\n" );
2174 (
char *)pNtQueryInformationProcess - (
char *)
module,
NULL );
2175 ok( !!va_ptr,
"offset not found %p / %p\n", pNtQueryInformationProcess,
module );
2180 if (!
memcmp( exec_mem, pNtQueryInformationProcess, 5 ))
2182 pNtQueryInformationProcess = exec_mem;
2190 ok( 0,
"file on disk doesn't match syscall %x / %x\n",
2191 *(
UINT *)pNtQueryInformationProcess, *(
UINT *)exec_mem );
2194#elif defined __x86_64__
2195 ok( 0,
"syscall thunk relocated\n" );
2197 skip(
"syscall thunk relocated\n" );
2219 addr = (
char *)addr1 + 0x1000;
2228 addr = (
char *)addr1 + 0x1001;
2232 ok(
size == 0xffff,
"Unexpected size %p.\n", (
void *)
size);
2233 ok(
addr == (
char *)addr1 + 0x1001,
"Got addr %p, addr1 %p.\n",
addr, addr1);
2236 addr = (
char *)addr1 + 0x1001;
2239 *(
volatile char *)addr1 = 1;
2240 *((
volatile char *)addr1 + 0x2000) = 1;
2241 ok(
size == 0x1000,
"Unexpected size %p.\n", (
void *)
size);
2242 ok(
addr == (
char *)addr1 + 0x1000,
"Got addr %p, addr1 %p.\n",
addr, addr1);
2245 addr = (
char *)addr1 + 1;
2248 *((
volatile char *)addr1 + 0x2000) = 1;
2249 ok(
size == 0x1000,
"Unexpected size %p.\n", (
void *)
size);
2250 ok(
addr == addr1,
"Got addr %p, addr1 %p.\n",
addr, addr1);
2256 ok(
addr == addr1,
"Unexpected addr %p, addr1 %p.\n",
addr, addr1);
2257 ok(
size == 0x1000,
"Unexpected size %p.\n", (
void *)
size);
2268 addr = (
char *)addr1 + 0x1000;
2273 addr = (
char *)addr1 + 0x1000;
2278 addr = (
char *)addr1 + 0x2000;
2291 ULONG reservedarg = 0;
2292 char stackmem[] =
"Test stack mem";
2293 static char testmem[] =
"Test memory range data";
2295 if (!pNtSetInformationVirtualMemory)
2297 skip(
"no NtSetInformationVirtualMemory in ntdll\n");
2303 "NtSetInformationVirtualMemory unexpected status on invalid info class (1): %08lx\n",
status);
2307 "NtSetInformationVirtualMemory unexpected status on invalid info class (2): %08lx\n",
status);
2311 "NtSetInformationVirtualMemory unexpected status on invalid info class (3): %08lx\n",
status);
2314 1, entries,
NULL, 0 );
2317 "NtSetInformationVirtualMemory unexpected status on NULL info data (1): %08lx\n",
status);
2322 "NtSetInformationVirtualMemory unexpected status on NULL info data (2): %08lx\n",
status);
2327 "NtSetInformationVirtualMemory unexpected status on NULL info data (3): %08lx\n",
status);
2330 1, entries, &reservedarg,
sizeof(reservedarg) * 2 );
2332 "NtSetInformationVirtualMemory unexpected status on extended info data (1): %08lx\n",
status);
2335 0,
NULL, &reservedarg,
sizeof(reservedarg) * 2 );
2337 "NtSetInformationVirtualMemory unexpected status on extended info data (2): %08lx\n",
status);
2340 1, entries, &reservedarg,
sizeof(reservedarg) / 2 );
2342 "NtSetInformationVirtualMemory unexpected status on shrunk info data (1): %08lx\n",
status);
2345 0,
NULL, &reservedarg,
sizeof(reservedarg) / 2 );
2347 "NtSetInformationVirtualMemory unexpected status on shrunk info data (2): %08lx\n",
status);
2350 0,
NULL, &reservedarg,
sizeof(reservedarg) );
2352 "NtSetInformationVirtualMemory unexpected status on 0 entries: %08lx\n",
status);
2355 1,
NULL, &reservedarg,
sizeof(reservedarg) );
2357 "NtSetInformationVirtualMemory unexpected status on NULL entries: %08lx\n",
status);
2362 1, entries, &reservedarg,
sizeof(reservedarg) );
2365 "NtSetInformationVirtualMemory unexpected status on 1 empty entry: %08lx\n",
status);
2370 1, entries, &reservedarg,
sizeof(reservedarg) );
2373 "NtSetInformationVirtualMemory unexpected status on 1 NULL address entry: %08lx\n",
status);
2378 1, entries, &reservedarg,
sizeof(reservedarg) );
2381 "NtSetInformationVirtualMemory unexpected status on 1 page-aligned entry: %08lx\n",
status);
2386 1, entries, &reservedarg,
sizeof(reservedarg) );
2389 "NtSetInformationVirtualMemory unexpected status on 1 entry: %08lx\n",
status);
2394 1, entries, &reservedarg,
sizeof(reservedarg) );
2397 "NtSetInformationVirtualMemory unexpected status on 1 unmapped entry: %08lx\n",
status);
2404 2, entries, &reservedarg,
sizeof(reservedarg) );
2407 "NtSetInformationVirtualMemory unexpected status on 2 page-aligned entries: %08lx\n",
status);
2440 ok(
info.AllocationBase ==
ptr,
"Unexpected base %p.\n",
info.AllocationBase);
2442 ok(!
info.Private,
"Unexpected flag %d.\n",
info.Private);
2443 ok(!
info.MappedDataFile,
"Unexpected flag %d.\n",
info.MappedDataFile);
2444 ok(!
info.MappedImage,
"Unexpected flag %d.\n",
info.MappedImage);
2445 ok(!
info.MappedPageFile,
"Unexpected flag %d.\n",
info.MappedPageFile);
2446 ok(!
info.MappedPhysical,
"Unexpected flag %d.\n",
info.MappedPhysical);
2447 ok(!
info.DirectMapped,
"Unexpected flag %d.\n",
info.DirectMapped);
2448 ok(
info.RegionSize ==
size,
"Unexpected region size.\n");
2463 ok(
info.AllocationBase ==
ptr,
"Unexpected base %p.\n",
info.AllocationBase);
2465 ok(!
info.Private,
"Unexpected flag %d.\n",
info.Private);
2466 ok(!
info.MappedDataFile,
"Unexpected flag %d.\n",
info.MappedDataFile);
2467 ok(!
info.MappedImage,
"Unexpected flag %d.\n",
info.MappedImage);
2468 ok(!
info.MappedPageFile,
"Unexpected flag %d.\n",
info.MappedPageFile);
2469 ok(!
info.MappedPhysical,
"Unexpected flag %d.\n",
info.MappedPhysical);
2470 ok(!
info.DirectMapped,
"Unexpected flag %d.\n",
info.DirectMapped);
2471 ok(
info.RegionSize ==
size,
"Unexpected region size.\n");
2479 ok(
mapping != 0,
"CreateFileMapping failed\n");
2490 ok(
info.AllocationBase ==
ptr,
"Unexpected base %p.\n",
info.AllocationBase);
2492 ok(!
info.Private,
"Unexpected flag %d.\n",
info.Private);
2493 ok(!
info.MappedDataFile,
"Unexpected flag %d.\n",
info.MappedDataFile);
2494 ok(!
info.MappedImage,
"Unexpected flag %d.\n",
info.MappedImage);
2495 ok(!
info.MappedPageFile,
"Unexpected flag %d.\n",
info.MappedPageFile);
2496 ok(!
info.MappedPhysical,
"Unexpected flag %d.\n",
info.MappedPhysical);
2497 ok(!
info.DirectMapped,
"Unexpected flag %d.\n",
info.DirectMapped);
2498 ok(
info.RegionSize == 4096,
"Unexpected region size.\n");
2529 win_skip(
"MemoryImageInformation not supported\n" );
2535 ok( !
info.ImageBase,
"wrong image base %p/%p\n",
info.ImageBase,
ptr );
2536 ok( !
info.SizeOfImage,
"wrong size %Ix/%Ix\n",
info.SizeOfImage,
size );
2537 ok( !
info.ImageFlags,
"wrong flags %lx\n",
info.ImageFlags );
2549 ok(
len == 0xdead,
"wrong len %Ix\n",
len );
2561 ok( !
info.ImageBase,
"wrong image base %p/%p\n",
info.ImageBase,
ptr );
2562 ok( !
info.SizeOfImage,
"wrong size %Ix/%Ix\n",
info.SizeOfImage,
size );
2563 ok( !
info.ImageFlags,
"wrong flags %lx\n",
info.ImageFlags );
2576 ok(
info.ImageBase ==
ptr,
"wrong image base %p/%p\n",
info.ImageBase,
ptr );
2579 ok( !
info.ImagePartialMap,
"wrong partial map\n" );
2580 ok( !
info.ImageNotExecutable,
"wrong not executable\n" );
2581 ok(
info.ImageSigningLevel == 0 ||
info.ImageSigningLevel == 12,
2582 "wrong signing level %u\n",
info.ImageSigningLevel );
2589 ok(
mapping != 0,
"CreateFileMapping failed\n" );
2602 ok(
info.ImageBase ==
ptr,
"wrong image base %p/%p\n",
info.ImageBase,
ptr );
2604 ok( !
info.ImagePartialMap,
"wrong partial map\n" );
2605 ok( !
info.ImageNotExecutable,
"wrong not executable\n" );
2606 ok(
info.ImageSigningLevel == 0 ||
info.ImageSigningLevel == 12,
2607 "wrong signing level %u\n",
info.ImageSigningLevel );
2616 ok(
mapping != 0,
"CreateFileMapping failed\n" );
2624 ok(
size == 0x4000,
"wrong size %Ix\n",
size );
2632 ok(
info.ImageBase ==
ptr,
"wrong image base %p/%p\n",
info.ImageBase,
ptr );
2636 ok(
info.ImagePartialMap,
"wrong partial map\n" );
2637 ok( !
info.ImageNotExecutable,
"wrong not executable\n" );
2638 ok(
info.ImageSigningLevel == 0 ||
info.ImageSigningLevel == 12,
2639 "wrong signing level %u\n",
info.ImageSigningLevel );
2646 ok(
mapping != 0,
"CreateFileMapping failed\n" );
2654 ok(
size == 0x5000,
"wrong size %Ix\n",
size );
2662 ok(
info.ImageBase ==
ptr,
"wrong image base %p/%p\n",
info.ImageBase,
ptr );
2666 ok(
info.ImagePartialMap,
"wrong partial map\n" );
2667 ok( !
info.ImageNotExecutable,
"wrong not executable\n" );
2668 ok(
info.ImageSigningLevel == 0 ||
info.ImageSigningLevel == 12,
2669 "wrong signing level %u\n",
info.ImageSigningLevel );
2676 ok(
mapping != 0,
"CreateFileMapping failed\n" );
2689 ok( !
info.ImageBase,
"wrong image base %p/%p\n",
info.ImageBase,
ptr );
2690 ok( !
info.SizeOfImage,
"wrong size %Ix/%Ix\n",
info.SizeOfImage,
size );
2691 ok( !
info.ImageFlags,
"wrong flags %lx\n",
info.ImageFlags );
2698 ok(
mapping != 0,
"CreateFileMapping failed\n" );
2711 ok( !
info.ImageBase,
"wrong image base %p/%p\n",
info.ImageBase,
ptr );
2712 ok( !
info.SizeOfImage,
"wrong size %Ix/%Ix\n",
info.SizeOfImage,
size );
2713 ok( !
info.ImageFlags,
"wrong flags %lx\n",
info.ImageFlags );
2741 mem.ThreadAllowWrites = 0;
2774 mem.ProcessEnableWriteExceptions = 1;
2777 skip(
"skipping test on ARM64EC\n" );
2781 "NtSetInformationProcess failed %lx\n",
status );
2791 mem.ProcessEnableWriteExceptions = 1;
2822 range.NumberOfBytes = 1;
2826 ok( !
status,
"NtSetInformationVirtualMemory failed %lx\n",
status );
2873 range.NumberOfBytes = 1;
2877 ok( !
status,
"NtSetInformationVirtualMemory failed %lx\n",
status );
2898 ok( addresses[0] ==
ptr,
"wrong ptr %p / %p\n", addresses[0],
ptr );
2910 ok( addresses[0] ==
ptr,
"wrong ptr %p / %p\n", addresses[0],
ptr );
2921 ok( addresses[0] ==
ptr,
"wrong ptr %p / %p\n", addresses[0],
ptr );
2924 range.NumberOfBytes = 1;
2928 ok( !
status,
"NtSetInformationVirtualMemory failed %lx\n",
status );
2948 mem.ProcessEnableWriteExceptions = 0;
2959 mem.ProcessEnableWriteExceptions = 1;
2960 mem.ThreadAllowWrites = 1;
2967 mem.ProcessEnableWriteExceptions = 0;
2968 mem.ThreadAllowWrites = 0;
3013 pGetEnabledXStateFeatures = (
void *)
GetProcAddress(
mod,
"GetEnabledXStateFeatures");
3019 pRtlGetEnabledExtendedFeatures = (
void *)
GetProcAddress(
mod,
"RtlGetEnabledExtendedFeatures");
3020 pRtlGetNativeSystemInformation = (
void *)
GetProcAddress(
mod,
"RtlGetNativeSystemInformation");
3022 pNtAllocateVirtualMemoryEx = (
void *)
GetProcAddress(
mod,
"NtAllocateVirtualMemoryEx");
3024 pNtSetInformationVirtualMemory = (
void *)
GetProcAddress(
mod,
"NtSetInformationVirtualMemory");
NTSTATUS NTAPI NtUnmapViewOfSection(IN HANDLE ProcessHandle, IN PVOID BaseAddress)
NTSTATUS NTAPI NtMapViewOfSection(IN HANDLE SectionHandle, IN HANDLE ProcessHandle, IN OUT PVOID *BaseAddress, IN ULONG_PTR ZeroBits, IN SIZE_T CommitSize, IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, IN OUT PSIZE_T ViewSize, IN SECTION_INHERIT InheritDisposition, IN ULONG AllocationType, IN ULONG Protect)
std::map< E_MODULE, HMODULE > mod
COMPILER_DEPENDENT_UINT64 UINT64
@ ProcessBasicInformation
enum _PROCESSINFOCLASS PROCESSINFOCLASS
#define STATUS_INVALID_HANDLE
#define STATUS_NOT_SUPPORTED
static BOOL reserve(struct dynamic_array *array, int count, int itemsize)
#define ReadProcessMemory(a, b, c, d, e)
#define ReadFile(a, b, c, d, e)
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define CreateFileMappingW(a, b, c, d, e, f)
#define CreateFileA(a, b, c, d, e, f, g)
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
#define GetCurrentProcess()
static const WCHAR *const ext[]
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI SetEndOfFile(HANDLE hFile)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
VOID WINAPI ExitThread(IN DWORD uExitCode)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(const char *app_name, char *cmd_line, SECURITY_ATTRIBUTES *process_attr, SECURITY_ATTRIBUTES *thread_attr, BOOL inherit, DWORD flags, void *env, const char *cur_dir, STARTUPINFOA *startup_info, PROCESS_INFORMATION *info)
static const struct _KUSER_SHARED_DATA * user_shared_data
UINT(* handler)(MSIPACKAGE *)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
HANDLE NTAPI CreateFileMappingA(IN HANDLE hFile, IN LPSECURITY_ATTRIBUTES lpFileMappingAttributes, IN DWORD flProtect, IN DWORD dwMaximumSizeHigh, IN DWORD dwMaximumSizeLow, IN LPCSTR lpName)
enum _SYSTEM_INFORMATION_CLASS SYSTEM_INFORMATION_CLASS
#define STATUS_ACCESS_VIOLATION
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum const GLvoid * addr
GLenum GLenum GLenum GLenum mapping
GLboolean GLboolean GLboolean GLboolean a
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 flag
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
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 * u
#define EXCEPTION_CONTINUE_EXECUTION
PIMAGE_BASE_RELOCATION NTAPI LdrProcessRelocationBlock(_In_ ULONG_PTR Address, _In_ ULONG Count, _In_ PUSHORT TypeOffset, _In_ LONG_PTR Delta)
#define memcpy(s1, s2, n)
static struct test_info tests[]
static PROCESS_INFORMATION pi
static const OBJECT_ATTRIBUTES const LARGE_INTEGER ULONG
static const OBJECT_ATTRIBUTES const LARGE_INTEGER HANDLE
static HANDLE create_target_process(const char *arg)
static ULONG64 feature_mask
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK io
static void check_region_size_(void *p, SIZE_T s, unsigned int line)
static void test_NtAllocateVirtualMemoryEx(void)
static void *WINAPI * pRtlFindExportedRoutineByName(HMODULE, const char *)
static void test_syscalls(void)
static INITIAL_TEB *static SECURITY_DESCRIPTOR BOOLEAN
static void test_query_region_information(void)
#define check_region_size(p, s)
static PMEMORY_RANGE_ENTRY
static UINT_PTR get_zero_bits(UINT_PTR p)
static void DECLSPEC_NOINLINE force_stack_grow(void)
static DWORD WINAPI test_stack_growth_thread(void *ptr)
static DWORD WINAPI test_stack_size_dummy_thread(void *ptr)
static INITIAL_TEB *static SECURITY_DESCRIPTOR PRTL_THREAD_START_ROUTINE
static void test_NtMapViewOfSection(void)
static VIRTUAL_MEMORY_INFORMATION_CLASS
static void test_user_shared_data(void)
static UINT_PTR get_zero_bits_mask(ULONG_PTR z)
static void test_NtAllocateVirtualMemoryEx_address_requirements(void)
static void test_prefetch(void)
static void test_NtAllocateVirtualMemory(void)
static const BOOL is_win64
#define SUPPORTED_XSTATE_FEATURES
static void perform_relocations(void *module, INT_PTR delta)
static void test_NtMapViewOfSectionEx(void)
static void DECLSPEC_NOINLINE force_stack_grow_small(void)
static LONG CALLBACK exec_write_handler(EXCEPTION_POINTERS *ptrs)
static void test_query_image_information(void)
static void test_NtFreeVirtualMemory(void)
static DWORD WINAPI test_stack_size_thread(void *ptr)
static void test_RtlCreateUserStack(void)
static SYSTEM_BASIC_INFORMATION sbi
static void test_exec_memory_writes(void)
unsigned __int3264 UINT_PTR
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T CommitSize
__kernel_entry _Inout_ _Inout_ PSIZE_T RegionSize
#define NtCurrentProcess()
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
#define PAGE_EXECUTE_WRITECOPY
#define PAGE_EXECUTE_READWRITE
#define DECLSPEC_NOINLINE
#define IMAGE_FIRST_SECTION(NtHeader)
NTSTATUS NTAPI NtGetWriteWatch(IN HANDLE ProcessHandle, IN ULONG Flags, IN PVOID BaseAddress, IN SIZE_T RegionSize, IN PVOID *UserAddressArray, OUT PULONG_PTR EntriesInUserAddressArray, OUT PULONG Granularity)
NTSTATUS NTAPI NtFreeVirtualMemory(IN HANDLE ProcessHandle, IN PVOID *UBaseAddress, IN PSIZE_T URegionSize, IN ULONG FreeType)
NTSTATUS NTAPI NtProtectVirtualMemory(IN HANDLE ProcessHandle, IN OUT PVOID *UnsafeBaseAddress, IN OUT SIZE_T *UnsafeNumberOfBytesToProtect, IN ULONG NewAccessProtection, OUT PULONG UnsafeOldAccessProtection)
NTSTATUS NTAPI NtQueryVirtualMemory(IN HANDLE ProcessHandle, IN PVOID BaseAddress, IN MEMORY_INFORMATION_CLASS MemoryInformationClass, OUT PVOID MemoryInformation, IN SIZE_T MemoryInformationLength, OUT PSIZE_T ReturnLength)
NTSTATUS NTAPI NtAllocateVirtualMemory(IN HANDLE ProcessHandle, IN OUT PVOID *UBaseAddress, IN ULONG_PTR ZeroBits, IN OUT PSIZE_T URegionSize, IN ULONG AllocationType, IN ULONG Protect)
NTSTATUS NTAPI NtSetInformationProcess(_In_ HANDLE ProcessHandle, _In_ PROCESSINFOCLASS ProcessInformationClass, _In_reads_bytes_(ProcessInformationLength) PVOID ProcessInformation, _In_ ULONG ProcessInformationLength)
NTSTATUS NTAPI NtSetInformationThread(_In_ HANDLE ThreadHandle, _In_ THREADINFOCLASS ThreadInformationClass, _In_reads_bytes_(ThreadInformationLength) PVOID ThreadInformation, _In_ ULONG ThreadInformationLength)
NTSTATUS NTAPI NtQueryInformationProcess(_In_ HANDLE ProcessHandle, _In_ PROCESSINFOCLASS ProcessInformationClass, _Out_writes_bytes_to_opt_(ProcessInformationLength, *ReturnLength) PVOID ProcessInformation, _In_ ULONG ProcessInformationLength, _Out_opt_ PULONG ReturnLength)
#define STATUS_INVALID_ADDRESS
#define STATUS_MAPPED_ALIGNMENT
#define STATUS_UNABLE_TO_FREE_VM
#define STATUS_MEMORY_NOT_ALLOCATED
#define STATUS_INVALID_PARAMETER_9
#define STATUS_INVALID_PARAMETER_4
#define STATUS_INVALID_PARAMETER_2
#define STATUS_FREE_VM_NOT_AT_BASE
#define STATUS_EXECUTABLE_MEMORY_WRITE
#define STATUS_INVALID_PARAMETER_6
#define STATUS_IN_PAGE_ERROR
#define STATUS_CONFLICTING_ADDRESSES
#define STATUS_INVALID_INFO_CLASS
#define STATUS_INVALID_PARAMETER_3
#define STATUS_IMAGE_NOT_AT_BASE
#define STATUS_INVALID_PARAMETER_5
#define STATUS_REVISION_MISMATCH
#define IMAGE_DIRECTORY_ENTRY_BASERELOC
#define IMAGE_FILE_MACHINE_R4000
#define IMAGE_FILE_MACHINE_R3000
#define offsetof(TYPE, MEMBER)
int winetest_get_mainargs(char ***pargv)
#define _WIN32_WINNT_WIN7
NTSTATUS NTAPI NtReadFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, ULONG Length, PLARGE_INTEGER ByteOffset, PULONG Key)
NTSYSAPI NTSTATUS NTAPI NtQuerySystemInformation(IN SYSTEM_INFORMATION_CLASS SystemInfoClass, OUT PVOID SystemInfoBuffer, IN ULONG SystemInfoBufferSize, OUT PULONG BytesReturned OPTIONAL)
PEXCEPTION_RECORD ExceptionRecord
ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]
PVOID lpMaximumApplicationAddress
XSTATE_FEATURE Features[MAXIMUM_XSTATE_FEATURES]
ULONG64 EnabledSupervisorFeatures
ULONG64 EnabledVolatileFeatures
ULONG AllFeatures[MAXIMUM_XSTATE_FEATURES]
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
#define FIELD_OFFSET(t, f)
#define STATUS_INVALID_PARAMETER
#define STATUS_INFO_LENGTH_MISMATCH
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFDMATRANSACTION _In_ PFN_WDF_PROGRAM_DMA _In_ WDF_DMA_DIRECTION _In_ PMDL _In_ PVOID VirtualAddress
LPVOID NTAPI VirtualAlloc(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flAllocationType, IN DWORD flProtect)
BOOL NTAPI VirtualProtect(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flNewProtect, OUT PDWORD lpflOldProtect)
BOOL NTAPI VirtualFree(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD dwFreeType)
DWORD WINAPI GetLastError(void)
HANDLE WINAPI GetCurrentThread(void)
#define STACK_SIZE_PARAM_IS_A_RESERVATION
_Inout_ PERBANDINFO * pbi
@ MemoryRegionInformation
NTSYSAPI ULONG WINAPI RtlRemoveVectoredExceptionHandler(PVOID)
@ VmPageDirtyStateInformation
@ ThreadManageWritesToExecutableMemory
NTSYSAPI NTSTATUS WINAPI RtlGetNativeSystemInformation(SYSTEM_INFORMATION_CLASS, void *, ULONG, ULONG *)
@ ProcessManageWritesToExecutableMemory
NTSYSAPI PVOID WINAPI RtlAddVectoredExceptionHandler(ULONG, PVECTORED_EXCEPTION_HANDLER)
struct _YMMCONTEXT YMMCONTEXT
#define WRITE_WATCH_FLAG_RESET
#define MEM_REPLACE_PLACEHOLDER
#define MEM_EXTENDED_PARAMETER_EC_CODE
#define PROCESSOR_ARCHITECTURE_ARM64
#define MEM_PRESERVE_PLACEHOLDER
#define MEM_RESERVE_PLACEHOLDER
#define MEM_COALESCE_PLACEHOLDERS
@ MemExtendedParameterAttributeFlags
@ MemExtendedParameterAddressRequirements
@ MemExtendedParameterImageMachine
@ MemExtendedParameterMax
#define MAXIMUM_XSTATE_FEATURES
#define PF_RDTSC_INSTRUCTION_AVAILABLE