Commit 14c38955 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

d3d8: Remove ERR() on HeapAlloc failure for small sizes known at compile time.

parent 1eff4669
......@@ -42,10 +42,7 @@ IDirect3D8 * WINAPI DECLSPEC_HOTPATCH Direct3DCreate8(UINT sdk_version)
TRACE("sdk_version %#x.\n", sdk_version);
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
{
ERR("Failed to allocate d3d8 object memory.\n");
return NULL;
}
if (!d3d8_init(object))
{
......
......@@ -723,10 +723,7 @@ static HRESULT WINAPI d3d8_device_CreateTexture(IDirect3DDevice8 *iface,
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object)
{
ERR("Failed to allocate texture memory.\n");
return D3DERR_OUTOFVIDEOMEMORY;
}
hr = texture_init(object, device, width, height, levels, usage, format, pool);
if (FAILED(hr))
......@@ -755,10 +752,7 @@ static HRESULT WINAPI d3d8_device_CreateVolumeTexture(IDirect3DDevice8 *iface,
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object)
{
ERR("Failed to allocate volume texture memory.\n");
return D3DERR_OUTOFVIDEOMEMORY;
}
hr = volumetexture_init(object, device, width, height, depth, levels, usage, format, pool);
if (FAILED(hr))
......@@ -786,10 +780,7 @@ static HRESULT WINAPI d3d8_device_CreateCubeTexture(IDirect3DDevice8 *iface, UIN
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object)
{
ERR("Failed to allocate cube texture memory.\n");
return D3DERR_OUTOFVIDEOMEMORY;
}
hr = cubetexture_init(object, device, edge_length, levels, usage, format, pool);
if (FAILED(hr))
......@@ -817,10 +808,7 @@ static HRESULT WINAPI d3d8_device_CreateVertexBuffer(IDirect3DDevice8 *iface, UI
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object)
{
ERR("Failed to allocate buffer memory.\n");
return D3DERR_OUTOFVIDEOMEMORY;
}
hr = vertexbuffer_init(object, device, size, usage, fvf, pool);
if (FAILED(hr))
......@@ -848,10 +836,7 @@ static HRESULT WINAPI d3d8_device_CreateIndexBuffer(IDirect3DDevice8 *iface, UIN
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object)
{
ERR("Failed to allocate buffer memory.\n");
return D3DERR_OUTOFVIDEOMEMORY;
}
hr = indexbuffer_init(object, device, size, usage, format, pool);
if (FAILED(hr))
......@@ -2150,7 +2135,6 @@ static HRESULT WINAPI d3d8_device_CreateVertexShader(IDirect3DDevice8 *iface,
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object)
{
ERR("Failed to allocate vertex shader memory.\n");
*shader = 0;
return E_OUTOFMEMORY;
}
......@@ -2216,10 +2200,7 @@ static struct d3d8_vertex_declaration *d3d8_device_get_fvf_declaration(struct d3
TRACE("not found. Creating and inserting at position %d.\n", low);
if (!(d3d8_declaration = HeapAlloc(GetProcessHeap(), 0, sizeof(*d3d8_declaration))))
{
ERR("Memory allocation failed.\n");
return NULL;
}
if (FAILED(hr = d3d8_vertex_declaration_init_fvf(d3d8_declaration, device, fvf)))
{
......@@ -2532,10 +2513,7 @@ static HRESULT WINAPI d3d8_device_CreatePixelShader(IDirect3DDevice8 *iface,
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object)
{
ERR("Failed to allocate pixel shader memmory.\n");
return E_OUTOFMEMORY;
}
wined3d_mutex_lock();
handle = d3d8_allocate_handle(&device->handle_table, object, D3D8_HANDLE_PS);
......
......@@ -364,10 +364,7 @@ static HRESULT WINAPI d3d8_CreateDevice(IDirect3D8 *iface, UINT adapter,
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object)
{
ERR("Failed to allocate device memory.\n");
return E_OUTOFMEMORY;
}
hr = device_init(object, d3d8, d3d8->wined3d, adapter, device_type, focus_window, flags, parameters);
if (FAILED(hr))
......
......@@ -61,10 +61,7 @@ static HRESULT d3d8_vertexshader_create_vertexdeclaration(struct d3d8_device *de
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object)
{
ERR("Memory allocation failed.\n");
return E_OUTOFMEMORY;
}
hr = d3d8_vertex_declaration_init(object, device, declaration, shader_handle);
if (FAILED(hr))
......
......@@ -183,10 +183,7 @@ HRESULT d3d8_swapchain_create(struct d3d8_device *device, struct wined3d_swapcha
HRESULT hr;
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
{
ERR("Failed to allocate swapchain memory.\n");
return E_OUTOFMEMORY;
}
if (FAILED(hr = swapchain_init(object, device, desc)))
{
......
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