+static inline HANDLE ntdll_get_process_heap(void) +{ + return NtCurrentTeb()->Peb->ProcessHeap; +} + +static void test_realloc( void ) +{ + void *mem = NULL; + + mem = RtlReAllocateHeap(ntdll_get_process_heap(), 0, mem, 10); + ok(mem == NULL, "memory allocated"); +} + +START_TEST(heap) +{ + test_realloc(); +}
this will not compile on Win9x. You have to take care of: - ntdll not being present => dyn load ntdll & GetProcAddress - ntdll's internals not being present => use GetProcessHeap
A+
-- Eric Pouech