From 424271828e832678b1e1f8dcd03ae6994482e640 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 30 Apr 2016 01:39:48 +0200 Subject: [PATCH] Added patch to implement IKsControl stub subinterface for SynthPort. --- ...nt-IDirectMusicBuffer-PackStructured.patch | 43 ++++++ ...ntrol-stub-subinterface-for-SynthPor.patch | 144 ++++++++++++++++++ .../dmusic-SynthPort_IKsControl/definition | 1 + patches/patchinstall.sh | 21 +++ 4 files changed, 209 insertions(+) create mode 100644 patches/dmusic-SynthPort_IKsControl/0001-dmusic-Implement-IDirectMusicBuffer-PackStructured.patch create mode 100644 patches/dmusic-SynthPort_IKsControl/0002-dmusic-Add-IKsControl-stub-subinterface-for-SynthPor.patch create mode 100644 patches/dmusic-SynthPort_IKsControl/definition diff --git a/patches/dmusic-SynthPort_IKsControl/0001-dmusic-Implement-IDirectMusicBuffer-PackStructured.patch b/patches/dmusic-SynthPort_IKsControl/0001-dmusic-Implement-IDirectMusicBuffer-PackStructured.patch new file mode 100644 index 00000000..6d336969 --- /dev/null +++ b/patches/dmusic-SynthPort_IKsControl/0001-dmusic-Implement-IDirectMusicBuffer-PackStructured.patch @@ -0,0 +1,43 @@ +From 765b7ac424a30543d0ca6da8c217d8eb024b870b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Fri, 29 Apr 2016 16:39:50 +0200 +Subject: dmusic: Implement IDirectMusicBuffer::PackStructured. + +--- + dlls/dmusic/buffer.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/dlls/dmusic/buffer.c b/dlls/dmusic/buffer.c +index bd0ad1a..5be2e0d 100644 +--- a/dlls/dmusic/buffer.c ++++ b/dlls/dmusic/buffer.c +@@ -134,9 +134,26 @@ static HRESULT WINAPI IDirectMusicBufferImpl_PackStructured(LPDIRECTMUSICBUFFER + static HRESULT WINAPI IDirectMusicBufferImpl_PackUnstructured(LPDIRECTMUSICBUFFER iface, REFERENCE_TIME rt, DWORD dwChannelGroup, DWORD cb, LPBYTE lpb) + { + IDirectMusicBufferImpl *This = impl_from_IDirectMusicBuffer(iface); ++ DWORD new_write_pos = This->write_pos + sizeof(DMUS_EVENTHEADER) + cb; ++ DMUS_EVENTHEADER header; + + FIXME("(%p, 0x%s, %d, %d, %p): stub\n", This, wine_dbgstr_longlong(rt), dwChannelGroup, cb, lpb); + ++ if (new_write_pos > This->size) ++ return DMUS_E_BUFFER_FULL; ++ ++ if (!This->write_pos) ++ This->start_time = rt; ++ ++ header.cbEvent = cb; ++ header.dwChannelGroup = dwChannelGroup; ++ header.rtDelta = rt - This->start_time; ++ header.dwFlags = 0; ++ ++ memcpy(This->data + This->write_pos, &header, sizeof(header)); ++ memcpy(This->data + This->write_pos + sizeof(header), lpb, cb); ++ This->write_pos = new_write_pos; ++ + return S_OK; + } + +-- +2.8.0 + diff --git a/patches/dmusic-SynthPort_IKsControl/0002-dmusic-Add-IKsControl-stub-subinterface-for-SynthPor.patch b/patches/dmusic-SynthPort_IKsControl/0002-dmusic-Add-IKsControl-stub-subinterface-for-SynthPor.patch new file mode 100644 index 00000000..cfa609fb --- /dev/null +++ b/patches/dmusic-SynthPort_IKsControl/0002-dmusic-Add-IKsControl-stub-subinterface-for-SynthPor.patch @@ -0,0 +1,144 @@ +From 8b845b6348b898f79e7fd401b045a46f9501e1e0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Fri, 29 Apr 2016 16:41:04 +0200 +Subject: dmusic: Add IKsControl stub subinterface for SynthPort. + +--- + dlls/dmusic/dmusic_private.h | 2 ++ + dlls/dmusic/port.c | 79 ++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 81 insertions(+) + +diff --git a/dlls/dmusic/dmusic_private.h b/dlls/dmusic/dmusic_private.h +index 44d5d57..110788c 100644 +--- a/dlls/dmusic/dmusic_private.h ++++ b/dlls/dmusic/dmusic_private.h +@@ -41,6 +41,7 @@ + #include "dmusici.h" + #include "dmusicf.h" + #include "dmusics.h" ++#include "dmksctrl.h" + + /***************************************************************************** + * Interfaces +@@ -167,6 +168,7 @@ struct SynthPortImpl { + IDirectMusicPort IDirectMusicPort_iface; + IDirectMusicPortDownload IDirectMusicPortDownload_iface; + IDirectMusicThru IDirectMusicThru_iface; ++ IKsControl IKsControl_iface; + LONG ref; + + /* IDirectMusicPort fields */ +diff --git a/dlls/dmusic/port.c b/dlls/dmusic/port.c +index f886d52..3d434e1 100644 +--- a/dlls/dmusic/port.c ++++ b/dlls/dmusic/port.c +@@ -44,6 +44,11 @@ static inline SynthPortImpl *impl_from_SynthPortImpl_IDirectMusicThru(IDirectMus + return CONTAINING_RECORD(iface, SynthPortImpl, IDirectMusicThru_iface); + } + ++static inline SynthPortImpl *impl_from_SynthPortImpl_IKsControl(IKsControl *iface) ++{ ++ return CONTAINING_RECORD(iface, SynthPortImpl, IKsControl_iface); ++} ++ + /* IDirectMusicDownloadedInstrument IUnknown part follows: */ + static HRESULT WINAPI IDirectMusicDownloadedInstrumentImpl_QueryInterface(IDirectMusicDownloadedInstrument *iface, REFIID riid, VOID **ret_iface) + { +@@ -142,6 +147,10 @@ static HRESULT WINAPI SynthPortImpl_IDirectMusicPort_QueryInterface(LPDIRECTMUSI + *ret_iface = &This->IDirectMusicThru_iface; + IDirectMusicThru_AddRef((LPDIRECTMUSICTHRU)*ret_iface); + return S_OK; ++ } else if (IsEqualGUID(riid, &IID_IKsControl)) { ++ *ret_iface = &This->IKsControl_iface; ++ IKsControl_AddRef((IKsControl*)*ret_iface); ++ return S_OK; + } + + WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ret_iface); +@@ -672,6 +681,75 @@ static const IDirectMusicThruVtbl SynthPortImpl_DirectMusicThru_Vtbl = { + SynthPortImpl_IDirectMusicThru_ThruChannel + }; + ++static HRESULT WINAPI SynthPortImpl_IKsControl_QueryInterface(IKsControl* iface, REFIID riid, LPVOID *ppobj) ++{ ++ SynthPortImpl *This = impl_from_SynthPortImpl_IKsControl(iface); ++ ++ return IDirectMusicPort_QueryInterface(&This->IDirectMusicPort_iface, riid, ppobj); ++} ++ ++static ULONG WINAPI SynthPortImpl_IKsControl_AddRef(IKsControl* iface) ++{ ++ SynthPortImpl *This = impl_from_SynthPortImpl_IKsControl(iface); ++ ++ return IDirectMusicPort_AddRef(&This->IDirectMusicPort_iface); ++} ++ ++static ULONG WINAPI SynthPortImpl_IKsControl_Release(IKsControl* iface) ++{ ++ SynthPortImpl *This = impl_from_SynthPortImpl_IKsControl(iface); ++ ++ return IDirectMusicPort_Release(&This->IDirectMusicPort_iface); ++} ++ ++static HRESULT WINAPI SynthPortImpl_IKsControl_KsProperty(IKsControl* iface, PKSPROPERTY Property, ULONG PropertyLength, LPVOID PropertyData, ++ ULONG DataLength, ULONG* BytesReturned) ++{ ++ TRACE("(%p)->(%p, %u, %p, %u, %p)\n", iface, Property, PropertyLength, PropertyData, DataLength, BytesReturned); ++ ++ TRACE("Property = %s - %u - %u\n", debugstr_guid(&Property->Set), Property->Id, Property->Flags); ++ ++ if (Property->Flags != KSPROPERTY_TYPE_GET) ++ { ++ FIXME("Property flags %u not yet supported\n", Property->Flags); ++ return S_FALSE; ++ } ++ ++ if (DataLength < sizeof(DWORD)) ++ return E_NOT_SUFFICIENT_BUFFER; ++ ++ FIXME("Unknown property %s\n", debugstr_guid(&Property->Set)); ++ *(DWORD*)PropertyData = FALSE; ++ *BytesReturned = sizeof(DWORD); ++ ++ return S_OK; ++} ++ ++static HRESULT WINAPI SynthPortImpl_IKsControl_KsMethod(IKsControl* iface, PKSMETHOD Method, ULONG MethodLength, LPVOID MethodData, ++ ULONG DataLength, ULONG* BytesReturned) ++{ ++ FIXME("(%p)->(%p, %u, %p, %u, %p): stub\n", iface, Method, MethodLength, MethodData, DataLength, BytesReturned); ++ ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI SynthPortImpl_IKsControl_KsEvent(IKsControl* iface, PKSEVENT Event, ULONG EventLength, LPVOID EventData, ++ ULONG DataLength, ULONG* BytesReturned) ++{ ++ FIXME("(%p)->(%p, %u, %p, %u, %p): stub\n", iface, Event, EventLength, EventData, DataLength, BytesReturned); ++ ++ return E_NOTIMPL; ++} ++ ++static const IKsControlVtbl SynthPortImpl_IKsControl_Vtbl = { ++ SynthPortImpl_IKsControl_QueryInterface, ++ SynthPortImpl_IKsControl_AddRef, ++ SynthPortImpl_IKsControl_Release, ++ SynthPortImpl_IKsControl_KsProperty, ++ SynthPortImpl_IKsControl_KsMethod, ++ SynthPortImpl_IKsControl_KsEvent ++}; ++ + HRESULT DMUSIC_CreateSynthPortImpl(LPCGUID guid, LPVOID *object, LPUNKNOWN unkouter, LPDMUS_PORTPARAMS port_params, LPDMUS_PORTCAPS port_caps, DWORD device) + { + SynthPortImpl *obj; +@@ -689,6 +767,7 @@ HRESULT DMUSIC_CreateSynthPortImpl(LPCGUID guid, LPVOID *object, LPUNKNOWN unkou + obj->IDirectMusicPort_iface.lpVtbl = &SynthPortImpl_DirectMusicPort_Vtbl; + obj->IDirectMusicPortDownload_iface.lpVtbl = &SynthPortImpl_DirectMusicPortDownload_Vtbl; + obj->IDirectMusicThru_iface.lpVtbl = &SynthPortImpl_DirectMusicThru_Vtbl; ++ obj->IKsControl_iface.lpVtbl = &SynthPortImpl_IKsControl_Vtbl; + obj->ref = 0; /* Will be inited by QueryInterface */ + obj->fActive = FALSE; + obj->params = *port_params; +-- +2.8.0 + diff --git a/patches/dmusic-SynthPort_IKsControl/definition b/patches/dmusic-SynthPort_IKsControl/definition new file mode 100644 index 00000000..5b40f327 --- /dev/null +++ b/patches/dmusic-SynthPort_IKsControl/definition @@ -0,0 +1 @@ +Fixes: [30105] Implement IKsControl stub subinterface for SynthPort diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 85b45434..28d401e5 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -132,6 +132,7 @@ patch_enable_all () enable_ddraw_Write_Vtable="$1" enable_ddraw_d3d_execute_buffer="$1" enable_dinput_Initialize="$1" + enable_dmusic_SynthPort_IKsControl="$1" enable_dsound_DSCAPS_CERTIFIED="$1" enable_dsound_EAX="$1" enable_dsound_Fast_Mixer="$1" @@ -564,6 +565,9 @@ patch_enable () dinput-Initialize) enable_dinput_Initialize="$2" ;; + dmusic-SynthPort_IKsControl) + enable_dmusic_SynthPort_IKsControl="$2" + ;; dsound-DSCAPS_CERTIFIED) enable_dsound_DSCAPS_CERTIFIED="$2" ;; @@ -3328,6 +3332,23 @@ if test "$enable_dinput_Initialize" -eq 1; then ) >> "$patchlist" fi +# Patchset dmusic-SynthPort_IKsControl +# | +# | This patchset fixes the following Wine bugs: +# | * [#30105] Implement IKsControl stub subinterface for SynthPort +# | +# | Modified files: +# | * dlls/dmusic/buffer.c, dlls/dmusic/dmusic_private.h, dlls/dmusic/port.c +# | +if test "$enable_dmusic_SynthPort_IKsControl" -eq 1; then + patch_apply dmusic-SynthPort_IKsControl/0001-dmusic-Implement-IDirectMusicBuffer-PackStructured.patch + patch_apply dmusic-SynthPort_IKsControl/0002-dmusic-Add-IKsControl-stub-subinterface-for-SynthPor.patch + ( + echo '+ { "Michael Müller", "dmusic: Implement IDirectMusicBuffer::PackStructured.", 1 },'; + echo '+ { "Michael Müller", "dmusic: Add IKsControl stub subinterface for SynthPort.", 1 },'; + ) >> "$patchlist" +fi + # Patchset dsound-DSCAPS_CERTIFIED # | # | Modified files: