Commit 4c4eb112 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

uxtheme: Use CRT allocation functions.

parent 99476374
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include "uxtheme.h" #include "uxtheme.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(uxtheme); WINE_DEFAULT_DEBUG_CHANNEL(uxtheme);
...@@ -47,7 +46,7 @@ static void free_paintbuffer(struct paintbuffer *buffer) ...@@ -47,7 +46,7 @@ static void free_paintbuffer(struct paintbuffer *buffer)
{ {
DeleteObject(buffer->bitmap); DeleteObject(buffer->bitmap);
DeleteDC(buffer->memorydc); DeleteDC(buffer->memorydc);
heap_free(buffer); free(buffer);
} }
static struct paintbuffer *get_buffer_obj(HPAINTBUFFER handle) static struct paintbuffer *get_buffer_obj(HPAINTBUFFER handle)
...@@ -95,7 +94,7 @@ HPAINTBUFFER WINAPI BeginBufferedPaint(HDC targetdc, const RECT *rect, ...@@ -95,7 +94,7 @@ HPAINTBUFFER WINAPI BeginBufferedPaint(HDC targetdc, const RECT *rect,
if (params) if (params)
FIXME("painting parameters are ignored\n"); FIXME("painting parameters are ignored\n");
buffer = heap_alloc(sizeof(*buffer)); buffer = malloc(sizeof(*buffer));
buffer->targetdc = targetdc; buffer->targetdc = targetdc;
buffer->rect = *rect; buffer->rect = *rect;
buffer->memorydc = CreateCompatibleDC(targetdc); buffer->memorydc = CreateCompatibleDC(targetdc);
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "wine/exception.h" #include "wine/exception.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(uxtheme); WINE_DEFAULT_DEBUG_CHANNEL(uxtheme);
...@@ -162,7 +161,7 @@ HRESULT MSSTYLES_OpenThemeFile(LPCWSTR lpThemeFile, LPCWSTR pszColorName, LPCWST ...@@ -162,7 +161,7 @@ HRESULT MSSTYLES_OpenThemeFile(LPCWSTR lpThemeFile, LPCWSTR pszColorName, LPCWST
goto invalid_theme; goto invalid_theme;
} }
*tf = heap_alloc_zero(sizeof(THEME_FILE)); *tf = calloc(1, sizeof(THEME_FILE));
(*tf)->hTheme = hTheme; (*tf)->hTheme = hTheme;
GetFullPathNameW(lpThemeFile, MAX_PATH, (*tf)->szThemeFile, NULL); GetFullPathNameW(lpThemeFile, MAX_PATH, (*tf)->szThemeFile, NULL);
...@@ -204,14 +203,14 @@ void MSSTYLES_CloseThemeFile(PTHEME_FILE tf) ...@@ -204,14 +203,14 @@ void MSSTYLES_CloseThemeFile(PTHEME_FILE tf)
while(ps->properties) { while(ps->properties) {
PTHEME_PROPERTY prop = ps->properties; PTHEME_PROPERTY prop = ps->properties;
ps->properties = prop->next; ps->properties = prop->next;
heap_free(prop); free(prop);
} }
pcls->partstate = ps->next; pcls->partstate = ps->next;
heap_free(ps); free(ps);
} }
pcls->signature = 0; pcls->signature = 0;
heap_free(pcls); free(pcls);
} }
} }
while (tf->images) while (tf->images)
...@@ -219,9 +218,9 @@ void MSSTYLES_CloseThemeFile(PTHEME_FILE tf) ...@@ -219,9 +218,9 @@ void MSSTYLES_CloseThemeFile(PTHEME_FILE tf)
PTHEME_IMAGE img = tf->images; PTHEME_IMAGE img = tf->images;
tf->images = img->next; tf->images = img->next;
DeleteObject (img->image); DeleteObject (img->image);
heap_free(img); free(img);
} }
heap_free(tf); free(tf);
} }
} }
} }
...@@ -448,7 +447,7 @@ static PTHEME_CLASS MSSTYLES_AddClass(PTHEME_FILE tf, LPCWSTR pszAppName, LPCWST ...@@ -448,7 +447,7 @@ static PTHEME_CLASS MSSTYLES_AddClass(PTHEME_FILE tf, LPCWSTR pszAppName, LPCWST
PTHEME_CLASS cur = MSSTYLES_FindClass(tf, pszAppName, pszClassName); PTHEME_CLASS cur = MSSTYLES_FindClass(tf, pszAppName, pszClassName);
if(cur) return cur; if(cur) return cur;
cur = heap_alloc(sizeof(*cur)); cur = malloc(sizeof(*cur));
cur->signature = THEME_CLASS_SIGNATURE; cur->signature = THEME_CLASS_SIGNATURE;
cur->refcount = 0; cur->refcount = 0;
cur->hTheme = tf->hTheme; cur->hTheme = tf->hTheme;
...@@ -537,7 +536,7 @@ static PTHEME_PARTSTATE MSSTYLES_AddPartState(PTHEME_CLASS tc, int iPartId, int ...@@ -537,7 +536,7 @@ static PTHEME_PARTSTATE MSSTYLES_AddPartState(PTHEME_CLASS tc, int iPartId, int
PTHEME_PARTSTATE cur = MSSTYLES_FindPartState(tc, iPartId, iStateId, NULL); PTHEME_PARTSTATE cur = MSSTYLES_FindPartState(tc, iPartId, iStateId, NULL);
if(cur) return cur; if(cur) return cur;
cur = heap_alloc(sizeof(*cur)); cur = malloc(sizeof(*cur));
cur->iPartId = iPartId; cur->iPartId = iPartId;
cur->iStateId = iStateId; cur->iStateId = iStateId;
cur->properties = NULL; cur->properties = NULL;
...@@ -654,7 +653,7 @@ static PTHEME_PROPERTY MSSTYLES_AddProperty(PTHEME_PARTSTATE ps, int iPropertyPr ...@@ -654,7 +653,7 @@ static PTHEME_PROPERTY MSSTYLES_AddProperty(PTHEME_PARTSTATE ps, int iPropertyPr
/* Should duplicate properties overwrite the original, or be ignored? */ /* Should duplicate properties overwrite the original, or be ignored? */
if(cur) return cur; if(cur) return cur;
cur = heap_alloc(sizeof(*cur)); cur = malloc(sizeof(*cur));
cur->iPrimitiveType = iPropertyPrimitive; cur->iPrimitiveType = iPropertyPrimitive;
cur->iPropertyId = iPropertyId; cur->iPropertyId = iPropertyId;
cur->lpValue = lpValue; cur->lpValue = lpValue;
...@@ -695,7 +694,7 @@ static PTHEME_PROPERTY MSSTYLES_AddMetric(PTHEME_FILE tf, int iPropertyPrimitive ...@@ -695,7 +694,7 @@ static PTHEME_PROPERTY MSSTYLES_AddMetric(PTHEME_FILE tf, int iPropertyPrimitive
/* Should duplicate properties overwrite the original, or be ignored? */ /* Should duplicate properties overwrite the original, or be ignored? */
if(cur) return cur; if(cur) return cur;
cur = heap_alloc(sizeof(*cur)); cur = malloc(sizeof(*cur));
cur->iPrimitiveType = iPropertyPrimitive; cur->iPrimitiveType = iPropertyPrimitive;
cur->iPropertyId = iPropertyId; cur->iPropertyId = iPropertyId;
cur->lpValue = lpValue; cur->lpValue = lpValue;
...@@ -1246,7 +1245,7 @@ HBITMAP MSSTYLES_LoadBitmap (PTHEME_CLASS tc, LPCWSTR lpFilename, BOOL* hasAlpha ...@@ -1246,7 +1245,7 @@ HBITMAP MSSTYLES_LoadBitmap (PTHEME_CLASS tc, LPCWSTR lpFilename, BOOL* hasAlpha
img = img->next; img = img->next;
} }
/* Not found? Load from resources */ /* Not found? Load from resources */
img = heap_alloc(sizeof(*img)); img = malloc(sizeof(*img));
img->image = LoadImageW(tc->hTheme, szFile, IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION); img->image = LoadImageW(tc->hTheme, szFile, IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION);
prepare_alpha (img->image, hasAlpha); prepare_alpha (img->image, hasAlpha);
img->hasAlpha = *hasAlpha; img->hasAlpha = *hasAlpha;
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include "winnls.h" #include "winnls.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(uxtheme); WINE_DEFAULT_DEBUG_CHANNEL(uxtheme);
...@@ -70,7 +69,7 @@ PUXINI_FILE UXINI_LoadINI(HMODULE hTheme, LPCWSTR lpName) { ...@@ -70,7 +69,7 @@ PUXINI_FILE UXINI_LoadINI(HMODULE hTheme, LPCWSTR lpName) {
} }
dwIniSize = SizeofResource(hTheme, hrsc) / sizeof(WCHAR); dwIniSize = SizeofResource(hTheme, hrsc) / sizeof(WCHAR);
uf = heap_alloc(sizeof(*uf)); uf = malloc(sizeof(*uf));
uf->lpIni = lpThemesIni; uf->lpIni = lpThemesIni;
uf->lpCurLoc = lpThemesIni; uf->lpCurLoc = lpThemesIni;
uf->lpEnd = lpThemesIni + dwIniSize; uf->lpEnd = lpThemesIni + dwIniSize;
...@@ -87,7 +86,7 @@ PUXINI_FILE UXINI_LoadINI(HMODULE hTheme, LPCWSTR lpName) { ...@@ -87,7 +86,7 @@ PUXINI_FILE UXINI_LoadINI(HMODULE hTheme, LPCWSTR lpName) {
*/ */
void UXINI_CloseINI(PUXINI_FILE uf) void UXINI_CloseINI(PUXINI_FILE uf)
{ {
heap_free(uf); free(uf);
} }
/********************************************************************** /**********************************************************************
......
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