[PATCH] wmp: Implement IWMPPlayer_get_URL and IWMPMedia_get_sourceURL
Signed-off-by: Anton Romanov <theli.ua(a)gmail.com> --- dlls/wmp/player.c | 5 +++-- dlls/wmp/tests/oleobj.c | 10 ++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/dlls/wmp/player.c b/dlls/wmp/player.c index cb8e074103..6c68240fa8 100644 --- a/dlls/wmp/player.c +++ b/dlls/wmp/player.c @@ -1577,8 +1577,9 @@ static HRESULT WINAPI WMPMedia_get_isIdentical(IWMPMedia *iface, IWMPMedia *othe static HRESULT WINAPI WMPMedia_get_sourceURL(IWMPMedia *iface, BSTR *pbstrSourceUrl) { WMPMedia *This = impl_from_IWMPMedia(iface); - FIXME("(%p)->(%p)\n", This, pbstrSourceUrl); - return E_NOTIMPL; + TRACE("(%p)->(%p)\n", This, pbstrSourceUrl); + *pbstrSourceUrl = SysAllocString(This->url); + return S_OK; } static HRESULT WINAPI WMPMedia_get_name(IWMPMedia *iface, BSTR *pbstrName) diff --git a/dlls/wmp/tests/oleobj.c b/dlls/wmp/tests/oleobj.c index ae93d79dcd..608a8e771e 100644 --- a/dlls/wmp/tests/oleobj.c +++ b/dlls/wmp/tests/oleobj.c @@ -955,8 +955,8 @@ static void test_wmp_ifaces(IOleObject *oleobj) url = NULL; SET_EXPECT(Invoke_USERMODE); hres = IWMPPlayer4_get_URL(player4, &url); - todo_wine ok(hres == S_OK, "IWMPPlayer4_get_URL failed: %08x\n", hres); - todo_wine ok(0 == lstrcmpW(url, filename), "%s != %s", wine_dbgstr_w(url), wine_dbgstr_w(filename)); + ok(hres == S_OK, "IWMPPlayer4_get_URL failed: %08x\n", hres); + ok(0 == lstrcmpW(url, filename), "%s != %s", wine_dbgstr_w(url), wine_dbgstr_w(filename)); todo_wine CHECK_CALLED(Invoke_USERMODE); SysFreeString(url); @@ -964,6 +964,12 @@ static void test_wmp_ifaces(IOleObject *oleobj) ok(hres == S_OK, "get_currentMedia failed: %08x\n", hres); ok(media != NULL, "media = (%p)\n", media); + url = NULL; + hres = IWMPMedia_get_sourceURL(media, &url); + ok(hres == S_OK, "IWMPPlayer4_get_URL failed: %08x\n", hres); + ok(0 == lstrcmpW(url, filename), "%s != %s", wine_dbgstr_w(url), wine_dbgstr_w(filename)); + SysFreeString(url); + SET_EXPECT(GetContainer); hres = IWMPPlayer4_put_currentMedia(player4, media); ok(hres == S_OK, "put_currentMedia failed: %08x\n", hres); -- 2.16.2
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> --- It would be even better with allocation failure handling.
2018-03-10 8:26 GMT+01:00 Anton Romanov <theli.ua(a)gmail.com>:
+ hres = IWMPMedia_get_sourceURL(media, &url); + ok(hres == S_OK, "IWMPPlayer4_get_URL failed: %08x\n", hres);
There is a copy-paste mistake here. (I already sent this to Anton and he confirmed this, but forgot to CC wine-devel, sorry about that)
On Mon, Mar 12, 2018 at 7:25 AM, Gijs Vermeulen <gijsvrm(a)gmail.com> wrote:
2018-03-10 8:26 GMT+01:00 Anton Romanov <theli.ua(a)gmail.com>:
+ hres = IWMPMedia_get_sourceURL(media, &url); + ok(hres == S_OK, "IWMPPlayer4_get_URL failed: %08x\n", hres);
There is a copy-paste mistake here.
(I already sent this to Anton and he confirmed this, but forgot to CC wine-devel, sorry about that)
Don't worry. I'll submit a fix for the comment and handling of allocation failures.
participants (3)
-
Anton Romanov -
Gijs Vermeulen -
Jacek Caban