Qian Hong qhong@codeweavers.com wrote:
@@ -1365,10 +1365,12 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromFile(GDIPCONST WCHAR* filename, if(!filename || !bitmap) return InvalidParameter;
- *bitmap = NULL;
Is there an application that depends on this behaviour?
stat = GdipCreateStreamOnFile(filename, GENERIC_READ, &stream); if(stat != Ok)
return stat;
return InvalidParameter;
Probably GdipCreateStreamOnFile should be fixed instead (with tests of course).
stat = GdipCreateBitmapFromStream(stream, bitmap);
@@ -2923,10 +2925,12 @@ GpStatus WINGDIPAPI GdipLoadImageFromFile(GDIPCONST WCHAR* filename, if (!filename || !image) return InvalidParameter;
- *image = NULL;
Same question as above.
stat = GdipCreateStreamOnFile(filename, GENERIC_READ, &stream); if (stat != Ok)
return stat;
return OutOfMemory;
Same note about GdipCreateStreamOnFile. And I don't think that's a good idea to replicate weird return error codes without actually getting any memory allocation errors.