packager: Implement IOleObject::Close.

This commit is contained in:
Andrew Eikum 2014-06-18 14:58:50 -05:00 committed by Alexandre Julliard
parent 7c6899ba7b
commit fae22c7c41
2 changed files with 24 additions and 2 deletions

View File

@ -142,8 +142,14 @@ static HRESULT WINAPI OleObject_SetHostNames(IOleObject *iface, LPCOLESTR szCont
static HRESULT WINAPI OleObject_Close(IOleObject *iface, DWORD dwSaveOption)
{
struct Package *This = impl_from_IOleObject(iface);
FIXME("(%p)->(0x%x)\n", This, dwSaveOption);
return E_NOTIMPL;
TRACE("(%p)->(0x%x)\n", This, dwSaveOption);
if(dwSaveOption == OLECLOSE_SAVEIFDIRTY ||
dwSaveOption == OLECLOSE_PROMPTSAVE)
WARN("Saving unsupported\n");
return S_OK;
}
static HRESULT WINAPI OleObject_SetMoniker(IOleObject *iface, DWORD dwWhichMoniker, IMoniker *pmk)

View File

@ -473,8 +473,24 @@ static void test_packager(void)
CloseHandle(file);
}
hr = IOleObject_Close(oleobj, OLECLOSE_NOSAVE);
ok(hr == S_OK, "Close failed: %08x\n", hr);
if(extended){
file = CreateFileW(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);
ok(file != INVALID_HANDLE_VALUE, "Temporary file shouldn't be deleted\n");
CloseHandle(file);
}
IPersistStorage_Release(persist);
IOleObject_Release(oleobj);
if(extended){
file = CreateFileW(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);
ok(file == INVALID_HANDLE_VALUE, "Temporary file should be deleted\n");
}
}
START_TEST(oleobj)