Module: wine Branch: master Commit: b0f4ed187b6e741d5762cd46f858c647d5f286d6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=b0f4ed187b6e741d5762cd46f8...
Author: Jacek Caban jacek@codeweavers.com Date: Mon Feb 24 13:03:12 2014 +0100
wmp: Return success in IPersistStreamInit::InitNew.
---
dlls/wmp/oleobj.c | 11 +++++++++-- dlls/wmp/tests/oleobj.c | 8 ++++++++ 2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/dlls/wmp/oleobj.c b/dlls/wmp/oleobj.c index 1e50a45..29f39d7 100644 --- a/dlls/wmp/oleobj.c +++ b/dlls/wmp/oleobj.c @@ -744,8 +744,15 @@ static HRESULT WINAPI PersistStreamInit_GetSizeMax(IPersistStreamInit *iface, static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface) { WindowsMediaPlayer *This = impl_from_IPersistStreamInit(iface); - FIXME("(%p)\n", This); - return E_NOTIMPL; + + TRACE("(%p)\n", This); + + if(!This->client_site) + return E_FAIL; + + /* Nothing to do, yet. */ + get_container_hwnd(This); + return S_OK; }
static const IPersistStreamInitVtbl PersistStreamInitVtbl = { diff --git a/dlls/wmp/tests/oleobj.c b/dlls/wmp/tests/oleobj.c index eababdb..52110c1 100644 --- a/dlls/wmp/tests/oleobj.c +++ b/dlls/wmp/tests/oleobj.c @@ -877,6 +877,9 @@ static void test_wmp(void) hres = IOleObject_QueryInterface(oleobj, &IID_IOleInPlaceObject, (void**)&ipobj); ok(hres == S_OK, "Could not get IOleInPlaceObject iface: %08x\n", hres);
+ hres = IPersistStreamInit_InitNew(psi); + ok(hres == E_FAIL || broken(hres == S_OK /* Old WMP */), "InitNew failed: %08x\n", hres); + SET_EXPECT(GetContainer); SET_EXPECT(GetExtendedControl); SET_EXPECT(GetWindow); @@ -893,6 +896,11 @@ static void test_wmp(void) ok(hres == S_OK, "GetClientSite failed: %08x\n", hres); ok(client_site == &ClientSite, "client_site != ClientSite\n");
+ SET_EXPECT(GetWindow); + hres = IPersistStreamInit_InitNew(psi); + ok(hres == S_OK, "InitNew failed: %08x\n", hres); + CHECK_CALLED(GetWindow); + hwnd = (HWND)0xdeadbeef; hres = IOleInPlaceObject_GetWindow(ipobj, &hwnd); ok(hres == E_UNEXPECTED, "GetWindow failed: %08x\n", hres);