Module: wine Branch: master Commit: 14158bb57fac6194e33a284aa094c9c947e1ada4 URL: https://gitlab.winehq.org/wine/wine/-/commit/14158bb57fac6194e33a284aa094c9c...
Author: Alex Henrie alexhenrie24@gmail.com Date: Mon Nov 27 20:17:32 2023 -0700
comdlg32/tests: Use CRT allocation functions.
---
dlls/comdlg32/tests/fontdlg.c | 4 ++-- dlls/comdlg32/tests/itemdlg.c | 4 ++-- dlls/comdlg32/tests/printdlg.c | 21 ++++++++++----------- 3 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/dlls/comdlg32/tests/fontdlg.c b/dlls/comdlg32/tests/fontdlg.c index a96e6dc1590..cbcfd34a21f 100644 --- a/dlls/comdlg32/tests/fontdlg.c +++ b/dlls/comdlg32/tests/fontdlg.c @@ -57,14 +57,14 @@ static HDC get_printer_ic(void) if (info_size == 0) return NULL;
- info = HeapAlloc(GetProcessHeap(), 0, info_size); + info = malloc(info_size);
ret = EnumPrintersA(PRINTER_ENUM_LOCAL, NULL, 2, (LPBYTE)info, info_size, &info_size, &num_printers);
if (ret) result = CreateICA(info->pDriverName, info->pPrinterName, NULL, NULL);
- HeapFree(GetProcessHeap(), 0, info); + free(info);
return result; } diff --git a/dlls/comdlg32/tests/itemdlg.c b/dlls/comdlg32/tests/itemdlg.c index 15c898adc50..573a267a37e 100644 --- a/dlls/comdlg32/tests/itemdlg.c +++ b/dlls/comdlg32/tests/itemdlg.c @@ -150,7 +150,7 @@ static ULONG WINAPI IFileDialogEvents_fnRelease(IFileDialogEvents *iface) LONG ref = InterlockedDecrement(&This->ref);
if(!ref) - HeapFree(GetProcessHeap(), 0, This); + free(This);
return ref; } @@ -325,7 +325,7 @@ static IFileDialogEvents *IFileDialogEvents_Constructor(void) { IFileDialogEventsImpl *This;
- This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IFileDialogEventsImpl)); + This = calloc(1, sizeof(IFileDialogEventsImpl)); This->IFileDialogEvents_iface.lpVtbl = &vt_IFileDialogEvents; This->ref = 1;
diff --git a/dlls/comdlg32/tests/printdlg.c b/dlls/comdlg32/tests/printdlg.c index ad8ddf0a7f7..7fd4567ba9e 100644 --- a/dlls/comdlg32/tests/printdlg.c +++ b/dlls/comdlg32/tests/printdlg.c @@ -59,7 +59,7 @@ static void test_PageSetupDlgA(void) LPPAGESETUPDLGA pDlg; DWORD res;
- pDlg = HeapAlloc(GetProcessHeap(), 0, (sizeof(PAGESETUPDLGA)) * 2); + pDlg = malloc((sizeof(PAGESETUPDLGA)) * 2); if (!pDlg) return;
SetLastError(0xdeadbeef); @@ -97,7 +97,7 @@ static void test_PageSetupDlgA(void)
if (!res && (CommDlgExtendedError() == PDERR_NODEFAULTPRN)) { skip("No printer configured.\n"); - HeapFree(GetProcessHeap(), 0, pDlg); + free(pDlg); return; }
@@ -108,8 +108,7 @@ static void test_PageSetupDlgA(void) GlobalFree(pDlg->hDevMode); GlobalFree(pDlg->hDevNames);
- HeapFree(GetProcessHeap(), 0, pDlg); - + free(pDlg); }
/* ########################### */ @@ -138,7 +137,7 @@ static void test_PrintDlgA(void) LPSTR ptr; DEVMODEA *dm;
- pDlg = HeapAlloc(GetProcessHeap(), 0, (sizeof(PRINTDLGA)) * 2); + pDlg = malloc((sizeof(PRINTDLGA)) * 2); if (!pDlg) return;
@@ -178,7 +177,7 @@ static void test_PrintDlgA(void)
if (!res && (CommDlgExtendedError() == PDERR_NODEFAULTPRN)) { skip("No printer configured.\n"); - HeapFree(GetProcessHeap(), 0, pDlg); + free(pDlg); return; }
@@ -269,7 +268,7 @@ static void test_PrintDlgA(void) GlobalFree(pDlg->hDevNames); }
- HeapFree(GetProcessHeap(), 0, pDlg); + free(pDlg); }
/* ########################### */ @@ -390,7 +389,7 @@ static void test_PrintDlgExW(void) res, GetLastError(), CommDlgExtendedError() ); }
- pDlg = HeapAlloc(GetProcessHeap(), 0, (sizeof(PRINTDLGEXW)) + 8); + pDlg = malloc(sizeof(PRINTDLGEXW) + 8); if (!pDlg) return;
/* lStructSize must be exact */ @@ -471,7 +470,7 @@ static void test_PrintDlgExW(void) if (res == E_FAIL) { skip("No printer configured.\n"); - HeapFree(GetProcessHeap(), 0, pDlg); + free(pDlg); return; }
@@ -533,7 +532,7 @@ static void test_PrintDlgExW(void) if (!winetest_interactive) { skip("interactive PrintDlgEx tests (set WINETEST_INTERACTIVE=1)\n"); - HeapFree(GetProcessHeap(), 0, pDlg); + free(pDlg); return; }
@@ -552,7 +551,7 @@ static void test_PrintDlgExW(void) GlobalFree(pDlg->hDevNames); DeleteDC(pDlg->hDC);
- HeapFree(GetProcessHeap(), 0, pDlg); + free(pDlg); }
static BOOL abort_proc_called = FALSE;