Module: wine Branch: master Commit: 97e2c24cc7e065f67aae099941a47a541380a35f URL: http://source.winehq.org/git/wine.git/?a=commit;h=97e2c24cc7e065f67aae099941...
Author: Dmitry Timoshkov dmitry@baikal.ru Date: Mon Nov 26 19:54:23 2012 +0800
oleaut32: Add support for saving an empty picture.
---
dlls/oleaut32/olepicture.c | 6 ++++++ dlls/oleaut32/tests/olepicture.c | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c index db3b852..3fdb1c7 100644 --- a/dlls/oleaut32/olepicture.c +++ b/dlls/oleaut32/olepicture.c @@ -1757,6 +1757,12 @@ static HRESULT WINAPI OLEPictureImpl_Save( TRACE("%p %p %d\n", This, pStm, fClearDirty);
switch (This->desc.picType) { + case PICTYPE_NONE: + header[0] = 0x0000746c; + header[1] = 0; + hResult = IStream_Write(pStm, header, 2 * sizeof(DWORD), &dummy); + break; + case PICTYPE_ICON: if (This->bIsDirty || !This->data) { if (!serializeIcon(This->desc.u.icon.hicon, &pIconData, &iDataSize)) { diff --git a/dlls/oleaut32/tests/olepicture.c b/dlls/oleaut32/tests/olepicture.c index ee97fe2..db10baa 100644 --- a/dlls/oleaut32/tests/olepicture.c +++ b/dlls/oleaut32/tests/olepicture.c @@ -1095,11 +1095,9 @@ static void test_load_save_empty_picture(void) ok(hr == S_OK, "QueryInterface error %#x\n", hr);
hr = IPersistStream_Save(src_stream, dst_stream, TRUE); -todo_wine ok(hr == S_OK, "Save error %#x\n", hr);
mem = GlobalLock(hmem); -todo_wine ok(!memcmp(mem, "lt\0\0", 4), "got wrong stream header %04x\n", mem[0]); ok(mem[1] == 0, "expected stream size 0, got %u\n", mem[1]); GlobalUnlock(hmem);