On 17.08.2016 11:28, Nikolay Sivov wrote:
On 17.08.2016 11:26, Sebastian Lackner wrote:
+static GpStatus load_wmf(IStream *stream, GpMetafile **metafile) +{
- WmfPlaceableFileHeader pfh;
- GpStatus status = GenericError;
- BOOL is_placeable = FALSE;
- LARGE_INTEGER seek;
- METAHEADER mh;
- HMETAFILE hmf;
- HRESULT hr;
- UINT size;
- void *buf;
- hr = IStream_Read(stream, &mh, sizeof(mh), &size);
- if (hr != S_OK || size != sizeof(mh))
return GenericError;
- if (mh.mtType == 0xcdd7 && mh.mtHeaderSize == 0x9ac6)
It'd be more readable to test this as UINT32 it's supposed to be, and having this constant defined to GDIP_WMF_PLACEABLEKEY (locally in gdiplus, it's only mentioned in comment in SDK) will help looking it up.
Probably yes, thanks. I'll wait if Vincent has any other feedback (for example if he's fine with the simplified error handling for IStream_Read) before sending a new version.
Regards, Sebastian