oleaut32: Implement GetSizeMax for empty picture.
This commit is contained in:
parent
beececd101
commit
8c5b08d81c
2 changed files with 52 additions and 8 deletions
|
@ -1836,12 +1836,59 @@ static HRESULT WINAPI OLEPictureImpl_Save(
|
|||
return hResult;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI OLEPictureImpl_GetSizeMax(
|
||||
IPersistStream* iface,ULARGE_INTEGER*pcbSize)
|
||||
static HRESULT WINAPI OLEPictureImpl_GetSizeMax(IPersistStream *iface, ULARGE_INTEGER *size)
|
||||
{
|
||||
OLEPictureImpl *This = impl_from_IPersistStream(iface);
|
||||
FIXME("(%p,%p),stub!\n",This,pcbSize);
|
||||
return E_NOTIMPL;
|
||||
HRESULT hr = E_NOTIMPL;
|
||||
OLEPictureImpl *This = impl_from_IPersistStream(iface);
|
||||
unsigned int datasize = This->datalen;
|
||||
|
||||
FIXME("(%p,%p), partial stub!\n", This, size);
|
||||
|
||||
if (!size)
|
||||
return E_INVALIDARG;
|
||||
|
||||
switch (This->desc.picType) {
|
||||
case PICTYPE_NONE:
|
||||
hr = S_OK;
|
||||
break;
|
||||
case PICTYPE_ICON:
|
||||
FIXME("(%p), PICTYPE_ICON not implemented!\n",This);
|
||||
break;
|
||||
case PICTYPE_BITMAP:
|
||||
if (This->bIsDirty || !This->data) {
|
||||
switch (This->keepOrigFormat ? This->loadtime_format : BITMAP_FORMAT_BMP) {
|
||||
case BITMAP_FORMAT_BMP:
|
||||
FIXME("(%p), PICTYPE_BITMAP (format BMP) not implemented!\n",This);
|
||||
break;
|
||||
case BITMAP_FORMAT_JPEG:
|
||||
FIXME("(%p), PICTYPE_BITMAP (format JPEG) not implemented!\n",This);
|
||||
break;
|
||||
case BITMAP_FORMAT_GIF:
|
||||
FIXME("(%p), PICTYPE_BITMAP (format GIF) not implemented!\n",This);
|
||||
break;
|
||||
case BITMAP_FORMAT_PNG:
|
||||
FIXME("(%p), PICTYPE_BITMAP (format PNG) not implemented!\n",This);
|
||||
break;
|
||||
default:
|
||||
FIXME("(%p), PICTYPE_BITMAP (format UNKNOWN, using BMP?) not implemented!\n",This);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PICTYPE_METAFILE:
|
||||
FIXME("(%p), PICTYPE_METAFILE not implemented!\n",This);
|
||||
break;
|
||||
case PICTYPE_ENHMETAFILE:
|
||||
FIXME("(%p), PICTYPE_ENHMETAFILE not implemented!\n",This);
|
||||
break;
|
||||
default:
|
||||
FIXME("(%p), [unknown type] not implemented!\n",This);
|
||||
break;
|
||||
}
|
||||
|
||||
size->HighPart = 0;
|
||||
size->LowPart = datasize + 8;
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1413,13 +1413,10 @@ static void test_load_save_empty_picture(void)
|
|||
|
||||
maxsize.QuadPart = 0;
|
||||
hr = IPersistStream_GetSizeMax(src_stream, &maxsize);
|
||||
todo_wine
|
||||
ok(hr == S_OK, "GetSizeMax error %#lx\n", hr);
|
||||
todo_wine
|
||||
ok(maxsize.QuadPart == 8, "expected 8, got %s\n", wine_dbgstr_longlong(maxsize.QuadPart));
|
||||
|
||||
hr = IPersistStream_GetSizeMax(src_stream, NULL);
|
||||
todo_wine
|
||||
ole_expect(hr, E_INVALIDARG);
|
||||
|
||||
hr = IPersistStream_Save(src_stream, dst_stream, TRUE);
|
||||
|
|
Loading…
Add table
Reference in a new issue