Author: pschweitzer Date: Sun Oct 11 21:10:03 2015 New Revision: 69504
URL: http://svn.reactos.org/svn/reactos?rev=69504&view=rev Log: [NTDLL_APITESTS] Add a test that shows that RtlAllocateHeap() totally ignores HEAP_CREATE_ALIGN_16
Added: trunk/rostests/apitests/ntdll/RtlAllocateHeap.c (with props) Modified: trunk/rostests/apitests/ntdll/CMakeLists.txt trunk/rostests/apitests/ntdll/testlist.c
Modified: trunk/rostests/apitests/ntdll/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/CMakeLists.... ============================================================================== --- trunk/rostests/apitests/ntdll/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/apitests/ntdll/CMakeLists.txt [iso-8859-1] Sun Oct 11 21:10:03 2015 @@ -17,6 +17,7 @@ NtQuerySystemEnvironmentValue.c NtQueryVolumeInformationFile.c NtSaveKey.c + RtlAllocateHeap.c RtlBitmap.c RtlCopyMappedMemory.c RtlDetermineDosPathNameType.c
Added: trunk/rostests/apitests/ntdll/RtlAllocateHeap.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/RtlAllocate... ============================================================================== --- trunk/rostests/apitests/ntdll/RtlAllocateHeap.c (added) +++ trunk/rostests/apitests/ntdll/RtlAllocateHeap.c [iso-8859-1] Sun Oct 11 21:10:03 2015 @@ -0,0 +1,37 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: GPLv2+ - See COPYING in the top level directory + * PURPOSE: Test for RtlAllocateHeap + * PROGRAMMER: Pierre Schweitzer pierre@reactos.org + */ + +#include <apitest.h> + +#define WIN32_NO_STATUS +#include <ndk/rtlfuncs.h> + +PVOID Buffers[0x100]; + +START_TEST(RtlAllocateHeap) +{ + USHORT i; + BOOLEAN Aligned = TRUE; + + for (i = 0; i < 0x100; ++i) + { + SetLastError(0xdeadbeef); + Buffers[i] = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_CREATE_ALIGN_16, (i % 16 ) + 1); + ASSERT(Buffers[i] != NULL); + if (!((ULONG_PTR)Buffers[i] & 0x2)) + { + Aligned = FALSE; + } + } + + for (i = 0; i < 0x100; ++i) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, Buffers[i]); + } + + ok(Aligned == FALSE, "No unaligned address returned\n"); +}
Propchange: trunk/rostests/apitests/ntdll/RtlAllocateHeap.c ------------------------------------------------------------------------------ svn:eol-style = native
Modified: trunk/rostests/apitests/ntdll/testlist.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/testlist.c?... ============================================================================== --- trunk/rostests/apitests/ntdll/testlist.c [iso-8859-1] (original) +++ trunk/rostests/apitests/ntdll/testlist.c [iso-8859-1] Sun Oct 11 21:10:03 2015 @@ -21,6 +21,7 @@ extern void func_NtQueryVolumeInformationFile(void); extern void func_NtSaveKey(void); extern void func_NtSystemInformation(void); +extern void func_RtlAllocateHeap(void); extern void func_RtlBitmap(void); extern void func_RtlCopyMappedMemory(void); extern void func_RtlDetermineDosPathNameType(void); @@ -60,6 +61,7 @@ { "NtQueryVolumeInformationFile", func_NtQueryVolumeInformationFile }, { "NtSaveKey", func_NtSaveKey}, { "NtSystemInformation", func_NtSystemInformation }, + { "RtlAllocateHeap", func_RtlAllocateHeap }, { "RtlBitmapApi", func_RtlBitmap }, { "RtlCopyMappedMemory", func_RtlCopyMappedMemory }, { "RtlDetermineDosPathNameType", func_RtlDetermineDosPathNameType },