Commit fc055fc0 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d10: Use the global memory allocation helpers.

parent fa4d5b61
......@@ -222,8 +222,7 @@ HRESULT WINAPI D3D10CreateEffectFromMemory(void *data, SIZE_T data_size, UINT fl
FIXME("data %p, data_size %lu, flags %#x, device %p, effect_pool %p, effect %p stub!\n",
data, data_size, flags, device, effect_pool, effect);
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object)
if (!(object = heap_alloc_zero(sizeof(*object))))
{
ERR("Failed to allocate D3D10 effect object memory\n");
return E_OUTOFMEMORY;
......@@ -303,8 +302,7 @@ HRESULT WINAPI D3D10ReflectShader(const void *data, SIZE_T data_size, ID3D10Shad
FIXME("data %p, data_size %lu, reflector %p stub!\n", data, data_size, reflector);
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object)
if (!(object = heap_alloc_zero(sizeof(*object))))
{
ERR("Failed to allocate D3D10 shader reflection object memory\n");
return E_OUTOFMEMORY;
......
......@@ -21,6 +21,7 @@
#include "wine/debug.h"
#include "wine/rbtree.h"
#include "wine/heap.h"
#define COBJMACROS
#include "winbase.h"
......@@ -278,13 +279,6 @@ HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapte
HRESULT parse_dxbc(const char *data, SIZE_T data_size,
HRESULT (*chunk_handler)(const char *data, DWORD data_size, DWORD tag, void *ctx), void *ctx) DECLSPEC_HIDDEN;
static inline void *d3d10_calloc(SIZE_T count, SIZE_T size)
{
if (count > ~(SIZE_T)0 / size)
return NULL;
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, count * size);
}
static inline void read_dword(const char **ptr, DWORD *d)
{
memcpy(d, *ptr, sizeof(*d));
......
......@@ -68,9 +68,7 @@ static ULONG STDMETHODCALLTYPE d3d10_shader_reflection_Release(ID3D10ShaderRefle
TRACE("%p decreasing refcount to %u\n", This, refcount);
if (!refcount)
{
HeapFree(GetProcessHeap(), 0, This);
}
heap_free(This);
return refcount;
}
......
......@@ -275,7 +275,7 @@ static ULONG STDMETHODCALLTYPE d3d10_stateblock_Release(ID3D10StateBlock *iface)
{
stateblock_cleanup(stateblock);
ID3D10Device_Release(stateblock->device);
HeapFree(GetProcessHeap(), 0, stateblock);
heap_free(stateblock);
}
return refcount;
......@@ -522,8 +522,7 @@ HRESULT WINAPI D3D10CreateStateBlock(ID3D10Device *device,
TRACE("device %p, mask %p, stateblock %p.\n", device, mask, stateblock);
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object)
if (!(object = heap_alloc_zero(sizeof(*object))))
{
ERR("Failed to allocate D3D10 stateblock object memory.\n");
return E_OUTOFMEMORY;
......
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