From: Alex Henrie alexhenrie24@gmail.com
--- dlls/ddrawex/ddraw.c | 6 +++--- dlls/ddrawex/ddrawex_private.h | 2 -- dlls/ddrawex/main.c | 10 +++++----- dlls/ddrawex/surface.c | 4 ++-- 4 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/dlls/ddrawex/ddraw.c b/dlls/ddrawex/ddraw.c index 4affc43ff3e..a03683b6c2f 100644 --- a/dlls/ddrawex/ddraw.c +++ b/dlls/ddrawex/ddraw.c @@ -165,7 +165,7 @@ static ULONG WINAPI ddrawex4_Release(IDirectDraw4 *iface) if (!refcount) { IDirectDraw4_Release(ddrawex->parent); - heap_free(ddrawex); + free(ddrawex); }
return refcount; @@ -1425,7 +1425,7 @@ HRESULT WINAPI ddrawex_factory_CreateDirectDraw(IDirectDrawFactory *iface, GUID if (outer_unknown) FIXME("Implement aggregation in ddrawex's IDirectDraw interface.\n");
- if (!(object = heap_alloc_zero(sizeof(*object)))) + if (!(object = calloc(1, sizeof(*object)))) return E_OUTOFMEMORY;
object->ref = 1; @@ -1450,7 +1450,7 @@ err: IDirectDraw4_Release(object->parent); if (parent) IDirectDraw_Release(parent); - heap_free(object); + free(object); *ddraw = NULL; return hr; } diff --git a/dlls/ddrawex/ddrawex_private.h b/dlls/ddrawex/ddrawex_private.h index f60d3cb4e1b..9277ac354e4 100644 --- a/dlls/ddrawex/ddrawex_private.h +++ b/dlls/ddrawex/ddrawex_private.h @@ -19,8 +19,6 @@ #ifndef __WINE_DLLS_DDRAWEX_DDRAWEX_PRIVATE_H #define __WINE_DLLS_DDRAWEX_DDRAWEX_PRIVATE_H
-#include "wine/heap.h" - DEFINE_GUID(CLSID_DirectDrawFactory, 0x4fd2a832, 0x86c8, 0x11d0, 0x8f, 0xca, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d); DEFINE_GUID(IID_IDirectDrawFactory, 0x4fd2a833, 0x86c8, 0x11d0, 0x8f, 0xca, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d);
diff --git a/dlls/ddrawex/main.c b/dlls/ddrawex/main.c index fd6d7219c12..32449ad7cea 100644 --- a/dlls/ddrawex/main.c +++ b/dlls/ddrawex/main.c @@ -82,7 +82,7 @@ static ULONG WINAPI ddrawex_class_factory_Release(IClassFactory *iface) TRACE("%p decreasing refcount to %lu.\n", iface, refcount);
if (!refcount) - heap_free(factory); + free(factory);
return refcount; } @@ -161,7 +161,7 @@ static ULONG WINAPI ddrawex_factory_Release(IDirectDrawFactory *iface) TRACE("%p decreasing refcount to %lu.\n", iface, refcount);
if (!refcount) - heap_free(factory); + free(factory);
return refcount; } @@ -193,13 +193,13 @@ static HRESULT ddrawex_factory_create(IUnknown *outer_unknown, REFIID riid, void if (outer_unknown) return CLASS_E_NOAGGREGATION;
- if (!(factory = heap_alloc_zero(sizeof(*factory)))) + if (!(factory = calloc(1, sizeof(*factory)))) return E_OUTOFMEMORY;
factory->IDirectDrawFactory_iface.lpVtbl = &ddrawex_factory_vtbl;
if (FAILED(hr = ddrawex_factory_QueryInterface(&factory->IDirectDrawFactory_iface, riid, out))) - heap_free(factory); + free(factory);
return hr; } @@ -223,7 +223,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **out) return CLASS_E_CLASSNOTAVAILABLE; }
- if (!(factory = heap_alloc_zero(sizeof(*factory)))) + if (!(factory = calloc(1, sizeof(*factory)))) return E_OUTOFMEMORY;
factory->IClassFactory_iface.lpVtbl = &ddrawex_class_factory_vtbl; diff --git a/dlls/ddrawex/surface.c b/dlls/ddrawex/surface.c index cc18494905c..d5cc6ffab82 100644 --- a/dlls/ddrawex/surface.c +++ b/dlls/ddrawex/surface.c @@ -124,7 +124,7 @@ static ULONG WINAPI ddrawex_surface4_Release(IDirectDrawSurface4 *iface) { IDirectDrawSurface4_FreePrivateData(surface->parent, &IID_DDrawexPriv); IDirectDrawSurface4_Release(surface->parent); - heap_free(surface); + free(surface); }
return refcount; @@ -1208,7 +1208,7 @@ IDirectDrawSurface4 *dds_get_outer(IDirectDrawSurface4 *inner) struct ddrawex_surface *impl;
TRACE("Creating new ddrawex surface wrapper for surface %p\n", inner); - impl = heap_alloc_zero(sizeof(*impl)); + impl = calloc(1, sizeof(*impl)); impl->ref = 1; impl->IDirectDrawSurface3_iface.lpVtbl = &ddrawex_surface3_vtbl; impl->IDirectDrawSurface4_iface.lpVtbl = &ddrawex_surface4_vtbl;