d3dxof: Don't ERR on alloc failures for small compile time known sizes.
This commit is contained in:
parent
84a8ae79d2
commit
c954d50b16
dlls/d3dxof
|
@ -56,10 +56,7 @@ HRESULT IDirectXFileImpl_Create(IUnknown* pUnkOuter, LPVOID* ppObj)
|
||||||
|
|
||||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectXFileImpl));
|
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectXFileImpl));
|
||||||
if (!object)
|
if (!object)
|
||||||
{
|
|
||||||
ERR("Out of memory\n");
|
|
||||||
return DXFILEERR_BADALLOC;
|
return DXFILEERR_BADALLOC;
|
||||||
}
|
|
||||||
|
|
||||||
object->IDirectXFile_iface.lpVtbl = &IDirectXFile_Vtbl;
|
object->IDirectXFile_iface.lpVtbl = &IDirectXFile_Vtbl;
|
||||||
object->ref = 1;
|
object->ref = 1;
|
||||||
|
@ -373,10 +370,7 @@ static HRESULT IDirectXFileBinaryImpl_Create(IDirectXFileBinaryImpl** ppObj)
|
||||||
|
|
||||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectXFileBinaryImpl));
|
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectXFileBinaryImpl));
|
||||||
if (!object)
|
if (!object)
|
||||||
{
|
|
||||||
ERR("Out of memory\n");
|
|
||||||
return DXFILEERR_BADALLOC;
|
return DXFILEERR_BADALLOC;
|
||||||
}
|
|
||||||
|
|
||||||
object->IDirectXFileBinary_iface.lpVtbl = &IDirectXFileBinary_Vtbl;
|
object->IDirectXFileBinary_iface.lpVtbl = &IDirectXFileBinary_Vtbl;
|
||||||
object->ref = 1;
|
object->ref = 1;
|
||||||
|
@ -506,10 +500,7 @@ static HRESULT IDirectXFileDataImpl_Create(IDirectXFileDataImpl** ppObj)
|
||||||
|
|
||||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectXFileDataImpl));
|
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectXFileDataImpl));
|
||||||
if (!object)
|
if (!object)
|
||||||
{
|
|
||||||
ERR("Out of memory\n");
|
|
||||||
return DXFILEERR_BADALLOC;
|
return DXFILEERR_BADALLOC;
|
||||||
}
|
|
||||||
|
|
||||||
object->IDirectXFileData_iface.lpVtbl = &IDirectXFileData_Vtbl;
|
object->IDirectXFileData_iface.lpVtbl = &IDirectXFileData_Vtbl;
|
||||||
object->ref = 1;
|
object->ref = 1;
|
||||||
|
@ -784,10 +775,7 @@ static HRESULT IDirectXFileDataReferenceImpl_Create(IDirectXFileDataReferenceImp
|
||||||
|
|
||||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectXFileDataReferenceImpl));
|
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectXFileDataReferenceImpl));
|
||||||
if (!object)
|
if (!object)
|
||||||
{
|
|
||||||
ERR("Out of memory\n");
|
|
||||||
return DXFILEERR_BADALLOC;
|
return DXFILEERR_BADALLOC;
|
||||||
}
|
|
||||||
|
|
||||||
object->IDirectXFileDataReference_iface.lpVtbl = &IDirectXFileDataReference_Vtbl;
|
object->IDirectXFileDataReference_iface.lpVtbl = &IDirectXFileDataReference_Vtbl;
|
||||||
object->ref = 1;
|
object->ref = 1;
|
||||||
|
@ -935,10 +923,7 @@ static HRESULT IDirectXFileEnumObjectImpl_Create(IDirectXFileEnumObjectImpl** pp
|
||||||
|
|
||||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectXFileEnumObjectImpl));
|
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectXFileEnumObjectImpl));
|
||||||
if (!object)
|
if (!object)
|
||||||
{
|
|
||||||
ERR("Out of memory\n");
|
|
||||||
return DXFILEERR_BADALLOC;
|
return DXFILEERR_BADALLOC;
|
||||||
}
|
|
||||||
|
|
||||||
object->IDirectXFileEnumObject_iface.lpVtbl = &IDirectXFileEnumObject_Vtbl;
|
object->IDirectXFileEnumObject_iface.lpVtbl = &IDirectXFileEnumObject_Vtbl;
|
||||||
object->ref = 1;
|
object->ref = 1;
|
||||||
|
@ -1037,7 +1022,6 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileE
|
||||||
object->pobj = HeapAlloc(GetProcessHeap(), 0, sizeof(xobject)*MAX_SUBOBJECTS);
|
object->pobj = HeapAlloc(GetProcessHeap(), 0, sizeof(xobject)*MAX_SUBOBJECTS);
|
||||||
if (!object->pobj)
|
if (!object->pobj)
|
||||||
{
|
{
|
||||||
ERR("Out of memory\n");
|
|
||||||
hr = DXFILEERR_BADALLOC;
|
hr = DXFILEERR_BADALLOC;
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
@ -1045,7 +1029,6 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileE
|
||||||
object->pstrings = HeapAlloc(GetProcessHeap(), 0, MAX_STRINGS_BUFFER);
|
object->pstrings = HeapAlloc(GetProcessHeap(), 0, MAX_STRINGS_BUFFER);
|
||||||
if (!object->pstrings)
|
if (!object->pstrings)
|
||||||
{
|
{
|
||||||
ERR("Out of memory\n");
|
|
||||||
hr = DXFILEERR_BADALLOC;
|
hr = DXFILEERR_BADALLOC;
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
@ -1125,10 +1108,7 @@ static HRESULT IDirectXFileSaveObjectImpl_Create(IDirectXFileSaveObjectImpl** pp
|
||||||
|
|
||||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectXFileSaveObjectImpl));
|
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectXFileSaveObjectImpl));
|
||||||
if (!object)
|
if (!object)
|
||||||
{
|
|
||||||
ERR("Out of memory\n");
|
|
||||||
return DXFILEERR_BADALLOC;
|
return DXFILEERR_BADALLOC;
|
||||||
}
|
|
||||||
|
|
||||||
object->IDirectXFileSaveObject_iface.lpVtbl = &IDirectXFileSaveObject_Vtbl;
|
object->IDirectXFileSaveObject_iface.lpVtbl = &IDirectXFileSaveObject_Vtbl;
|
||||||
object->ref = 1;
|
object->ref = 1;
|
||||||
|
|
Loading…
Reference in New Issue