Module: wine Branch: master Commit: 670d6391c41242aa71fc25e1916add06a05f6b97 URL: https://gitlab.winehq.org/wine/wine/-/commit/670d6391c41242aa71fc25e1916add0...
Author: Alex Henrie alexhenrie24@gmail.com Date: Thu Nov 2 22:07:35 2023 -0600
msvfw32/tests: Use CRT allocation functions.
---
dlls/msvfw32/tests/drawdib.c | 8 ++++---- dlls/msvfw32/tests/mciwnd.c | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/dlls/msvfw32/tests/drawdib.c b/dlls/msvfw32/tests/drawdib.c index 92e60df264f..dc50429b40d 100644 --- a/dlls/msvfw32/tests/drawdib.c +++ b/dlls/msvfw32/tests/drawdib.c @@ -63,7 +63,7 @@ static char *hash_dib(const BITMAPINFO *bmi, const void *bits) CryptGetHashParam(hash, HP_HASHVAL, hash_buf, &hash_size, 0); CryptDestroyHash(hash);
- buf = HeapAlloc(GetProcessHeap(), 0, hash_size * 2 + 1); + buf = malloc(hash_size * 2 + 1);
for(i = 0; i < hash_size; i++) { @@ -131,7 +131,7 @@ static void test_DrawDib_sizeimage(void)
init_bmi(&src_info, WIDTH, HEIGHT, 0); src_dib_size = get_dib_size(&src_info); - src_bits = HeapAlloc(GetProcessHeap(), 0, src_dib_size); + src_bits = malloc(src_dib_size); ok(src_bits != NULL, "Can't allocate memory\n"); memset(src_bits, 0x88, src_dib_size);
@@ -160,13 +160,13 @@ static void test_DrawDib_sizeimage(void) ok(strcmp(hash, test_data[i].hash) == 0, "[%u] got %s, expected %s\n", i, hash, test_data[i].hash); - HeapFree(GetProcessHeap(), 0, hash); + free(hash); }
r = DrawDibClose(hdd); ok(r, "DrawDibClose failed\n");
- HeapFree(GetProcessHeap(), 0, src_bits); + free(src_bits);
DeleteDC(hdc); } diff --git a/dlls/msvfw32/tests/mciwnd.c b/dlls/msvfw32/tests/mciwnd.c index 8bf4c103a6c..af368cfcb19 100644 --- a/dlls/msvfw32/tests/mciwnd.c +++ b/dlls/msvfw32/tests/mciwnd.c @@ -23,7 +23,6 @@ #include <windows.h> #include <vfw.h>
-#include "wine/heap.h" #include "wine/test.h"
static const DWORD file_header[] = /* file_header */ @@ -136,7 +135,7 @@ static BOOL create_avi_file(char *fname) if (hFile == INVALID_HANDLE_VALUE) return FALSE;
buffer_length = padding[1]; - buffer = heap_alloc_zero(buffer_length); + buffer = calloc(1, buffer_length);
WriteFile(hFile, file_header, sizeof(file_header), &written, NULL); WriteFile(hFile, &main_avi_header, sizeof(MainAVIHeader), &written, NULL); @@ -147,7 +146,7 @@ static BOOL create_avi_file(char *fname) WriteFile(hFile, buffer, buffer_length, &written, NULL); WriteFile(hFile, data, sizeof(data), &written, NULL);
- heap_free(buffer); + free(buffer);
CloseHandle(hFile); return ret;