Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
June 2022
- 68 participants
- 3274 messages
[PATCH 2/9] d2d1: Partially implement RegisterEffectFromStream().
by Ziqing Hui
From: Ziqing Hui <zhui(a)codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/d2d1/Makefile.in | 2 +-
dlls/d2d1/factory.c | 191 ++++++++++++++++++++++++++++++++++++++++--
2 files changed, 187 insertions(+), 6 deletions(-)
diff --git a/dlls/d2d1/Makefile.in b/dlls/d2d1/Makefile.in
index 413571338ba..4c74839f39a 100644
--- a/dlls/d2d1/Makefile.in
+++ b/dlls/d2d1/Makefile.in
@@ -1,7 +1,7 @@
MODULE = d2d1.dll
IMPORTLIB = d2d1
IMPORTS = d3d10_1 dxguid uuid gdi32 user32 advapi32
-DELAYIMPORTS = dwrite
+DELAYIMPORTS = dwrite xmllite ole32
C_SRCS = \
bitmap.c \
diff --git a/dlls/d2d1/factory.c b/dlls/d2d1/factory.c
index 367f13da5e5..4a08a0cf76d 100644
--- a/dlls/d2d1/factory.c
+++ b/dlls/d2d1/factory.c
@@ -19,6 +19,9 @@
#define D2D1_INIT_GUID
#include "d2d1_private.h"
+#include "xmllite.h"
+#include "wine/list.h"
+
WINE_DECLARE_DEBUG_CHANNEL(winediag);
WINE_DEFAULT_DEBUG_CHANNEL(d2d);
@@ -27,6 +30,21 @@ struct d2d_settings d2d_settings =
~0u, /* No ID2D1Factory version limit by default. */
};
+struct d2d_effect_registration
+{
+ struct list entry;
+ PD2D1_EFFECT_FACTORY factory;
+ UINT32 registration_count;
+ CLSID id;
+
+ UINT32 input_count;
+};
+
+static void d2d_effect_registration_cleanup(struct d2d_effect_registration *reg)
+{
+ free(reg);
+}
+
struct d2d_factory
{
ID2D1Factory3 ID2D1Factory3_iface;
@@ -38,6 +56,8 @@ struct d2d_factory
float dpi_x;
float dpi_y;
+ struct list effects;
+
CRITICAL_SECTION cs;
};
@@ -112,6 +132,7 @@ static ULONG STDMETHODCALLTYPE d2d_factory_Release(ID2D1Factory3 *iface)
{
struct d2d_factory *factory = impl_from_ID2D1Factory3(iface);
ULONG refcount = InterlockedDecrement(&factory->refcount);
+ struct d2d_effect_registration *reg, *reg2;
TRACE("%p decreasing refcount to %lu.\n", iface, refcount);
@@ -119,6 +140,10 @@ static ULONG STDMETHODCALLTYPE d2d_factory_Release(ID2D1Factory3 *iface)
{
if (factory->device)
ID3D10Device1_Release(factory->device);
+ LIST_FOR_EACH_ENTRY_SAFE(reg, reg2, &factory->effects, struct d2d_effect_registration, entry)
+ {
+ d2d_effect_registration_cleanup(reg);
+ }
DeleteCriticalSection(&factory->cs);
free(factory);
}
@@ -564,24 +589,179 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateGdiMetafile(ID2D1Factory3 *if
return E_NOTIMPL;
}
+static HRESULT parse_effect_get_next_xml_node(IXmlReader *reader, XmlNodeType expected_type,
+ const WCHAR *expected_name, unsigned int *depth)
+{
+ const WCHAR *node_name;
+ XmlNodeType node_type;
+ HRESULT hr;
+
+ assert(expected_type != XmlNodeType_Whitespace);
+
+ while ((hr = IXmlReader_Read(reader, &node_type)) == S_OK)
+ {
+ if (node_type == XmlNodeType_Whitespace)
+ continue;
+
+ if (expected_type != XmlNodeType_None && node_type != expected_type)
+ return HRESULT_FROM_WIN32(ERROR_NOT_FOUND);
+
+ if (expected_name)
+ {
+ if (FAILED(hr = IXmlReader_GetLocalName(reader, &node_name, NULL)))
+ return hr;
+
+ if (wcscmp(node_name, expected_name))
+ return HRESULT_FROM_WIN32(ERROR_NOT_FOUND);
+ }
+
+ if (depth)
+ IXmlReader_GetDepth(reader, depth);
+ return S_OK;
+ }
+
+ return hr;
+}
+
+static HRESULT parse_effect_skip_element(IXmlReader *reader, unsigned int element_depth)
+{
+ XmlNodeType node_type;
+ unsigned int depth;
+ HRESULT hr;
+
+ if (IXmlReader_IsEmptyElement(reader)) return S_OK;
+
+ while ((hr = IXmlReader_Read(reader, &node_type)) == S_OK)
+ {
+ IXmlReader_GetDepth(reader, &depth);
+ if (node_type == XmlNodeType_EndElement && depth == element_depth + 1)
+ {
+ return S_OK;
+ }
+ }
+
+ return hr;
+}
+
+static HRESULT parse_effect_xml(IXmlReader *reader)
+{
+ const WCHAR *node_name;
+ XmlNodeType node_type;
+ unsigned int depth;
+ HRESULT hr;
+
+ /* Xml declaration node is mandatory. */
+ if ((hr = parse_effect_get_next_xml_node(reader, XmlNodeType_XmlDeclaration, L"xml", NULL)) != S_OK)
+ return hr;
+
+ /* Top level "Effect" element. */
+ if ((hr = parse_effect_get_next_xml_node(reader, XmlNodeType_Element, L"Effect", NULL)) != S_OK)
+ return hr;
+
+ /* Loop inside effect node */
+ while ((hr = parse_effect_get_next_xml_node(reader, XmlNodeType_None, NULL, &depth)) == S_OK)
+ {
+ if (FAILED(hr = IXmlReader_GetNodeType(reader, &node_type))) return hr;
+ if (node_type != XmlNodeType_Element && node_type != XmlNodeType_EndElement) continue;
+ if (FAILED(hr = IXmlReader_GetLocalName(reader, &node_name, NULL))) return hr;
+ if (node_type == XmlNodeType_EndElement) break;
+
+ if (!wcscmp(node_name, L"Property")
+ || !wcscmp(node_name, L"Inputs"))
+ {
+ hr = parse_effect_skip_element(reader, depth);
+ }
+ else
+ {
+ WARN("Unexpected element %s.\n", debugstr_w(node_name));
+ hr = parse_effect_skip_element(reader, depth);
+ }
+
+ if (FAILED(hr))
+ return hr;
+ }
+
+ return hr;
+}
+
static HRESULT STDMETHODCALLTYPE d2d_factory_RegisterEffectFromStream(ID2D1Factory3 *iface,
REFCLSID effect_id, IStream *property_xml, const D2D1_PROPERTY_BINDING *bindings,
UINT32 binding_count, PD2D1_EFFECT_FACTORY effect_factory)
{
- FIXME("iface %p, effect_id %s, property_xml %p, bindings %p, binding_count %u, effect_factory %p stub!\n",
+ struct d2d_factory *factory = impl_from_ID2D1Factory3(iface);
+ struct d2d_effect_registration *effect;
+ IXmlReader *reader;
+ HRESULT hr;
+
+ TRACE("iface %p, effect_id %s, property_xml %p, bindings %p, binding_count %u, effect_factory %p.\n",
iface, debugstr_guid(effect_id), property_xml, bindings, binding_count, effect_factory);
- return E_NOTIMPL;
+ LIST_FOR_EACH_ENTRY(effect, &factory->effects, struct d2d_effect_registration, entry)
+ {
+ if (IsEqualGUID(effect_id, &effect->id))
+ {
+ ++effect->registration_count;
+ return S_OK;
+ }
+ }
+
+ if (FAILED(hr = CreateXmlReader(&IID_IXmlReader, (void **)&reader, NULL)))
+ return hr;
+
+ if (FAILED(hr = IXmlReader_SetInput(reader, (IUnknown *)property_xml)))
+ {
+ IXmlReader_Release(reader);
+ return hr;
+ }
+
+ if (!(effect = calloc(1, sizeof(*effect))))
+ {
+ IXmlReader_Release(reader);
+ return E_OUTOFMEMORY;
+ }
+
+ hr = parse_effect_xml(reader);
+ IXmlReader_Release(reader);
+ if (FAILED(hr))
+ {
+ WARN("Failed to parse effect xml, hr %#lx.\n", hr);
+ d2d_effect_registration_cleanup(effect);
+ return hr;
+ }
+
+ effect->registration_count = 1;
+ effect->id = *effect_id;
+ effect->factory = effect_factory;
+ list_add_tail(&factory->effects, &effect->entry);
+
+ return S_OK;
}
static HRESULT STDMETHODCALLTYPE d2d_factory_RegisterEffectFromString(ID2D1Factory3 *iface,
REFCLSID effect_id, const WCHAR *property_xml, const D2D1_PROPERTY_BINDING *bindings,
UINT32 binding_count, PD2D1_EFFECT_FACTORY effect_factory)
{
- FIXME("iface %p, effect_id %s, property_xml %s, bindings %p, binding_count %u, effect_factory %p stub!\n",
- iface, debugstr_guid(effect_id), debugstr_w(property_xml), bindings, binding_count, effect_factory);
+ static const LARGE_INTEGER zero;
+ IStream *stream;
+ ULONG size;
+ HRESULT hr;
- return S_OK;
+ TRACE("iface %p, effect_id %s, property_xml %s, bindings %p, binding_count %u, effect_factory %p.\n",
+ iface, debugstr_guid(effect_id), debugstr_w(property_xml), bindings, binding_count, effect_factory);
+
+ if (FAILED(hr = CreateStreamOnHGlobal(NULL, TRUE, &stream)))
+ return hr;
+
+ size = sizeof(*property_xml) * (wcslen(property_xml) + 1);
+ if (SUCCEEDED(hr = IStream_Write(stream, property_xml, size, NULL)))
+ hr = IStream_Seek(stream, zero, SEEK_SET, NULL);
+
+ if (SUCCEEDED(hr))
+ hr = ID2D1Factory3_RegisterEffectFromStream(iface, effect_id, stream, bindings,
+ binding_count, effect_factory);
+
+ IStream_Release(stream);
+ return hr;
}
static HRESULT STDMETHODCALLTYPE d2d_factory_UnregisterEffect(ID2D1Factory3 *iface, REFCLSID effect_id)
@@ -742,6 +922,7 @@ static void d2d_factory_init(struct d2d_factory *factory, D2D1_FACTORY_TYPE fact
&d2d_factory_multithread_noop_vtbl : &d2d_factory_multithread_vtbl;
factory->refcount = 1;
d2d_factory_reload_sysmetrics(factory);
+ list_init(&factory->effects);
InitializeCriticalSection(&factory->cs);
}
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/278
June 19, 2022
[PATCH 1/9] d2d1: Use CRT memory allocation functions.
by Nikolay Sivov
From: Nikolay Sivov <nsivov(a)codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/d2d1/bitmap.c | 14 +++----
dlls/d2d1/bitmap_render_target.c | 2 +-
dlls/d2d1/brush.c | 26 ++++++------
dlls/d2d1/d2d1_private.h | 3 +-
dlls/d2d1/dc_render_target.c | 2 +-
dlls/d2d1/device.c | 28 ++++++-------
dlls/d2d1/effect.c | 12 +++---
dlls/d2d1/factory.c | 54 ++++++++++++-------------
dlls/d2d1/geometry.c | 68 ++++++++++++++++----------------
dlls/d2d1/hwnd_render_target.c | 2 +-
dlls/d2d1/layer.c | 4 +-
dlls/d2d1/mesh.c | 4 +-
dlls/d2d1/state_block.c | 2 +-
dlls/d2d1/stroke.c | 6 +--
dlls/d2d1/wic_render_target.c | 2 +-
15 files changed, 114 insertions(+), 115 deletions(-)
diff --git a/dlls/d2d1/bitmap.c b/dlls/d2d1/bitmap.c
index cebabbe4a61..1cba26f5ca4 100644
--- a/dlls/d2d1/bitmap.c
+++ b/dlls/d2d1/bitmap.c
@@ -93,7 +93,7 @@ static ULONG STDMETHODCALLTYPE d2d_bitmap_Release(ID2D1Bitmap1 *iface)
IDXGISurface_Release(bitmap->surface);
ID3D11Resource_Release(bitmap->resource);
ID2D1Factory_Release(bitmap->factory);
- heap_free(bitmap);
+ free(bitmap);
}
return refcount;
@@ -485,7 +485,7 @@ HRESULT d2d_bitmap_create(struct d2d_device_context *context, D2D1_SIZE_U size,
return hr;
}
- if ((*bitmap = heap_alloc_zero(sizeof(**bitmap))))
+ if ((*bitmap = calloc(1, sizeof(**bitmap))))
{
d2d_bitmap_init(*bitmap, context, (ID3D11Resource *)texture, size, desc);
TRACE("Created bitmap %p.\n", *bitmap);
@@ -562,7 +562,7 @@ HRESULT d2d_bitmap_create_shared(struct d2d_device_context *context, REFIID iid,
goto failed;
}
- if (!(*bitmap = heap_alloc_zero(sizeof(**bitmap))))
+ if (!(*bitmap = calloc(1, sizeof(**bitmap))))
{
hr = E_OUTOFMEMORY;
goto failed;
@@ -598,7 +598,7 @@ HRESULT d2d_bitmap_create_shared(struct d2d_device_context *context, REFIID iid,
return D2DERR_UNSUPPORTED_OPERATION;
}
- if (!(*bitmap = heap_alloc_zero(sizeof(**bitmap))))
+ if (!(*bitmap = calloc(1, sizeof(**bitmap))))
{
ID3D11Resource_Release(resource);
return E_OUTOFMEMORY;
@@ -735,7 +735,7 @@ HRESULT d2d_bitmap_create_from_wic_bitmap(struct d2d_device_context *context, IW
pitch = ((bpp * size.width) + 15) & ~15;
if (pitch / bpp < size.width)
return E_OUTOFMEMORY;
- if (!(data = heap_calloc(size.height, pitch)))
+ if (!(data = calloc(size.height, pitch)))
return E_OUTOFMEMORY;
data_size = size.height * pitch;
@@ -746,13 +746,13 @@ HRESULT d2d_bitmap_create_from_wic_bitmap(struct d2d_device_context *context, IW
if (FAILED(hr = IWICBitmapSource_CopyPixels(bitmap_source, &rect, pitch, data_size, data)))
{
WARN("Failed to copy bitmap pixels, hr %#lx.\n", hr);
- heap_free(data);
+ free(data);
return hr;
}
hr = d2d_bitmap_create(context, size, data, pitch, &bitmap_desc, bitmap);
- heap_free(data);
+ free(data);
return hr;
}
diff --git a/dlls/d2d1/bitmap_render_target.c b/dlls/d2d1/bitmap_render_target.c
index 833ee125bac..ce8b8965d39 100644
--- a/dlls/d2d1/bitmap_render_target.c
+++ b/dlls/d2d1/bitmap_render_target.c
@@ -68,7 +68,7 @@ static ULONG STDMETHODCALLTYPE d2d_bitmap_render_target_Release(ID2D1BitmapRende
IUnknown_Release(render_target->dxgi_inner);
if (render_target->bitmap)
ID2D1Bitmap_Release(render_target->bitmap);
- heap_free(render_target);
+ free(render_target);
}
return refcount;
diff --git a/dlls/d2d1/brush.c b/dlls/d2d1/brush.c
index 22116759b10..98aa889aa5f 100644
--- a/dlls/d2d1/brush.c
+++ b/dlls/d2d1/brush.c
@@ -64,10 +64,10 @@ static ULONG STDMETHODCALLTYPE d2d_gradient_Release(ID2D1GradientStopCollection
if (!refcount)
{
- heap_free(gradient->stops);
+ free(gradient->stops);
ID3D11ShaderResourceView_Release(gradient->view);
ID2D1Factory_Release(gradient->factory);
- heap_free(gradient);
+ free(gradient);
}
return refcount;
@@ -141,7 +141,7 @@ HRESULT d2d_gradient_create(ID2D1Factory *factory, ID3D11Device1 *device, const
HRESULT hr;
*out = NULL;
- if (!(data = heap_calloc(stop_count, 2 * sizeof(*data))))
+ if (!(data = calloc(stop_count, 2 * sizeof(*data))))
{
ERR("Failed to allocate data.\n");
return E_OUTOFMEMORY;
@@ -167,7 +167,7 @@ HRESULT d2d_gradient_create(ID2D1Factory *factory, ID3D11Device1 *device, const
buffer_data.SysMemSlicePitch = 0;
hr = ID3D11Device1_CreateBuffer(device, &buffer_desc, &buffer_data, &buffer);
- heap_free(data);
+ free(data);
if (FAILED(hr))
{
ERR("Failed to create buffer, hr %#lx.\n", hr);
@@ -187,7 +187,7 @@ HRESULT d2d_gradient_create(ID2D1Factory *factory, ID3D11Device1 *device, const
return hr;
}
- if (!(gradient = heap_alloc_zero(sizeof(*gradient))))
+ if (!(gradient = calloc(1, sizeof(*gradient))))
{
ID3D11ShaderResourceView_Release(view);
return E_OUTOFMEMORY;
@@ -204,10 +204,10 @@ HRESULT d2d_gradient_create(ID2D1Factory *factory, ID3D11Device1 *device, const
gradient->view = view;
gradient->stop_count = stop_count;
- if (!(gradient->stops = heap_calloc(stop_count, sizeof(*stops))))
+ if (!(gradient->stops = calloc(stop_count, sizeof(*stops))))
{
ID3D11ShaderResourceView_Release(view);
- heap_free(gradient);
+ free(gradient);
return E_OUTOFMEMORY;
}
memcpy(gradient->stops, stops, stop_count * sizeof(*stops));
@@ -236,7 +236,7 @@ static void d2d_gradient_bind(struct d2d_gradient *gradient, ID3D11Device1 *devi
static void d2d_brush_destroy(struct d2d_brush *brush)
{
ID2D1Factory_Release(brush->factory);
- heap_free(brush);
+ free(brush);
}
static void d2d_brush_init(struct d2d_brush *brush, ID2D1Factory *factory,
@@ -389,7 +389,7 @@ static const struct ID2D1SolidColorBrushVtbl d2d_solid_color_brush_vtbl =
HRESULT d2d_solid_color_brush_create(ID2D1Factory *factory, const D2D1_COLOR_F *color,
const D2D1_BRUSH_PROPERTIES *desc, struct d2d_brush **brush)
{
- if (!(*brush = heap_alloc_zero(sizeof(**brush))))
+ if (!(*brush = calloc(1, sizeof(**brush))))
return E_OUTOFMEMORY;
d2d_brush_init(*brush, factory, D2D_BRUSH_TYPE_SOLID, desc,
@@ -573,7 +573,7 @@ HRESULT d2d_linear_gradient_brush_create(ID2D1Factory *factory,
const D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES *gradient_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc,
ID2D1GradientStopCollection *gradient, struct d2d_brush **brush)
{
- if (!(*brush = heap_alloc_zero(sizeof(**brush))))
+ if (!(*brush = calloc(1, sizeof(**brush))))
return E_OUTOFMEMORY;
d2d_brush_init(*brush, factory, D2D_BRUSH_TYPE_LINEAR, brush_desc,
@@ -802,7 +802,7 @@ HRESULT d2d_radial_gradient_brush_create(ID2D1Factory *factory,
{
struct d2d_brush *b;
- if (!(b = heap_alloc_zero(sizeof(*b))))
+ if (!(b = calloc(1, sizeof(*b))))
return E_OUTOFMEMORY;
d2d_brush_init(b, factory, D2D_BRUSH_TYPE_RADIAL, brush_desc, (ID2D1BrushVtbl *)&d2d_radial_gradient_brush_vtbl);
@@ -1077,7 +1077,7 @@ HRESULT d2d_bitmap_brush_create(ID2D1Factory *factory, ID2D1Bitmap *bitmap,
const D2D1_BITMAP_BRUSH_PROPERTIES1 *bitmap_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc,
struct d2d_brush **brush)
{
- if (!(*brush = heap_alloc_zero(sizeof(**brush))))
+ if (!(*brush = calloc(1, sizeof(**brush))))
return E_OUTOFMEMORY;
d2d_brush_init(*brush, factory, D2D_BRUSH_TYPE_BITMAP,
@@ -1324,7 +1324,7 @@ HRESULT d2d_image_brush_create(ID2D1Factory *factory, ID2D1Image *image,
const D2D1_IMAGE_BRUSH_PROPERTIES *image_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc,
struct d2d_brush **brush)
{
- if (!(*brush = heap_alloc_zero(sizeof(**brush))))
+ if (!(*brush = calloc(1, sizeof(**brush))))
return E_OUTOFMEMORY;
d2d_brush_init(*brush, factory, D2D_BRUSH_TYPE_IMAGE,
diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h
index b1ae4128520..9be553c72d8 100644
--- a/dlls/d2d1/d2d1_private.h
+++ b/dlls/d2d1/d2d1_private.h
@@ -20,7 +20,6 @@
#define __WINE_D2D1_PRIVATE_H
#include "wine/debug.h"
-#include "wine/heap.h"
#include <assert.h>
#include <limits.h>
@@ -646,7 +645,7 @@ static inline BOOL d2d_array_reserve(void **elements, size_t *capacity, size_t c
if (new_capacity < count)
new_capacity = max_capacity;
- if (!(new_elements = heap_realloc(*elements, new_capacity * size)))
+ if (!(new_elements = realloc(*elements, new_capacity * size)))
return FALSE;
*elements = new_elements;
diff --git a/dlls/d2d1/dc_render_target.c b/dlls/d2d1/dc_render_target.c
index e7e0fa57ed7..01e1c348746 100644
--- a/dlls/d2d1/dc_render_target.c
+++ b/dlls/d2d1/dc_render_target.c
@@ -99,7 +99,7 @@ static ULONG STDMETHODCALLTYPE d2d_dc_render_target_Release(ID2D1DCRenderTarget
if (render_target->dxgi_surface)
IDXGISurface1_Release(render_target->dxgi_surface);
ID3D10Device1_Release(render_target->d3d_device);
- heap_free(render_target);
+ free(render_target);
}
return refcount;
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c
index 7b983a81f25..62eb98a94a1 100644
--- a/dlls/d2d1/device.c
+++ b/dlls/d2d1/device.c
@@ -81,7 +81,7 @@ static void d2d_size_set(D2D1_SIZE_U *dst, float width, float height)
static BOOL d2d_clip_stack_init(struct d2d_clip_stack *stack)
{
- if (!(stack->stack = heap_alloc(INITIAL_CLIP_STACK_SIZE * sizeof(*stack->stack))))
+ if (!(stack->stack = malloc(INITIAL_CLIP_STACK_SIZE * sizeof(*stack->stack))))
return FALSE;
stack->size = INITIAL_CLIP_STACK_SIZE;
@@ -92,7 +92,7 @@ static BOOL d2d_clip_stack_init(struct d2d_clip_stack *stack)
static void d2d_clip_stack_cleanup(struct d2d_clip_stack *stack)
{
- heap_free(stack->stack);
+ free(stack->stack);
}
static BOOL d2d_clip_stack_push(struct d2d_clip_stack *stack, const D2D1_RECT_F *rect)
@@ -294,7 +294,7 @@ static ULONG STDMETHODCALLTYPE d2d_device_context_inner_Release(IUnknown *iface)
ID3D11Device1_Release(context->d3d_device);
ID2D1Factory_Release(context->factory);
ID2D1Device_Release(context->device);
- heap_free(context);
+ free(context);
}
return refcount;
@@ -517,14 +517,14 @@ static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateCompatibleRenderTarget
TRACE("iface %p, size %p, pixel_size %p, format %p, options %#x, render_target %p.\n",
iface, size, pixel_size, format, options, rt);
- if (!(object = heap_alloc_zero(sizeof(*object))))
+ if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
if (FAILED(hr = d2d_bitmap_render_target_init(object, render_target, size, pixel_size,
format, options)))
{
WARN("Failed to initialise render target, hr %#lx.\n", hr);
- heap_free(object);
+ free(object);
return hr;
}
@@ -1345,7 +1345,7 @@ static void d2d_device_context_draw_glyph_run_bitmap(struct d2d_device_context *
if (texture_type == DWRITE_TEXTURE_CLEARTYPE_3x1)
bitmap_size.width *= 3;
- if (!(opacity_values = heap_calloc(bitmap_size.height, bitmap_size.width)))
+ if (!(opacity_values = calloc(bitmap_size.height, bitmap_size.width)))
{
ERR("Failed to allocate opacity values.\n");
goto done;
@@ -1408,7 +1408,7 @@ done:
ID2D1BitmapBrush_Release(opacity_brush);
if (opacity_bitmap)
ID2D1Bitmap_Release(opacity_bitmap);
- heap_free(opacity_values);
+ free(opacity_values);
IDWriteGlyphRunAnalysis_Release(analysis);
}
@@ -1951,7 +1951,7 @@ static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateEffect(ID2D1DeviceCont
FIXME("iface %p, effect_id %s, effect %p stub!\n", iface, debugstr_guid(effect_id), effect);
- if (!(effect_context = heap_alloc_zero(sizeof(*effect_context))))
+ if (!(effect_context = calloc(1, sizeof(*effect_context))))
return E_OUTOFMEMORY;
d2d_effect_context_init(effect_context, context);
@@ -4202,13 +4202,13 @@ HRESULT d2d_d3d_create_render_target(ID2D1Device *device, IDXGISurface *surface,
else if (bitmap_desc.dpiX <= 0.0f || bitmap_desc.dpiY <= 0.0f)
return E_INVALIDARG;
- if (!(object = heap_alloc_zero(sizeof(*object))))
+ if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
if (FAILED(hr = d2d_device_context_init(object, device, outer_unknown, ops)))
{
WARN("Failed to initialise render target, hr %#lx.\n", hr);
- heap_free(object);
+ free(object);
return hr;
}
@@ -4225,7 +4225,7 @@ HRESULT d2d_d3d_create_render_target(ID2D1Device *device, IDXGISurface *surface,
{
WARN("Failed to create target bitmap, hr %#lx.\n", hr);
IUnknown_Release(&object->IUnknown_iface);
- heap_free(object);
+ free(object);
return hr;
}
@@ -4281,7 +4281,7 @@ static ULONG WINAPI d2d_device_Release(ID2D1Device *iface)
{
IDXGIDevice_Release(device->dxgi_device);
ID2D1Factory1_Release(device->factory);
- heap_free(device);
+ free(device);
}
return refcount;
@@ -4308,13 +4308,13 @@ static HRESULT WINAPI d2d_device_CreateDeviceContext(ID2D1Device *iface, D2D1_DE
if (options)
FIXME("Options are ignored %#x.\n", options);
- if (!(object = heap_alloc_zero(sizeof(*object))))
+ if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
if (FAILED(hr = d2d_device_context_init(object, iface, NULL, NULL)))
{
WARN("Failed to initialise device context, hr %#lx.\n", hr);
- heap_free(object);
+ free(object);
return hr;
}
diff --git a/dlls/d2d1/effect.c b/dlls/d2d1/effect.c
index 095a7e42977..fb5e26273f6 100644
--- a/dlls/d2d1/effect.c
+++ b/dlls/d2d1/effect.c
@@ -41,7 +41,7 @@ static void d2d_effect_context_cleanup(struct d2d_effect_context *effect_context
for (i = 0; i < effect_context->shader_count; ++i)
IUnknown_Release(effect_context->shaders[i].shader);
- heap_free(effect_context->shaders);
+ free(effect_context->shaders);
ID2D1DeviceContext1_Release(&effect_context->device_context->ID2D1DeviceContext1_iface);
}
@@ -104,7 +104,7 @@ static ULONG STDMETHODCALLTYPE d2d_effect_context_Release(ID2D1EffectContext *if
if (!refcount)
{
d2d_effect_context_cleanup(effect_context);
- heap_free(effect_context);
+ free(effect_context);
}
return refcount;
@@ -128,13 +128,13 @@ static HRESULT STDMETHODCALLTYPE d2d_effect_context_CreateEffect(ID2D1EffectCont
TRACE("iface %p, clsid %s, effect %p.\n", iface, debugstr_guid(clsid), effect);
- if (!(object = heap_alloc_zero(sizeof(*object))))
+ if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
if (FAILED(hr = d2d_effect_init(object, effect_context, clsid)))
{
WARN("Failed to initialise effect, hr %#lx.\n", hr);
- heap_free(object);
+ free(object);
return hr;
}
@@ -379,7 +379,7 @@ static void d2d_effect_cleanup(struct d2d_effect *effect)
if (effect->inputs[i])
ID2D1Image_Release(effect->inputs[i]);
}
- heap_free(effect->inputs);
+ free(effect->inputs);
ID2D1EffectContext_Release(&effect->effect_context->ID2D1EffectContext_iface);
}
@@ -431,7 +431,7 @@ static ULONG STDMETHODCALLTYPE d2d_effect_Release(ID2D1Effect *iface)
if (!refcount)
{
d2d_effect_cleanup(effect);
- heap_free(effect);
+ free(effect);
}
return refcount;
diff --git a/dlls/d2d1/factory.c b/dlls/d2d1/factory.c
index 01dac8051c0..367f13da5e5 100644
--- a/dlls/d2d1/factory.c
+++ b/dlls/d2d1/factory.c
@@ -120,7 +120,7 @@ static ULONG STDMETHODCALLTYPE d2d_factory_Release(ID2D1Factory3 *iface)
if (factory->device)
ID3D10Device1_Release(factory->device);
DeleteCriticalSection(&factory->cs);
- heap_free(factory);
+ free(factory);
}
return refcount;
@@ -153,13 +153,13 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateRectangleGeometry(ID2D1Factor
TRACE("iface %p, rect %s, geometry %p.\n", iface, debug_d2d_rect_f(rect), geometry);
- if (!(object = heap_alloc_zero(sizeof(*object))))
+ if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
if (FAILED(hr = d2d_rectangle_geometry_init(object, (ID2D1Factory *)iface, rect)))
{
WARN("Failed to initialise rectangle geometry, hr %#lx.\n", hr);
- heap_free(object);
+ free(object);
return hr;
}
@@ -177,13 +177,13 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateRoundedRectangleGeometry(ID2D
TRACE("iface %p, rounded_rect %s, geometry %p.\n", iface, debug_d2d_rounded_rect(rounded_rect), geometry);
- if (!(object = heap_alloc_zero(sizeof(*object))))
+ if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
if (FAILED(hr = d2d_rounded_rectangle_geometry_init(object, (ID2D1Factory *)iface, rounded_rect)))
{
WARN("Failed to initialise rounded rectangle geometry, hr %#lx.\n", hr);
- heap_free(object);
+ free(object);
return hr;
}
@@ -201,13 +201,13 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateEllipseGeometry(ID2D1Factory3
TRACE("iface %p, ellipse %s, geometry %p.\n", iface, debug_d2d_ellipse(ellipse), geometry);
- if (!(object = heap_alloc_zero(sizeof(*object))))
+ if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
if (FAILED(hr = d2d_ellipse_geometry_init(object, (ID2D1Factory *)iface, ellipse)))
{
WARN("Failed to initialise ellipse geometry, hr %#lx.\n", hr);
- heap_free(object);
+ free(object);
return hr;
}
@@ -226,13 +226,13 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateGeometryGroup(ID2D1Factory3 *
TRACE("iface %p, fill_mode %#x, geometries %p, geometry_count %u, group %p.\n",
iface, fill_mode, geometries, geometry_count, group);
- if (!(object = heap_alloc_zero(sizeof(*object))))
+ if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
if (FAILED(hr = d2d_geometry_group_init(object, (ID2D1Factory *)iface, fill_mode, geometries, geometry_count)))
{
WARN("Failed to initialise geometry group, hr %#lx.\n", hr);
- heap_free(object);
+ free(object);
return hr;
}
@@ -251,7 +251,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateTransformedGeometry(ID2D1Fact
TRACE("iface %p, src_geometry %p, transform %p, transformed_geometry %p.\n",
iface, src_geometry, transform, transformed_geometry);
- if (!(object = heap_alloc_zero(sizeof(*object))))
+ if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
d2d_transformed_geometry_init(object, (ID2D1Factory *)iface, src_geometry, transform);
@@ -268,7 +268,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreatePathGeometry(ID2D1Factory3 *i
TRACE("iface %p, geometry %p.\n", iface, geometry);
- if (!(object = heap_alloc_zero(sizeof(*object))))
+ if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
d2d_path_geometry_init(object, (ID2D1Factory *)iface);
@@ -290,7 +290,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateStrokeStyle(ID2D1Factory3 *if
TRACE("iface %p, desc %p, dashes %p, dash_count %u, stroke_style %p.\n",
iface, desc, dashes, dash_count, stroke_style);
- if (!(object = heap_alloc_zero(sizeof(*object))))
+ if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
desc1.startCap = desc->startCap;
@@ -305,7 +305,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateStrokeStyle(ID2D1Factory3 *if
if (FAILED(hr = d2d_stroke_style_init(object, (ID2D1Factory *)iface, &desc1, dashes, dash_count)))
{
WARN("Failed to initialise stroke style, hr %#lx.\n", hr);
- heap_free(object);
+ free(object);
return hr;
}
@@ -325,7 +325,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDrawingStateBlock(ID2D1Factor
TRACE("iface %p, desc %p, text_rendering_params %p, state_block %p.\n",
iface, desc, text_rendering_params, state_block);
- if (!(object = heap_alloc_zero(sizeof(*object))))
+ if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
if (desc)
@@ -365,19 +365,19 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateWicBitmapRenderTarget(ID2D1Fa
TRACE("iface %p, target %p, desc %p, render_target %p.\n", iface, target, desc, render_target);
- if (!(object = heap_alloc_zero(sizeof(*object))))
+ if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
if (FAILED(hr = d2d_factory_get_device(factory, &device)))
{
- heap_free(object);
+ free(object);
return hr;
}
if (FAILED(hr = d2d_wic_render_target_init(object, (ID2D1Factory1 *)iface, device, target, desc)))
{
WARN("Failed to initialise render target, hr %#lx.\n", hr);
- heap_free(object);
+ free(object);
return hr;
}
@@ -401,13 +401,13 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateHwndRenderTarget(ID2D1Factory
if (FAILED(hr = d2d_factory_get_device(factory, &device)))
return hr;
- if (!(object = heap_alloc_zero(sizeof(*object))))
+ if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
if (FAILED(hr = d2d_hwnd_render_target_init(object, (ID2D1Factory1 *)iface, device, desc, hwnd_rt_desc)))
{
WARN("Failed to initialise render target, hr %#lx.\n", hr);
- heap_free(object);
+ free(object);
return hr;
}
@@ -458,13 +458,13 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDCRenderTarget(ID2D1Factory3
if (FAILED(hr = d2d_factory_get_device(factory, &device)))
return hr;
- if (!(object = heap_alloc_zero(sizeof(*object))))
+ if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
if (FAILED(hr = d2d_dc_render_target_init(object, (ID2D1Factory1 *)iface, device, desc)))
{
WARN("Failed to initialise render target, hr %#lx.\n", hr);
- heap_free(object);
+ free(object);
return hr;
}
@@ -481,7 +481,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDevice(ID2D1Factory3 *iface,
TRACE("iface %p, dxgi_device %p, device %p.\n", iface, dxgi_device, device);
- if (!(object = heap_alloc_zero(sizeof(*object))))
+ if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
d2d_device_init(object, (ID2D1Factory1 *)iface, dxgi_device);
@@ -502,14 +502,14 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateStrokeStyle1(ID2D1Factory3 *i
TRACE("iface %p, desc %p, dashes %p, dash_count %u, stroke_style %p.\n",
iface, desc, dashes, dash_count, stroke_style);
- if (!(object = heap_alloc_zero(sizeof(*object))))
+ if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
if (FAILED(hr = d2d_stroke_style_init(object, (ID2D1Factory *)iface,
desc, dashes, dash_count)))
{
WARN("Failed to initialise stroke style, hr %#lx.\n", hr);
- heap_free(object);
+ free(object);
return hr;
}
@@ -525,7 +525,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreatePathGeometry1(ID2D1Factory3 *
TRACE("iface %p, geometry %p.\n", iface, geometry);
- if (!(object = heap_alloc_zero(sizeof(*object))))
+ if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
d2d_path_geometry_init(object, (ID2D1Factory *)iface);
@@ -545,7 +545,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDrawingStateBlock1(ID2D1Facto
TRACE("iface %p, desc %p, text_rendering_params %p, state_block %p.\n",
iface, desc, text_rendering_params, state_block);
- if (!(object = heap_alloc_zero(sizeof(*object))))
+ if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
d2d_state_block_init(object, (ID2D1Factory *)iface, desc, text_rendering_params);
@@ -760,7 +760,7 @@ HRESULT WINAPI D2D1CreateFactory(D2D1_FACTORY_TYPE factory_type, REFIID iid,
return E_INVALIDARG;
}
- if (!(object = heap_alloc_zero(sizeof(*object))))
+ if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
d2d_factory_init(object, factory_type, factory_options);
diff --git a/dlls/d2d1/geometry.c b/dlls/d2d1/geometry.c
index e97bae0b54a..684ac5e240a 100644
--- a/dlls/d2d1/geometry.c
+++ b/dlls/d2d1/geometry.c
@@ -1679,7 +1679,7 @@ static BOOL d2d_cdt_generate_faces(const struct d2d_cdt *cdt, struct d2d_geometr
return TRUE;
fail:
- heap_free(geometry->fill.faces);
+ free(geometry->fill.faces);
geometry->fill.faces = NULL;
geometry->fill.faces_size = 0;
geometry->fill.face_count = 0;
@@ -2275,7 +2275,7 @@ static BOOL d2d_geometry_intersect_self(struct d2d_geometry *geometry)
ret = d2d_geometry_apply_intersections(geometry, &intersections);
done:
- heap_free(intersections.intersections);
+ free(intersections.intersections);
return ret;
}
@@ -2299,7 +2299,7 @@ static HRESULT d2d_path_geometry_triangulate(struct d2d_geometry *geometry)
return S_OK;
}
- if (!(vertices = heap_calloc(vertex_count, sizeof(*vertices))))
+ if (!(vertices = calloc(vertex_count, sizeof(*vertices))))
return E_OUTOFMEMORY;
for (i = 0, j = 0; i < geometry->u.path.figure_count; ++i)
@@ -2326,7 +2326,7 @@ static HRESULT d2d_path_geometry_triangulate(struct d2d_geometry *geometry)
if (vertex_count < 3)
{
WARN("Geometry has %lu vertices after eliminating duplicates.\n", (long)vertex_count);
- heap_free(vertices);
+ free(vertices);
return S_OK;
}
@@ -2342,14 +2342,14 @@ static HRESULT d2d_path_geometry_triangulate(struct d2d_geometry *geometry)
if (!d2d_cdt_generate_faces(&cdt, geometry))
goto fail;
- heap_free(cdt.edges);
+ free(cdt.edges);
return S_OK;
fail:
geometry->fill.vertices = NULL;
geometry->fill.vertex_count = 0;
- heap_free(vertices);
- heap_free(cdt.edges);
+ free(vertices);
+ free(cdt.edges);
return E_FAIL;
}
@@ -2702,16 +2702,16 @@ static BOOL d2d_geometry_fill_add_arc_triangle(struct d2d_geometry *geometry,
static void d2d_geometry_cleanup(struct d2d_geometry *geometry)
{
- heap_free(geometry->outline.arc_faces);
- heap_free(geometry->outline.arcs);
- heap_free(geometry->outline.bezier_faces);
- heap_free(geometry->outline.beziers);
- heap_free(geometry->outline.faces);
- heap_free(geometry->outline.vertices);
- heap_free(geometry->fill.arc_vertices);
- heap_free(geometry->fill.bezier_vertices);
- heap_free(geometry->fill.faces);
- heap_free(geometry->fill.vertices);
+ free(geometry->outline.arc_faces);
+ free(geometry->outline.arcs);
+ free(geometry->outline.bezier_faces);
+ free(geometry->outline.beziers);
+ free(geometry->outline.faces);
+ free(geometry->outline.vertices);
+ free(geometry->fill.arc_vertices);
+ free(geometry->fill.bezier_vertices);
+ free(geometry->fill.faces);
+ free(geometry->fill.vertices);
ID2D1Factory_Release(geometry->factory);
}
@@ -2950,11 +2950,11 @@ static void d2d_path_geometry_free_figures(struct d2d_geometry *geometry)
for (i = 0; i < geometry->u.path.figure_count; ++i)
{
- heap_free(geometry->u.path.figures[i].original_bezier_controls);
- heap_free(geometry->u.path.figures[i].bezier_controls);
- heap_free(geometry->u.path.figures[i].vertices);
+ free(geometry->u.path.figures[i].original_bezier_controls);
+ free(geometry->u.path.figures[i].bezier_controls);
+ free(geometry->u.path.figures[i].vertices);
}
- heap_free(geometry->u.path.figures);
+ free(geometry->u.path.figures);
geometry->u.path.figures = NULL;
geometry->u.path.figures_size = 0;
}
@@ -3160,7 +3160,7 @@ static HRESULT d2d_geometry_resolve_beziers(struct d2d_geometry *geometry)
geometry->fill.bezier_vertex_count += 3 * geometry->u.path.figures[i].bezier_control_count;
}
- if (!(geometry->fill.bezier_vertices = heap_calloc(geometry->fill.bezier_vertex_count,
+ if (!(geometry->fill.bezier_vertices = calloc(geometry->fill.bezier_vertex_count,
sizeof(*geometry->fill.bezier_vertices))))
{
ERR("Failed to allocate bezier vertices array.\n");
@@ -3230,7 +3230,7 @@ static HRESULT STDMETHODCALLTYPE d2d_geometry_sink_Close(ID2D1GeometrySink *ifac
done:
if (FAILED(hr))
{
- heap_free(geometry->fill.bezier_vertices);
+ free(geometry->fill.bezier_vertices);
geometry->fill.bezier_vertex_count = 0;
d2d_path_geometry_free_figures(geometry);
geometry->u.path.state = D2D_GEOMETRY_STATE_ERROR;
@@ -3401,7 +3401,7 @@ static ULONG STDMETHODCALLTYPE d2d_path_geometry_Release(ID2D1PathGeometry1 *ifa
{
d2d_path_geometry_free_figures(geometry);
d2d_geometry_cleanup(geometry);
- heap_free(geometry);
+ free(geometry);
}
return refcount;
@@ -4001,7 +4001,7 @@ static ULONG STDMETHODCALLTYPE d2d_ellipse_geometry_Release(ID2D1EllipseGeometry
if (!refcount)
{
d2d_geometry_cleanup(geometry);
- heap_free(geometry);
+ free(geometry);
}
return refcount;
@@ -4174,7 +4174,7 @@ HRESULT d2d_ellipse_geometry_init(struct d2d_geometry *geometry, ID2D1Factory *f
d2d_geometry_init(geometry, factory, &identity, (ID2D1GeometryVtbl *)&d2d_ellipse_geometry_vtbl);
geometry->u.ellipse.ellipse = *ellipse;
- if (!(geometry->fill.vertices = heap_alloc(4 * sizeof(*geometry->fill.vertices))))
+ if (!(geometry->fill.vertices = malloc(4 * sizeof(*geometry->fill.vertices))))
goto fail;
if (!d2d_array_reserve((void **)&geometry->fill.faces,
&geometry->fill.faces_size, 2, sizeof(*geometry->fill.faces)))
@@ -4273,7 +4273,7 @@ static ULONG STDMETHODCALLTYPE d2d_rectangle_geometry_Release(ID2D1RectangleGeom
if (!refcount)
{
d2d_geometry_cleanup(geometry);
- heap_free(geometry);
+ free(geometry);
}
return refcount;
@@ -4595,7 +4595,7 @@ HRESULT d2d_rectangle_geometry_init(struct d2d_geometry *geometry, ID2D1Factory
d2d_geometry_init(geometry, factory, &identity, (ID2D1GeometryVtbl *)&d2d_rectangle_geometry_vtbl);
geometry->u.rectangle.rect = *rect;
- if (!(geometry->fill.vertices = heap_alloc(4 * sizeof(*geometry->fill.vertices))))
+ if (!(geometry->fill.vertices = malloc(4 * sizeof(*geometry->fill.vertices))))
goto fail;
if (!d2d_array_reserve((void **)&geometry->fill.faces,
&geometry->fill.faces_size, 2, sizeof(*geometry->fill.faces)))
@@ -4689,7 +4689,7 @@ static ULONG STDMETHODCALLTYPE d2d_rounded_rectangle_geometry_Release(ID2D1Round
if (!refcount)
{
d2d_geometry_cleanup(geometry);
- heap_free(geometry);
+ free(geometry);
}
return refcount;
@@ -4867,7 +4867,7 @@ HRESULT d2d_rounded_rectangle_geometry_init(struct d2d_geometry *geometry,
d2d_geometry_init(geometry, factory, &identity, (ID2D1GeometryVtbl *)&d2d_rounded_rectangle_geometry_vtbl);
geometry->u.rounded_rectangle.rounded_rect = *rounded_rect;
- if (!(geometry->fill.vertices = heap_alloc(8 * sizeof(*geometry->fill.vertices))))
+ if (!(geometry->fill.vertices = malloc(8 * sizeof(*geometry->fill.vertices))))
goto fail;
if (!d2d_array_reserve((void **)&geometry->fill.faces,
&geometry->fill.faces_size, 6, sizeof(*geometry->fill.faces)))
@@ -4996,7 +4996,7 @@ static ULONG STDMETHODCALLTYPE d2d_transformed_geometry_Release(ID2D1Transformed
geometry->fill.vertices = NULL;
ID2D1Geometry_Release(geometry->u.transformed.src_geometry);
d2d_geometry_cleanup(geometry);
- heap_free(geometry);
+ free(geometry);
}
return refcount;
@@ -5271,9 +5271,9 @@ static ULONG STDMETHODCALLTYPE d2d_geometry_group_Release(ID2D1GeometryGroup *if
{
for (i = 0; i < geometry->u.group.geometry_count; ++i)
ID2D1Geometry_Release(geometry->u.group.src_geometries[i]);
- heap_free(geometry->u.group.src_geometries);
+ free(geometry->u.group.src_geometries);
d2d_geometry_cleanup(geometry);
- heap_free(geometry);
+ free(geometry);
}
return refcount;
@@ -5484,7 +5484,7 @@ HRESULT d2d_geometry_group_init(struct d2d_geometry *geometry, ID2D1Factory *fac
d2d_geometry_init(geometry, factory, &identity, (ID2D1GeometryVtbl *)&d2d_geometry_group_vtbl);
- if (!(geometry->u.group.src_geometries = heap_calloc(geometry_count, sizeof(*geometries))))
+ if (!(geometry->u.group.src_geometries = calloc(geometry_count, sizeof(*geometries))))
{
d2d_geometry_cleanup(geometry);
return E_OUTOFMEMORY;
diff --git a/dlls/d2d1/hwnd_render_target.c b/dlls/d2d1/hwnd_render_target.c
index 4ce220bf433..5338ca3383f 100644
--- a/dlls/d2d1/hwnd_render_target.c
+++ b/dlls/d2d1/hwnd_render_target.c
@@ -83,7 +83,7 @@ static ULONG STDMETHODCALLTYPE d2d_hwnd_render_target_Release(ID2D1HwndRenderTar
{
IUnknown_Release(render_target->dxgi_inner);
IDXGISwapChain_Release(render_target->swapchain);
- heap_free(render_target);
+ free(render_target);
}
return refcount;
diff --git a/dlls/d2d1/layer.c b/dlls/d2d1/layer.c
index a7d7877dbb8..eead61dc549 100644
--- a/dlls/d2d1/layer.c
+++ b/dlls/d2d1/layer.c
@@ -64,7 +64,7 @@ static ULONG STDMETHODCALLTYPE d2d_layer_Release(ID2D1Layer *iface)
if (!refcount)
{
ID2D1Factory_Release(layer->factory);
- heap_free(layer);
+ free(layer);
}
return refcount;
@@ -100,7 +100,7 @@ static const struct ID2D1LayerVtbl d2d_layer_vtbl =
HRESULT d2d_layer_create(ID2D1Factory *factory, const D2D1_SIZE_F *size, struct d2d_layer **layer)
{
- if (!(*layer = heap_alloc_zero(sizeof(**layer))))
+ if (!(*layer = calloc(1, sizeof(**layer))))
return E_OUTOFMEMORY;
(*layer)->ID2D1Layer_iface.lpVtbl = &d2d_layer_vtbl;
diff --git a/dlls/d2d1/mesh.c b/dlls/d2d1/mesh.c
index 4108399ad5b..cd6a5d13a89 100644
--- a/dlls/d2d1/mesh.c
+++ b/dlls/d2d1/mesh.c
@@ -64,7 +64,7 @@ static ULONG STDMETHODCALLTYPE d2d_mesh_Release(ID2D1Mesh *iface)
if (!refcount)
{
ID2D1Factory_Release(mesh->factory);
- heap_free(mesh);
+ free(mesh);
}
return refcount;
@@ -97,7 +97,7 @@ static const struct ID2D1MeshVtbl d2d_mesh_vtbl =
HRESULT d2d_mesh_create(ID2D1Factory *factory, struct d2d_mesh **mesh)
{
- if (!(*mesh = heap_alloc_zero(sizeof(**mesh))))
+ if (!(*mesh = calloc(1, sizeof(**mesh))))
return E_OUTOFMEMORY;
(*mesh)->ID2D1Mesh_iface.lpVtbl = &d2d_mesh_vtbl;
diff --git a/dlls/d2d1/state_block.c b/dlls/d2d1/state_block.c
index 114a3efd883..7415471ce3a 100644
--- a/dlls/d2d1/state_block.c
+++ b/dlls/d2d1/state_block.c
@@ -67,7 +67,7 @@ static ULONG STDMETHODCALLTYPE d2d_state_block_Release(ID2D1DrawingStateBlock1 *
if (state_block->text_rendering_params)
IDWriteRenderingParams_Release(state_block->text_rendering_params);
ID2D1Factory_Release(state_block->factory);
- heap_free(state_block);
+ free(state_block);
}
return refcount;
diff --git a/dlls/d2d1/stroke.c b/dlls/d2d1/stroke.c
index 30ce2bf5660..16fa1f60771 100644
--- a/dlls/d2d1/stroke.c
+++ b/dlls/d2d1/stroke.c
@@ -65,8 +65,8 @@ static ULONG STDMETHODCALLTYPE d2d_stroke_style_Release(ID2D1StrokeStyle1 *iface
{
ID2D1Factory_Release(style->factory);
if (style->desc.dashStyle == D2D1_DASH_STYLE_CUSTOM)
- heap_free(style->dashes);
- heap_free(style);
+ free(style->dashes);
+ free(style);
}
return refcount;
@@ -222,7 +222,7 @@ HRESULT d2d_stroke_style_init(struct d2d_stroke_style *style, ID2D1Factory *fact
if (!dashes || !dash_count)
return E_INVALIDARG;
- if (!(style->dashes = heap_calloc(dash_count, sizeof(*style->dashes))))
+ if (!(style->dashes = calloc(dash_count, sizeof(*style->dashes))))
return E_OUTOFMEMORY;
memcpy(style->dashes, dashes, dash_count * sizeof(*style->dashes));
style->dash_count = dash_count;
diff --git a/dlls/d2d1/wic_render_target.c b/dlls/d2d1/wic_render_target.c
index f750a58a647..f6e7b14ed3f 100644
--- a/dlls/d2d1/wic_render_target.c
+++ b/dlls/d2d1/wic_render_target.c
@@ -131,7 +131,7 @@ static ULONG STDMETHODCALLTYPE d2d_wic_render_target_Release(IUnknown *iface)
ID3D10Texture2D_Release(render_target->readback_texture);
IUnknown_Release(render_target->dxgi_inner);
IDXGISurface_Release(render_target->dxgi_surface);
- heap_free(render_target);
+ free(render_target);
}
return refcount;
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/278
June 19, 2022
[PATCH 0/9] MR278: d2d1: Partially implement effect registration parsing.
by Nikolay Sivov (@nsivov)
This slightly reworks xmllite integration comparing to earlier patches, and add a proper forward to CreateEffect().
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/278
June 19, 2022
Re: [PATCH v4 1/8] server: Actually set initial status in set_async_direct_result handler.
by Jinoh Kang
On 3/5/22 04:04, Jinoh Kang wrote:
> On 3/5/22 02:47, Zebediah Figura wrote:
>> Right, but I think it's possible to trigger this assert now. For a rather pathological case, consider a client which calls set_async_direct_result on an async which is currently being serviced by a device driver and has not yet reached get_next_device_request.
>
> For that to be possible, something has to terminate the async so that set_async_direct_result does not reject it.
> The easiest way to do so is to cancel it, or make it timeout somehow.
>
> In fact, I think we have discovered an _existing_ bug: the client can use set_async_direct_result to interfere with cancelled asyncs (device-backed or not).
>
> Further investigation revealed some other bugs, which is tangentially related:
>
> 1. An async may time out before the client calls set_async_direct_result to report back the status of initial I/O. In this case, the timeout is ignored.
> 2. There is a time window where alerted asyncs ignore IoCancel/IoCancelEx requests. If async_terminate( async, STATUS_ALERTED ) is called, the async will ignore any cancellation requests until the APC_ASYNC_IO routine returns.
> Note that this bug has existed *before* set_async_direct_result, and I think this one may need to be addressed first.
>
> So what I think we need here is a mechanism to tell alerted asyncs apart from irreversibly-terminated asyncs.
> This will solve all of the problems above:
>
> - It's no longer possible to call set_async_direct_result on a device async in the first place, since it will now reject irreversibly-terminated asyncs while still accepting alerted asyncs (which is not possible for device asyncs).
> - Timeout and cancellation works as expected: set_async_direct_result will treat timed out asyncs as irreversibly-terminated. (the client needs to be modified to handle this case explicitly, though.)
Would it still be worth working on this? I couldn't find the bug report for this, though.
--
Sincerely,
Jinoh Kang
June 19, 2022
Re: [PATCH 0/1] MR277: cmd: Handle lines with just spaces in bracket blocks.
by eric pouech (@epo)
while you're at it:
- you could perhaps properly handle EOF condition from WCMD_fgets in the (enclosing) loop
- testing two consecutive "blank" lines could be interesting too
see https://www.winehq.org/pipermail/wine-devel/2022-February/206613.html
A+
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/277#note_2323
June 19, 2022
[PATCH 1/1] cmd: Handle lines with just spaces in bracket blocks.
by Bernhard Übelacker
From: Bernhard Übelacker <bernhardu(a)mailbox.org>
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51599
Signed-off-by: Bernhard Übelacker <bernhardu(a)mailbox.org>
---
programs/cmd/tests/test_builtins.cmd | 4 ++++
programs/cmd/tests/test_builtins.cmd.exp | 1 +
programs/cmd/wcmdmain.c | 18 +++++++++++++++++-
3 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
index 3f410e55166..56ef2a5f726 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -1020,6 +1020,10 @@ if not exist %windir% (
) else (
echo windir does exist
)
+if 1 == 0 (
+ echo 1 == 0 should not be true
+ @space@@tab@
+) else echo block containing a line with just spaces seems to work
echo --- case sensitivity with and without /i option
if bar==BAR echo if does not default to case sensitivity
if not bar==BAR echo if seems to default to case sensitivity
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index 8b6e0914112..7ce684ae6fa 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -701,6 +701,7 @@ comparison operators surrounded by brackets seem to work
comparison operators surrounded by brackets seem to work
windir is defined
windir does exist
+block containing a line with just spaces seems to work
--- case sensitivity with and without /i option
if seems to default to case sensitivity
if /i seems to work
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index af54b209d83..1b2f07fdc47 100644
--- a/programs/cmd/wcmdmain.c
+++ b/programs/cmd/wcmdmain.c
@@ -1798,6 +1798,22 @@ static BOOL WCMD_IsEndQuote(const WCHAR *quote, int quoteIndex)
return FALSE;
}
+/***************************************************************************
+ * WCMD_isEmptyOrJustWhiteSpace
+ *
+ * Returns TRUE if str is empty or contains just whitespace characters,
+ * otherwise returns FALSE.
+ */
+static BOOL WCMD_isEmptyOrJustWhiteSpace(const WCHAR *str)
+{
+ while (*str != '\0') {
+ if (*str != ' ' && *str != '\t')
+ return FALSE;
+ str++;
+ }
+ return TRUE;
+}
+
/***************************************************************************
* WCMD_ReadAndParseLine
*
@@ -2319,7 +2335,7 @@ WCHAR *WCMD_ReadAndParseLine(const WCHAR *optionalcmd, CMD_LIST **output, HANDLE
} else break;
}
- } while (*extraData == 0x00);
+ } while (WCMD_isEmptyOrJustWhiteSpace(extraData));
curPos = extraSpace;
/* Skip preceding whitespace */
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/277
June 19, 2022
[PATCH 0/1] MR277: cmd: Handle lines with just spaces in bracket blocks.
by Bernhard Übelacker
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51599
This patch attempts to ignore lines with just spaces inside bracket blocks like it does already for completely empty lines.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/277
June 19, 2022
[PATCH v2 1/1] winedbg: Fix typos in manpage.
by Jinoh Kang
From: Jinoh Kang <jinoh.kang.kr(a)gmail.com>
Signed-off-by: Jinoh Kang <jinoh.kang.kr(a)gmail.com>
---
programs/winedbg/winedbg.man.in | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/programs/winedbg/winedbg.man.in b/programs/winedbg/winedbg.man.in
index 871b7ad6764..7eae4faa756 100644
--- a/programs/winedbg/winedbg.man.in
+++ b/programs/winedbg/winedbg.man.in
@@ -82,14 +82,14 @@ This will run \fBgdb\fR in its own xterm instead of using the current
Unix console for textual display.
.PP
In all modes, the rest of the command line, when passed, is used to
-identify which programs, if any, has to debugged:
+identify which program, if any, is to be debugged:
.IP \fIprogram_name\fR
This is the name of an executable to start for a debugging
session. \fBwinedbg\fR will actually create a process with this
-executable. If \fIprograms_arguments\fR are also given, they will be
+executable. If \fIprogram_arguments\fR are also given, they will be
used as arguments for creating the process to be debugged.
.IP \fIwpid\fR
-\fBwinedbg\fR will attach to the process which Windows pid is \fIwpid\fR.
+\fBwinedbg\fR will attach to the process whose Windows pid is \fIwpid\fR.
Use the \fBinfo proc\fR command within \fBwinedbg\fR to list running processes
and their Windows pids.
.IP \fBdefault\fR
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/274
June 19, 2022
[PATCH v2 0/1] MR274: winedbg: Fix typos in manpage.
by Jinoh Kang (@iamahuman)
Signed-off-by: Jinoh Kang <jinoh.kang.kr(a)gmail.com>
--
v2: winedbg: Fix typos in manpage.
https://gitlab.winehq.org/wine/wine/-/merge_requests/274
June 19, 2022
Re: [PATCH v3 1/6] comctl32/tests: Expand ownerdata listview tests.
by Zhiyi Zhang
On 6/19/22 01:24, Angelo Haller wrote:
> On 17/06/2022 22.37, Marvin wrote:
>> Hi,
>>
>> It looks like your patch introduced the new failures shown below.
>> Please investigate and fix them before resubmitting your patch.
>> If they are not new, fixing them anyway would help a lot. Otherwise
>> please ask for the known failures list to be updated.
>>
>> The full results can be found at:
>> https://testbot.winehq.org/JobDetails.pl?Key=117220
>>
>> Your paranoid android.
>>
>>
>> === debian11 (32 bit report) ===
>>
>> Report validation errors:
>> comctl32:listview prints too much data (37148 bytes)
>>
>> === debian11 (32 bit Arabic:Morocco report) ===
>>
>> Report validation errors:
>> comctl32:listview prints too much data (37148 bytes)
>>
>> === debian11 (32 bit German report) ===
>>
>> Report validation errors:
>> comctl32:listview prints too much data (37148 bytes)
>>
>> === debian11 (32 bit French report) ===
>>
>> Report validation errors:
>> comctl32:listview prints too much data (37148 bytes)
>>
>> === debian11 (32 bit Hebrew:Israel report) ===
>>
>> Report validation errors:
>> comctl32:listview prints too much data (37148 bytes)
>>
>> === debian11 (32 bit Hindi:India report) ===
>>
>> Report validation errors:
>> comctl32:listview prints too much data (37148 bytes)
>>
>> === debian11 (32 bit Japanese:Japan report) ===
>>
>> Report validation errors:
>> comctl32:listview prints too much data (37148 bytes)
>>
>> === debian11 (32 bit Chinese:China report) ===
>>
>> Report validation errors:
>> comctl32:listview prints too much data (37148 bytes)
>>
>> === debian11 (32 bit WoW report) ===
>>
>> Report validation errors:
>> comctl32:listview prints too much data (37148 bytes)
>>
>> === debian11 (64 bit WoW report) ===
>>
>> Report validation errors:
>> comctl32:listview prints too much data (37388 bytes)
>
> Is there anything I can or need to do about this? These seem like false positives.
>
>
Currently TestBots have a 32k log size limit. Try to reduce the log messages a bit. You can submit your tests at https://testbot.winehq.org/ before submitting to the wine-devel mailing list
June 19, 2022