mirror of
https://github.com/reactos/wine.git
synced 2025-01-19 10:13:01 +00:00
d3d9: Remove ERR() on HeapAlloc failure for small sizes known at compile time.
This commit is contained in:
parent
14c3895573
commit
d86ecd4bb4
@ -40,10 +40,7 @@ IDirect3D9 * WINAPI DECLSPEC_HOTPATCH Direct3DCreate9(UINT sdk_version)
|
||||
TRACE("sdk_version %#x.\n", sdk_version);
|
||||
|
||||
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
|
||||
{
|
||||
ERR("Failed to allocate d3d9 object memory.\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!d3d9_init(object, FALSE))
|
||||
{
|
||||
@ -64,10 +61,7 @@ HRESULT WINAPI DECLSPEC_HOTPATCH Direct3DCreate9Ex(UINT sdk_version, IDirect3D9E
|
||||
TRACE("sdk_version %#x, d3d9ex %p.\n", sdk_version, d3d9ex);
|
||||
|
||||
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
|
||||
{
|
||||
ERR("Failed to allocate d3d9 object memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
if (!d3d9_init(object, TRUE))
|
||||
{
|
||||
|
@ -734,10 +734,7 @@ static HRESULT WINAPI d3d9_device_CreateTexture(IDirect3DDevice9Ex *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))
|
||||
@ -781,10 +778,7 @@ static HRESULT WINAPI d3d9_device_CreateVolumeTexture(IDirect3DDevice9Ex *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))
|
||||
@ -816,10 +810,7 @@ static HRESULT WINAPI d3d9_device_CreateCubeTexture(IDirect3DDevice9Ex *iface,
|
||||
|
||||
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))
|
||||
@ -851,10 +842,7 @@ static HRESULT WINAPI d3d9_device_CreateVertexBuffer(IDirect3DDevice9Ex *iface,
|
||||
|
||||
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))
|
||||
@ -886,10 +874,7 @@ static HRESULT WINAPI d3d9_device_CreateIndexBuffer(IDirect3DDevice9Ex *iface, U
|
||||
|
||||
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))
|
||||
@ -1559,10 +1544,7 @@ static HRESULT WINAPI d3d9_device_CreateStateBlock(IDirect3DDevice9Ex *iface,
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate stateblock memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = stateblock_init(object, device, type, NULL);
|
||||
if (FAILED(hr))
|
||||
@ -1613,7 +1595,6 @@ static HRESULT WINAPI d3d9_device_EndStateBlock(IDirect3DDevice9Ex *iface, IDire
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate stateblock memory.\n");
|
||||
wined3d_mutex_lock();
|
||||
wined3d_stateblock_decref(wined3d_stateblock);
|
||||
wined3d_mutex_unlock();
|
||||
@ -2413,10 +2394,7 @@ static HRESULT WINAPI d3d9_device_CreateVertexShader(IDirect3DDevice9Ex *iface,
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate vertex shader memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = vertexshader_init(object, device, byte_code);
|
||||
if (FAILED(hr))
|
||||
@ -2896,10 +2874,7 @@ static HRESULT WINAPI d3d9_device_CreateQuery(IDirect3DDevice9Ex *iface, D3DQUER
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate query memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = query_init(object, device, type);
|
||||
if (FAILED(hr))
|
||||
|
@ -456,10 +456,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_CreateDevice(IDirect3D9Ex *iface, U
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate device memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = device_init(object, d3d9, d3d9->wined3d, adapter, device_type, focus_window, flags, parameters, NULL);
|
||||
if (FAILED(hr))
|
||||
@ -567,10 +564,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_CreateDeviceEx(IDirect3D9Ex *iface,
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate device memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = device_init(object, d3d9, d3d9->wined3d, adapter, device_type, focus_window, flags, parameters, mode);
|
||||
if (FAILED(hr))
|
||||
|
@ -278,10 +278,7 @@ HRESULT d3d9_swapchain_create(struct d3d9_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)))
|
||||
{
|
||||
|
@ -419,10 +419,7 @@ HRESULT d3d9_vertex_declaration_create(struct d3d9_device *device,
|
||||
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
|
||||
if (!object)
|
||||
{
|
||||
ERR("Failed to allocate vertex declaration memory.\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = vertexdeclaration_init(object, device, elements);
|
||||
if (FAILED(hr))
|
||||
|
Loading…
x
Reference in New Issue
Block a user