[PATCH 3/7] wmp: add IWMPControls stub implementation

Anton Romanov theli.ua at gmail.com
Tue Jan 30 11:57:57 CST 2018


Signed-off-by: Anton Romanov <theli.ua at gmail.com>
---
 dlls/wmp/player.c      | 203 ++++++++++++++++++++++++++++++++++++++++++++++++-
 dlls/wmp/wmp_private.h |   1 +
 2 files changed, 202 insertions(+), 2 deletions(-)

diff --git a/dlls/wmp/player.c b/dlls/wmp/player.c
index c410d6ef8f..430f701539 100644
--- a/dlls/wmp/player.c
+++ b/dlls/wmp/player.c
@@ -29,6 +29,11 @@ static inline WindowsMediaPlayer *impl_from_IWMPPlayer4(IWMPPlayer4 *iface)
     return CONTAINING_RECORD(iface, WindowsMediaPlayer, IWMPPlayer4_iface);
 }
 
+static inline WindowsMediaPlayer *impl_from_IWMPControls(IWMPControls *iface)
+{
+    return CONTAINING_RECORD(iface, WindowsMediaPlayer, IWMPControls_iface);
+}
+
 static HRESULT WINAPI WMPPlayer4_QueryInterface(IWMPPlayer4 *iface, REFIID riid, void **ppv)
 {
     WindowsMediaPlayer *This = impl_from_IWMPPlayer4(iface);
@@ -118,8 +123,12 @@ static HRESULT WINAPI WMPPlayer4_get_playState(IWMPPlayer4 *iface, WMPPlayState
 static HRESULT WINAPI WMPPlayer4_get_controls(IWMPPlayer4 *iface, IWMPControls **ppControl)
 {
     WindowsMediaPlayer *This = impl_from_IWMPPlayer4(iface);
-    FIXME("(%p)->(%p)\n", This, ppControl);
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%p)\n", This, ppControl);
+
+    IWMPSettings_AddRef(&This->IWMPSettings_iface);
+    *ppControl = &This->IWMPControls_iface;
+    return S_OK;
 }
 
 static HRESULT WINAPI WMPPlayer4_get_settings(IWMPPlayer4 *iface, IWMPSettings **ppSettings)
@@ -667,9 +676,199 @@ void destroy_player(WindowsMediaPlayer* wmp) {
     heap_free(wmp);
 }
 
+HRESULT WINAPI WMPControls_fastForward(IWMPControls *iface)
+{
+    WindowsMediaPlayer *This = impl_from_IWMPControls(iface);
+    FIXME("(%p)\n", This);
+    return E_NOTIMPL;
+}
+
+HRESULT WINAPI WMPControls_fastReverse(IWMPControls *iface)
+{
+    WindowsMediaPlayer *This = impl_from_IWMPControls(iface);
+    FIXME("(%p)\n", This);
+    return E_NOTIMPL;
+}
+
+HRESULT WINAPI WMPControls_get_currentItem(IWMPControls *iface, IWMPMedia **ppIWMPMedia)
+{
+    WindowsMediaPlayer *This = impl_from_IWMPControls(iface);
+    FIXME("(%p)->(%p)\n", This, ppIWMPMedia);
+    return E_NOTIMPL;
+}
+
+HRESULT WINAPI WMPControls_get_currentMarker(IWMPControls *iface, LONG *plMarker)
+{
+    WindowsMediaPlayer *This = impl_from_IWMPControls(iface);
+    FIXME("(%p)->(%p)\n", This, plMarker);
+    return E_NOTIMPL;
+}
+
+HRESULT WINAPI WMPControls_get_currentPosition(IWMPControls *iface, DOUBLE *pdCurrentPosition)
+{
+    WindowsMediaPlayer *This = impl_from_IWMPControls(iface);
+    FIXME("(%p)->(%p)\n", This, pdCurrentPosition);
+    return E_NOTIMPL;
+}
+
+HRESULT WINAPI WMPControls_get_currentPositionString(IWMPControls *iface, BSTR *pbstrCurrentPosition)
+{
+    WindowsMediaPlayer *This = impl_from_IWMPControls(iface);
+    FIXME("(%p)->(%p)\n", This, pbstrCurrentPosition);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI WMPControls_get_isAvailable(IWMPControls *iface, BSTR bstrItem, VARIANT_BOOL *pIsAvailable)
+{
+    WindowsMediaPlayer *This = impl_from_IWMPControls(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_w(bstrItem));
+    return E_NOTIMPL;
+}
+
+HRESULT WINAPI WMPControls_next(IWMPControls *iface)
+{
+    WindowsMediaPlayer *This = impl_from_IWMPControls(iface);
+    FIXME("(%p)\n", This);
+    return E_NOTIMPL;
+}
+
+HRESULT WINAPI WMPControls_pause(IWMPControls *iface)
+{
+    WindowsMediaPlayer *This = impl_from_IWMPControls(iface);
+    FIXME("(%p)\n", This);
+    return E_NOTIMPL;
+}
+
+HRESULT WINAPI WMPControls_play(IWMPControls *iface)
+{
+    WindowsMediaPlayer *This = impl_from_IWMPControls(iface);
+    FIXME("(%p)\n", This);
+    return E_NOTIMPL;
+}
+
+HRESULT WINAPI WMPControls_playItem(IWMPControls *iface, IWMPMedia *pIWMPMedia)
+{
+    WindowsMediaPlayer *This = impl_from_IWMPControls(iface);
+    FIXME("(%p)->(%p)\n", This, pIWMPMedia);
+    return E_NOTIMPL;
+}
+
+HRESULT WINAPI WMPControls_previous(IWMPControls *iface)
+{
+    WindowsMediaPlayer *This = impl_from_IWMPControls(iface);
+    FIXME("(%p)\n", This);
+    return E_NOTIMPL;
+}
+
+HRESULT WINAPI WMPControls_put_currentItem(IWMPControls *iface, IWMPMedia *pIWMPMedia)
+{
+    WindowsMediaPlayer *This = impl_from_IWMPControls(iface);
+    FIXME("(%p)->(%p)\n", This, pIWMPMedia);
+    return E_NOTIMPL;
+}
+
+HRESULT WINAPI WMPControls_put_currentMarker(IWMPControls *iface, LONG lMarker)
+{
+    WindowsMediaPlayer *This = impl_from_IWMPControls(iface);
+    FIXME("(%p)->(%d)\n", This, lMarker);
+    return E_NOTIMPL;
+}
+
+HRESULT WINAPI WMPControls_put_currentPosition(IWMPControls *iface, DOUBLE dCurrentPosition)
+{
+    WindowsMediaPlayer *This = impl_from_IWMPControls(iface);
+    FIXME("(%p)->(%f)\n", This, dCurrentPosition);
+    return E_NOTIMPL;
+}
+
+HRESULT WINAPI WMPControls_stop(IWMPControls *iface)
+{
+    WindowsMediaPlayer *This = impl_from_IWMPControls(iface);
+    FIXME("(%p)\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI WMPControls_QueryInterface(IWMPControls *iface, REFIID riid, void **ppv)
+{
+    WindowsMediaPlayer *This = impl_from_IWMPControls(iface);
+    return IOleObject_QueryInterface(&This->IOleObject_iface, riid, ppv);
+}
+
+static ULONG WINAPI WMPControls_AddRef(IWMPControls *iface)
+{
+    WindowsMediaPlayer *This = impl_from_IWMPControls(iface);
+    return IOleObject_AddRef(&This->IOleObject_iface);
+}
+
+static ULONG WINAPI WMPControls_Release(IWMPControls *iface)
+{
+    WindowsMediaPlayer *This = impl_from_IWMPControls(iface);
+    return IOleObject_Release(&This->IOleObject_iface);
+}
+
+static HRESULT WINAPI WMPControls_GetTypeInfoCount(IWMPControls *iface, UINT *pctinfo)
+{
+    WindowsMediaPlayer *This = impl_from_IWMPControls(iface);
+    FIXME("(%p)->(%p)\n", This, pctinfo);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI WMPControls_GetTypeInfo(IWMPControls *iface, UINT iTInfo,
+        LCID lcid, ITypeInfo **ppTInfo)
+{
+    WindowsMediaPlayer *This = impl_from_IWMPControls(iface);
+    FIXME("(%p)->(%u %d %p)\n", This, iTInfo, lcid, ppTInfo);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI WMPControls_GetIDsOfNames(IWMPControls *iface, REFIID riid,
+        LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
+{
+    WindowsMediaPlayer *This = impl_from_IWMPControls(iface);
+    FIXME("(%p)->(%s %p %u %d %p)\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI WMPControls_Invoke(IWMPControls *iface, DISPID dispIdMember,
+        REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
+        EXCEPINFO *pExcepInfo, UINT *puArgErr)
+{
+    WindowsMediaPlayer *This = impl_from_IWMPControls(iface);
+    FIXME("(%p)->(%d %s %d %x %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), lcid,
+          wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
+    return E_NOTIMPL;
+}
+
+static const IWMPControlsVtbl WMPControlsVtbl = {
+    WMPControls_QueryInterface,
+    WMPControls_AddRef,
+    WMPControls_Release,
+    WMPControls_GetTypeInfoCount,
+    WMPControls_GetTypeInfo,
+    WMPControls_GetIDsOfNames,
+    WMPControls_Invoke,
+    WMPControls_get_isAvailable,
+    WMPControls_play,
+    WMPControls_stop,
+    WMPControls_pause,
+    WMPControls_fastForward,
+    WMPControls_fastReverse,
+    WMPControls_get_currentPosition,
+    WMPControls_put_currentPosition,
+    WMPControls_get_currentPositionString,
+    WMPControls_next,
+    WMPControls_previous,
+    WMPControls_get_currentItem,
+    WMPControls_put_currentItem,
+    WMPControls_get_currentMarker,
+    WMPControls_put_currentMarker,
+    WMPControls_playItem,
+};
+
 HRESULT init_player(WindowsMediaPlayer *wmp)
 {
     wmp->IWMPPlayer4_iface.lpVtbl = &WMPPlayer4Vtbl;
     wmp->IWMPSettings_iface.lpVtbl = &WMPSettingsVtbl;
+    wmp->IWMPControls_iface.lpVtbl = &WMPControlsVtbl;
     return S_OK;
 }
diff --git a/dlls/wmp/wmp_private.h b/dlls/wmp/wmp_private.h
index 5abee6217d..b047143b3e 100644
--- a/dlls/wmp/wmp_private.h
+++ b/dlls/wmp/wmp_private.h
@@ -42,6 +42,7 @@ struct WindowsMediaPlayer {
     IOleControl IOleControl_iface;
     IWMPPlayer4 IWMPPlayer4_iface;
     IWMPSettings IWMPSettings_iface;
+    IWMPControls IWMPControls_iface;
 
     LONG ref;
 
-- 
2.15.1




More information about the wine-devel mailing list