gdiplus: Use helper function for HeapAlloc calls.

Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Sebastian Lackner 2015-10-21 00:53:12 +02:00 committed by Alexandre Julliard
parent 79c59085b1
commit ff1b209be8
3 changed files with 10 additions and 4 deletions

View File

@ -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;

View File

@ -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)
{

View File

@ -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;