Commit 14158bb5 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

comdlg32/tests: Use CRT allocation functions.

parent 1967d7cd
......@@ -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;
}
......
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment