Commit ff1b209b authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

gdiplus: Use helper function for HeapAlloc calls.

parent 79c59085
......@@ -1612,7 +1612,7 @@ static INT CALLBACK add_font_proc(const LOGFONTW *lfw, const TEXTMETRICW *ntm,
if (fonts->allocated == fonts->count)
{
INT new_alloc_count = fonts->allocated+50;
GpFontFamily** new_family_list = HeapAlloc(GetProcessHeap(), 0, new_alloc_count*sizeof(void*));
GpFontFamily** new_family_list = heap_alloc(new_alloc_count*sizeof(void*));
if (!new_family_list)
return 0;
......
......@@ -48,6 +48,12 @@
#define GIF_DISPOSE_RESTORE_TO_BKGND 2
#define GIF_DISPOSE_RESTORE_TO_PREV 3
static void *heap_alloc(size_t len) __WINE_ALLOC_SIZE(1);
static inline void *heap_alloc(size_t len)
{
return HeapAlloc(GetProcessHeap(), 0, len);
}
static void *heap_alloc_zero(size_t len) __WINE_ALLOC_SIZE(1);
static inline void *heap_alloc_zero(size_t len)
{
......
......@@ -92,7 +92,7 @@ static ColorPalette *get_palette(IWICBitmapFrameDecode *frame, WICBitmapPaletteT
UINT count;
IWICPalette_GetColorCount(wic_palette, &count);
palette = HeapAlloc(GetProcessHeap(), 0, 2 * sizeof(UINT) + count * sizeof(ARGB));
palette = heap_alloc(2 * sizeof(UINT) + count * sizeof(ARGB));
IWICPalette_GetColors(wic_palette, count, palette->Entries, &palette->Count);
IWICPalette_GetType(wic_palette, &type);
......@@ -1692,7 +1692,7 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHICON(HICON hicon, GpBitmap** bitmap)
{
if (iinfo.hbmMask)
{
BYTE *bits = HeapAlloc(GetProcessHeap(), 0, height * stride);
BYTE *bits = heap_alloc(height * stride);
/* read alpha data from the mask */
if (iinfo.hbmColor)
......@@ -2874,7 +2874,7 @@ GpStatus WINGDIPAPI GdipGetAllPropertyItems(GpImage *image, UINT size,
item_size = propvariant_size(&value);
if (item_size)
{
item = HeapAlloc(GetProcessHeap(), 0, item_size + sizeof(*item));
item = heap_alloc(item_size + sizeof(*item));
propvariant_to_item(&value, item, item_size + sizeof(*item), id.u.uiVal);
buf[i].id = item->id;
......
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