Module: wine Branch: master Commit: 4c4eb1129c489f89dc48106d5a25f198fda46ffc URL: https://gitlab.winehq.org/wine/wine/-/commit/4c4eb1129c489f89dc48106d5a25f19...
Author: Alex Henrie alexhenrie24@gmail.com Date: Mon Nov 27 22:40:21 2023 -0700
uxtheme: Use CRT allocation functions.
---
dlls/uxtheme/buffer.c | 5 ++--- dlls/uxtheme/msstyles.c | 23 +++++++++++------------ dlls/uxtheme/uxini.c | 5 ++--- 3 files changed, 15 insertions(+), 18 deletions(-)
diff --git a/dlls/uxtheme/buffer.c b/dlls/uxtheme/buffer.c index f159d5c1be0..7003d3da3bc 100644 --- a/dlls/uxtheme/buffer.c +++ b/dlls/uxtheme/buffer.c @@ -30,7 +30,6 @@ #include "uxtheme.h"
#include "wine/debug.h" -#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(uxtheme);
@@ -47,7 +46,7 @@ static void free_paintbuffer(struct paintbuffer *buffer) { DeleteObject(buffer->bitmap); DeleteDC(buffer->memorydc); - heap_free(buffer); + free(buffer); }
static struct paintbuffer *get_buffer_obj(HPAINTBUFFER handle) @@ -95,7 +94,7 @@ HPAINTBUFFER WINAPI BeginBufferedPaint(HDC targetdc, const RECT *rect, if (params) FIXME("painting parameters are ignored\n");
- buffer = heap_alloc(sizeof(*buffer)); + buffer = malloc(sizeof(*buffer)); buffer->targetdc = targetdc; buffer->rect = *rect; buffer->memorydc = CreateCompatibleDC(targetdc); diff --git a/dlls/uxtheme/msstyles.c b/dlls/uxtheme/msstyles.c index 76d2f760b58..71603953ed2 100644 --- a/dlls/uxtheme/msstyles.c +++ b/dlls/uxtheme/msstyles.c @@ -34,7 +34,6 @@
#include "wine/exception.h" #include "wine/debug.h" -#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(uxtheme);
@@ -162,7 +161,7 @@ HRESULT MSSTYLES_OpenThemeFile(LPCWSTR lpThemeFile, LPCWSTR pszColorName, LPCWST goto invalid_theme; }
- *tf = heap_alloc_zero(sizeof(THEME_FILE)); + *tf = calloc(1, sizeof(THEME_FILE)); (*tf)->hTheme = hTheme;
GetFullPathNameW(lpThemeFile, MAX_PATH, (*tf)->szThemeFile, NULL); @@ -204,14 +203,14 @@ void MSSTYLES_CloseThemeFile(PTHEME_FILE tf) while(ps->properties) { PTHEME_PROPERTY prop = ps->properties; ps->properties = prop->next; - heap_free(prop); + free(prop); }
pcls->partstate = ps->next; - heap_free(ps); + free(ps); } pcls->signature = 0; - heap_free(pcls); + free(pcls); } } while (tf->images) @@ -219,9 +218,9 @@ void MSSTYLES_CloseThemeFile(PTHEME_FILE tf) PTHEME_IMAGE img = tf->images; tf->images = img->next; 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 PTHEME_CLASS cur = MSSTYLES_FindClass(tf, pszAppName, pszClassName); if(cur) return cur;
- cur = heap_alloc(sizeof(*cur)); + cur = malloc(sizeof(*cur)); cur->signature = THEME_CLASS_SIGNATURE; cur->refcount = 0; cur->hTheme = tf->hTheme; @@ -537,7 +536,7 @@ static PTHEME_PARTSTATE MSSTYLES_AddPartState(PTHEME_CLASS tc, int iPartId, int PTHEME_PARTSTATE cur = MSSTYLES_FindPartState(tc, iPartId, iStateId, NULL); if(cur) return cur;
- cur = heap_alloc(sizeof(*cur)); + cur = malloc(sizeof(*cur)); cur->iPartId = iPartId; cur->iStateId = iStateId; cur->properties = NULL; @@ -654,7 +653,7 @@ static PTHEME_PROPERTY MSSTYLES_AddProperty(PTHEME_PARTSTATE ps, int iPropertyPr /* Should duplicate properties overwrite the original, or be ignored? */ if(cur) return cur;
- cur = heap_alloc(sizeof(*cur)); + cur = malloc(sizeof(*cur)); cur->iPrimitiveType = iPropertyPrimitive; cur->iPropertyId = iPropertyId; cur->lpValue = lpValue; @@ -695,7 +694,7 @@ static PTHEME_PROPERTY MSSTYLES_AddMetric(PTHEME_FILE tf, int iPropertyPrimitive /* Should duplicate properties overwrite the original, or be ignored? */ if(cur) return cur;
- cur = heap_alloc(sizeof(*cur)); + cur = malloc(sizeof(*cur)); cur->iPrimitiveType = iPropertyPrimitive; cur->iPropertyId = iPropertyId; cur->lpValue = lpValue; @@ -1246,7 +1245,7 @@ HBITMAP MSSTYLES_LoadBitmap (PTHEME_CLASS tc, LPCWSTR lpFilename, BOOL* hasAlpha img = img->next; } /* 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); prepare_alpha (img->image, hasAlpha); img->hasAlpha = *hasAlpha; diff --git a/dlls/uxtheme/uxini.c b/dlls/uxtheme/uxini.c index 41a0551f82b..a5bd3d65467 100644 --- a/dlls/uxtheme/uxini.c +++ b/dlls/uxtheme/uxini.c @@ -25,7 +25,6 @@ #include "winnls.h"
#include "wine/debug.h" -#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(uxtheme);
@@ -70,7 +69,7 @@ PUXINI_FILE UXINI_LoadINI(HMODULE hTheme, LPCWSTR lpName) { }
dwIniSize = SizeofResource(hTheme, hrsc) / sizeof(WCHAR); - uf = heap_alloc(sizeof(*uf)); + uf = malloc(sizeof(*uf)); uf->lpIni = lpThemesIni; uf->lpCurLoc = lpThemesIni; uf->lpEnd = lpThemesIni + dwIniSize; @@ -87,7 +86,7 @@ PUXINI_FILE UXINI_LoadINI(HMODULE hTheme, LPCWSTR lpName) { */ void UXINI_CloseINI(PUXINI_FILE uf) { - heap_free(uf); + free(uf); }
/**********************************************************************