Alexandre Julliard : kernel32/tests: Avoid some more compiler warning for HeapAlloc() invalid parameter tests.
Alexandre Julliard
julliard at winehq.org
Mon Jun 8 15:19:55 CDT 2020
Module: wine
Branch: master
Commit: 20a9ec6c4f95be000766edf5e4b2f468ccbca5d1
URL: https://source.winehq.org/git/wine.git/?a=commit;h=20a9ec6c4f95be000766edf5e4b2f468ccbca5d1
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Jun 8 14:17:56 2020 +0200
kernel32/tests: Avoid some more compiler warning for HeapAlloc() invalid parameter tests.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/kernel32/tests/heap.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/dlls/kernel32/tests/heap.c b/dlls/kernel32/tests/heap.c
index bc57498bf9..fa372b14e2 100644
--- a/dlls/kernel32/tests/heap.c
+++ b/dlls/kernel32/tests/heap.c
@@ -38,6 +38,9 @@
#define HEAP_VALIDATE_ALL 0x20000000
#define HEAP_VALIDATE_PARAMS 0x40000000
+/* use function pointers to avoid warnings for invalid parameter tests */
+static LPVOID (WINAPI *pHeapAlloc)(HANDLE,DWORD,SIZE_T);
+static LPVOID (WINAPI *pHeapReAlloc)(HANDLE,DWORD,LPVOID,SIZE_T);
static BOOL (WINAPI *pHeapQueryInformation)(HANDLE, HEAP_INFORMATION_CLASS, PVOID, SIZE_T, PSIZE_T);
static BOOL (WINAPI *pGetPhysicallyInstalledSystemMemory)(ULONGLONG *);
static ULONG (WINAPI *pRtlGetNtGlobalFlags)(void);
@@ -89,12 +92,6 @@ static void test_heap(void)
HGLOBAL hsecond;
SIZE_T size, size2;
const SIZE_T max_size = 1024, init_size = 10;
- /* use function pointers to avoid warnings for invalid parameter tests */
- LPVOID (WINAPI *pHeapAlloc)(HANDLE,DWORD,SIZE_T);
- LPVOID (WINAPI *pHeapReAlloc)(HANDLE,DWORD,LPVOID,SIZE_T);
-
- pHeapAlloc = (void *)GetProcAddress( GetModuleHandleA("kernel32"), "HeapAlloc" );
- pHeapReAlloc = (void *)GetProcAddress( GetModuleHandleA("kernel32"), "HeapReAlloc" );
/* Heap*() functions */
mem = HeapAlloc(GetProcessHeap(), 0, 0);
@@ -941,7 +938,7 @@ static void test_heap_checks( DWORD flags )
ret = HeapFree( GetProcessHeap(), 0, p );
ok( ret, "HeapFree failed\n" );
- p = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, 17 );
+ p = pHeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, 17 );
ok( p != NULL, "HeapAlloc failed\n" );
old = p[17];
p[17] = 0xcc;
@@ -1006,7 +1003,7 @@ static void test_heap_checks( DWORD flags )
/* now test large blocks */
- p = HeapAlloc( GetProcessHeap(), 0, large_size );
+ p = pHeapAlloc( GetProcessHeap(), 0, large_size );
ok( p != NULL, "HeapAlloc failed\n" );
ret = HeapValidate( GetProcessHeap(), 0, p );
@@ -1221,6 +1218,9 @@ START_TEST(heap)
int argc;
char **argv;
+ pHeapAlloc = (void *)GetProcAddress( GetModuleHandleA("kernel32"), "HeapAlloc" );
+ pHeapReAlloc = (void *)GetProcAddress( GetModuleHandleA("kernel32"), "HeapReAlloc" );
+
pRtlGetNtGlobalFlags = (void *)GetProcAddress( GetModuleHandleA("ntdll.dll"), "RtlGetNtGlobalFlags" );
argc = winetest_get_mainargs( &argv );
More information about the wine-cvs
mailing list