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) ...@@ -57,14 +57,14 @@ static HDC get_printer_ic(void)
if (info_size == 0) if (info_size == 0)
return NULL; 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); ret = EnumPrintersA(PRINTER_ENUM_LOCAL, NULL, 2, (LPBYTE)info, info_size, &info_size, &num_printers);
if (ret) if (ret)
result = CreateICA(info->pDriverName, info->pPrinterName, NULL, NULL); result = CreateICA(info->pDriverName, info->pPrinterName, NULL, NULL);
HeapFree(GetProcessHeap(), 0, info); free(info);
return result; return result;
} }
......
...@@ -150,7 +150,7 @@ static ULONG WINAPI IFileDialogEvents_fnRelease(IFileDialogEvents *iface) ...@@ -150,7 +150,7 @@ static ULONG WINAPI IFileDialogEvents_fnRelease(IFileDialogEvents *iface)
LONG ref = InterlockedDecrement(&This->ref); LONG ref = InterlockedDecrement(&This->ref);
if(!ref) if(!ref)
HeapFree(GetProcessHeap(), 0, This); free(This);
return ref; return ref;
} }
...@@ -325,7 +325,7 @@ static IFileDialogEvents *IFileDialogEvents_Constructor(void) ...@@ -325,7 +325,7 @@ static IFileDialogEvents *IFileDialogEvents_Constructor(void)
{ {
IFileDialogEventsImpl *This; IFileDialogEventsImpl *This;
This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IFileDialogEventsImpl)); This = calloc(1, sizeof(IFileDialogEventsImpl));
This->IFileDialogEvents_iface.lpVtbl = &vt_IFileDialogEvents; This->IFileDialogEvents_iface.lpVtbl = &vt_IFileDialogEvents;
This->ref = 1; This->ref = 1;
......
...@@ -59,7 +59,7 @@ static void test_PageSetupDlgA(void) ...@@ -59,7 +59,7 @@ static void test_PageSetupDlgA(void)
LPPAGESETUPDLGA pDlg; LPPAGESETUPDLGA pDlg;
DWORD res; DWORD res;
pDlg = HeapAlloc(GetProcessHeap(), 0, (sizeof(PAGESETUPDLGA)) * 2); pDlg = malloc((sizeof(PAGESETUPDLGA)) * 2);
if (!pDlg) return; if (!pDlg) return;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
...@@ -97,7 +97,7 @@ static void test_PageSetupDlgA(void) ...@@ -97,7 +97,7 @@ static void test_PageSetupDlgA(void)
if (!res && (CommDlgExtendedError() == PDERR_NODEFAULTPRN)) { if (!res && (CommDlgExtendedError() == PDERR_NODEFAULTPRN)) {
skip("No printer configured.\n"); skip("No printer configured.\n");
HeapFree(GetProcessHeap(), 0, pDlg); free(pDlg);
return; return;
} }
...@@ -108,8 +108,7 @@ static void test_PageSetupDlgA(void) ...@@ -108,8 +108,7 @@ static void test_PageSetupDlgA(void)
GlobalFree(pDlg->hDevMode); GlobalFree(pDlg->hDevMode);
GlobalFree(pDlg->hDevNames); GlobalFree(pDlg->hDevNames);
HeapFree(GetProcessHeap(), 0, pDlg); free(pDlg);
} }
/* ########################### */ /* ########################### */
...@@ -138,7 +137,7 @@ static void test_PrintDlgA(void) ...@@ -138,7 +137,7 @@ static void test_PrintDlgA(void)
LPSTR ptr; LPSTR ptr;
DEVMODEA *dm; DEVMODEA *dm;
pDlg = HeapAlloc(GetProcessHeap(), 0, (sizeof(PRINTDLGA)) * 2); pDlg = malloc((sizeof(PRINTDLGA)) * 2);
if (!pDlg) return; if (!pDlg) return;
...@@ -178,7 +177,7 @@ static void test_PrintDlgA(void) ...@@ -178,7 +177,7 @@ static void test_PrintDlgA(void)
if (!res && (CommDlgExtendedError() == PDERR_NODEFAULTPRN)) { if (!res && (CommDlgExtendedError() == PDERR_NODEFAULTPRN)) {
skip("No printer configured.\n"); skip("No printer configured.\n");
HeapFree(GetProcessHeap(), 0, pDlg); free(pDlg);
return; return;
} }
...@@ -269,7 +268,7 @@ static void test_PrintDlgA(void) ...@@ -269,7 +268,7 @@ static void test_PrintDlgA(void)
GlobalFree(pDlg->hDevNames); GlobalFree(pDlg->hDevNames);
} }
HeapFree(GetProcessHeap(), 0, pDlg); free(pDlg);
} }
/* ########################### */ /* ########################### */
...@@ -390,7 +389,7 @@ static void test_PrintDlgExW(void) ...@@ -390,7 +389,7 @@ static void test_PrintDlgExW(void)
res, GetLastError(), CommDlgExtendedError() ); res, GetLastError(), CommDlgExtendedError() );
} }
pDlg = HeapAlloc(GetProcessHeap(), 0, (sizeof(PRINTDLGEXW)) + 8); pDlg = malloc(sizeof(PRINTDLGEXW) + 8);
if (!pDlg) return; if (!pDlg) return;
/* lStructSize must be exact */ /* lStructSize must be exact */
...@@ -471,7 +470,7 @@ static void test_PrintDlgExW(void) ...@@ -471,7 +470,7 @@ static void test_PrintDlgExW(void)
if (res == E_FAIL) if (res == E_FAIL)
{ {
skip("No printer configured.\n"); skip("No printer configured.\n");
HeapFree(GetProcessHeap(), 0, pDlg); free(pDlg);
return; return;
} }
...@@ -533,7 +532,7 @@ static void test_PrintDlgExW(void) ...@@ -533,7 +532,7 @@ static void test_PrintDlgExW(void)
if (!winetest_interactive) if (!winetest_interactive)
{ {
skip("interactive PrintDlgEx tests (set WINETEST_INTERACTIVE=1)\n"); skip("interactive PrintDlgEx tests (set WINETEST_INTERACTIVE=1)\n");
HeapFree(GetProcessHeap(), 0, pDlg); free(pDlg);
return; return;
} }
...@@ -552,7 +551,7 @@ static void test_PrintDlgExW(void) ...@@ -552,7 +551,7 @@ static void test_PrintDlgExW(void)
GlobalFree(pDlg->hDevNames); GlobalFree(pDlg->hDevNames);
DeleteDC(pDlg->hDC); DeleteDC(pDlg->hDC);
HeapFree(GetProcessHeap(), 0, pDlg); free(pDlg);
} }
static BOOL abort_proc_called = FALSE; 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