From be81b6245cbd6e878f2edf1dc472855e7cbe4acf Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 18 Feb 2019 13:40:54 +1100 Subject: [PATCH] Added wmvcore-WMCreateSyncReader patchset --- patches/patchinstall.sh | 25 +- ...wmvcore-Implement-WMCreateSyncReader.patch | 280 ++++++++++++++++++ patches/wmvcore-WMCreateSyncReader/definition | 1 + ...ore-Implement-WMCreateSyncReaderPriv.patch | 8 +- .../wmvcore-WMCreateSyncReaderPriv/definition | 3 +- 5 files changed, 311 insertions(+), 6 deletions(-) create mode 100644 patches/wmvcore-WMCreateSyncReader/0001-wmvcore-Implement-WMCreateSyncReader.patch create mode 100644 patches/wmvcore-WMCreateSyncReader/definition diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 6967760b..4e89d212 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -382,6 +382,7 @@ patch_enable_all () enable_wintrust_WTHelperGetProvCertFromChain="$1" enable_wintrust_WinVerifyTrust="$1" enable_wmvcore_WMCheckURlExtension="$1" + enable_wmvcore_WMCreateSyncReader="$1" enable_wmvcore_WMCreateSyncReaderPriv="$1" enable_wow64cpu_Wow64Transition="$1" enable_wpcap_Dynamic_Linking="$1" @@ -1300,6 +1301,9 @@ patch_enable () wmvcore-WMCheckURlExtension) enable_wmvcore_WMCheckURlExtension="$2" ;; + wmvcore-WMCreateSyncReader) + enable_wmvcore_WMCreateSyncReader="$2" + ;; wmvcore-WMCreateSyncReaderPriv) enable_wmvcore_WMCreateSyncReaderPriv="$2" ;; @@ -1718,7 +1722,11 @@ if test "$enable_wmvcore_WMCreateSyncReaderPriv" -eq 1; then if test "$enable_wmvcore_WMCheckURlExtension" -gt 1; then abort "Patchset wmvcore-WMCheckURlExtension disabled, but wmvcore-WMCreateSyncReaderPriv depends on that." fi + if test "$enable_wmvcore_WMCreateSyncReader" -gt 1; then + abort "Patchset wmvcore-WMCreateSyncReader disabled, but wmvcore-WMCreateSyncReaderPriv depends on that." + fi enable_wmvcore_WMCheckURlExtension=1 + enable_wmvcore_WMCreateSyncReader=1 fi if test "$enable_wintrust_WTHelperGetProvCertFromChain" -eq 1; then @@ -7522,10 +7530,25 @@ if test "$enable_wmvcore_WMCheckURlExtension" -eq 1; then ) >> "$patchlist" fi +# Patchset wmvcore-WMCreateSyncReader +# | +# | This patchset fixes the following Wine bugs: +# | * [#35841] wmvcore: Implement WMCreateSyncReader +# | +# | Modified files: +# | * dlls/wmvcore/wmvcore_main.c +# | +if test "$enable_wmvcore_WMCreateSyncReader" -eq 1; then + patch_apply wmvcore-WMCreateSyncReader/0001-wmvcore-Implement-WMCreateSyncReader.patch + ( + printf '%s\n' '+ { "Andrey Gusev", "wmvcore: Implement WMCreateSyncReader.", 1 },'; + ) >> "$patchlist" +fi + # Patchset wmvcore-WMCreateSyncReaderPriv # | # | This patchset has the following (direct or indirect) dependencies: -# | * wmvcore-WMCheckURlExtension +# | * wmvcore-WMCheckURlExtension, wmvcore-WMCreateSyncReader # | # | This patchset fixes the following Wine bugs: # | * [#37327] wmvcore: Implement WMCreateSyncReaderPriv diff --git a/patches/wmvcore-WMCreateSyncReader/0001-wmvcore-Implement-WMCreateSyncReader.patch b/patches/wmvcore-WMCreateSyncReader/0001-wmvcore-Implement-WMCreateSyncReader.patch new file mode 100644 index 00000000..25a317a6 --- /dev/null +++ b/patches/wmvcore-WMCreateSyncReader/0001-wmvcore-Implement-WMCreateSyncReader.patch @@ -0,0 +1,280 @@ +From acfe1f58e910c7cf5ec6f953ad7459fff04bad42 Mon Sep 17 00:00:00 2001 +From: Andrey Gusev +Date: Mon, 18 Feb 2019 10:45:17 +1100 +Subject: [PATCH] wmvcore: Implement WMCreateSyncReader + +Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=35841 +--- + dlls/wmvcore/wmvcore_main.c | 250 +++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 247 insertions(+), 3 deletions(-) + +diff --git a/dlls/wmvcore/wmvcore_main.c b/dlls/wmvcore/wmvcore_main.c +index 690885e..be90318 100644 +--- a/dlls/wmvcore/wmvcore_main.c ++++ b/dlls/wmvcore/wmvcore_main.c +@@ -2103,15 +2103,259 @@ HRESULT WINAPI WMCreateReaderPriv(IWMReader **ret_reader) + return WMCreateReader(NULL, 0, ret_reader); + } + +-HRESULT WINAPI WMCreateSyncReader(IUnknown *pcert, DWORD rights, IWMSyncReader **syncreader) ++typedef struct { ++ IWMSyncReader IWMSyncReader_iface; ++ LONG ref; ++} WMSyncReader; ++ ++static inline WMSyncReader *impl_from_IWMSyncReader(IWMSyncReader *iface) ++{ ++ return CONTAINING_RECORD(iface, WMSyncReader, IWMSyncReader_iface); ++} ++ ++static HRESULT WINAPI WMSyncReader_QueryInterface(IWMSyncReader *iface, REFIID riid, void **ppv) ++{ ++ WMSyncReader *This = impl_from_IWMSyncReader(iface); ++ ++ if(IsEqualGUID(riid, &IID_IUnknown)) { ++ TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); ++ *ppv = &This->IWMSyncReader_iface; ++ }else if(IsEqualGUID(riid, &IID_IWMSyncReader)) { ++ TRACE("(%p)->(IID_IWMSyncReader %p)\n", This, ppv); ++ *ppv = &This->IWMSyncReader_iface; ++ }else { ++ *ppv = NULL; ++ FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); ++ return E_NOINTERFACE; ++ } ++ ++ IUnknown_AddRef((IUnknown*)*ppv); ++ return S_OK; ++} ++ ++static ULONG WINAPI WMSyncReader_AddRef(IWMSyncReader *iface) ++{ ++ WMSyncReader *This = impl_from_IWMSyncReader(iface); ++ LONG ref = InterlockedIncrement(&This->ref); ++ ++ TRACE("(%p) ref=%d\n", This, ref); ++ ++ return ref; ++} ++ ++static ULONG WINAPI WMSyncReader_Release(IWMSyncReader *iface) ++{ ++ WMSyncReader *This = impl_from_IWMSyncReader(iface); ++ LONG ref = InterlockedDecrement(&This->ref); ++ ++ TRACE("(%p) ref=%d\n", This, ref); ++ ++ if(!ref) ++ heap_free(This); ++ ++ return ref; ++} ++ ++static HRESULT WINAPI WMSyncReader_Close(IWMSyncReader *iface) ++{ ++ WMSyncReader *This = impl_from_IWMSyncReader(iface); ++ FIXME("(%p): stub!\n", This); ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI WMSyncReader_GetMaxOutputSampleSize(IWMSyncReader *iface, DWORD output, DWORD *max) ++{ ++ WMSyncReader *This = impl_from_IWMSyncReader(iface); ++ FIXME("(%p)->(%d %p): stub!\n", This, output, max); ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI WMSyncReader_GetMaxStreamSampleSize(IWMSyncReader *iface, WORD stream, DWORD *max) ++{ ++ WMSyncReader *This = impl_from_IWMSyncReader(iface); ++ FIXME("(%p)->(%d %p): stub!\n", This, stream, max); ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI WMSyncReader_GetNextSample(IWMSyncReader *iface, WORD stream, INSSBuffer **sample, ++ QWORD *sample_time, QWORD *sample_duration, DWORD *flags, DWORD *output_num, WORD *stream_num) + { +- FIXME("(%p, %x, %p): stub\n", pcert, rights, syncreader); ++ WMSyncReader *This = impl_from_IWMSyncReader(iface); ++ FIXME("(%p)->(%d %p %p %p %p %p %p): stub!\n", This, stream, sample, sample_time, ++ sample_duration, flags, output_num, stream_num); ++ return E_NOTIMPL; ++} + +- *syncreader = NULL; ++static HRESULT WINAPI WMSyncReader_GetOutputCount(IWMSyncReader *iface, DWORD *outputs) ++{ ++ WMSyncReader *This = impl_from_IWMSyncReader(iface); ++ FIXME("(%p)->(%p): stub!\n", This, outputs); ++ return E_NOTIMPL; ++} + ++static HRESULT WINAPI WMSyncReader_GetOutputFormat(IWMSyncReader *iface, DWORD output_num, DWORD format_num, ++ IWMOutputMediaProps **props) ++{ ++ WMSyncReader *This = impl_from_IWMSyncReader(iface); ++ FIXME("(%p)->(%u %u %p): stub!\n", This, output_num, format_num, props); + return E_NOTIMPL; + } + ++static HRESULT WINAPI WMSyncReader_GetOutputFormatCount(IWMSyncReader *iface, DWORD output_num, DWORD *formats) ++{ ++ WMSyncReader *This = impl_from_IWMSyncReader(iface); ++ FIXME("(%p)->(%u %p): stub!\n", This, output_num, formats); ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI WMSyncReader_GetOutputNumberForStream(IWMSyncReader *iface, WORD stream_num, DWORD *output_num) ++{ ++ WMSyncReader *This = impl_from_IWMSyncReader(iface); ++ FIXME("(%p)->(%u %p): stub!\n", This, stream_num, output_num); ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI WMSyncReader_GetOutputProps(IWMSyncReader *iface, DWORD output_num, IWMOutputMediaProps **output) ++{ ++ WMSyncReader *This = impl_from_IWMSyncReader(iface); ++ FIXME("(%p)->(%u %p): stub!\n", This, output_num, output); ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI WMSyncReader_GetOutputSetting(IWMSyncReader *iface, DWORD output_num, const WCHAR *name, ++ WMT_ATTR_DATATYPE *type, BYTE *value, WORD *length) ++{ ++ WMSyncReader *This = impl_from_IWMSyncReader(iface); ++ FIXME("(%p)->(%u %s %p %p %p): stub!\n", This, output_num, debugstr_w(name), type, value, length); ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI WMSyncReader_GetReadStreamSamples(IWMSyncReader *iface, WORD stream_num, BOOL *compressed) ++{ ++ WMSyncReader *This = impl_from_IWMSyncReader(iface); ++ FIXME("(%p)->(%d %p): stub!\n", This, stream_num, compressed); ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI WMSyncReader_GetStreamNumberForOutput(IWMSyncReader *iface, DWORD output, WORD *stream_num) ++{ ++ WMSyncReader *This = impl_from_IWMSyncReader(iface); ++ FIXME("(%p)->(%u %p): stub!\n", This, output, stream_num); ++ return S_OK; ++} ++ ++static HRESULT WINAPI WMSyncReader_GetStreamSelected(IWMSyncReader *iface, WORD stream_num, WMT_STREAM_SELECTION *selection) ++{ ++ WMSyncReader *This = impl_from_IWMSyncReader(iface); ++ FIXME("(%p)->(%d %p): stub!\n", This, stream_num, selection); ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI WMSyncReader_Open(IWMSyncReader *iface, const WCHAR *filename) ++{ ++ WMSyncReader *This = impl_from_IWMSyncReader(iface); ++ FIXME("(%p)->(%s): stub!\n", This, debugstr_w(filename)); ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI WMSyncReader_OpenStream(IWMSyncReader *iface, IStream *stream) ++{ ++ WMSyncReader *This = impl_from_IWMSyncReader(iface); ++ FIXME("(%p)->(%p): stub!\n", This, stream); ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI WMSyncReader_SetOutputProps(IWMSyncReader *iface, DWORD output_num, IWMOutputMediaProps *output) ++{ ++ WMSyncReader *This = impl_from_IWMSyncReader(iface); ++ FIXME("(%p)->(%u %p): stub!\n", This, output_num, output); ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI WMSyncReader_SetOutputSetting(IWMSyncReader *iface, DWORD output_num, const WCHAR *name, ++ WMT_ATTR_DATATYPE type, const BYTE *value, WORD length) ++{ ++ WMSyncReader *This = impl_from_IWMSyncReader(iface); ++ FIXME("(%p)->(%d %s %d %p %d): stub!\n", This, output_num, debugstr_w(name), type, value, length); ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI WMSyncReader_SetRange(IWMSyncReader *iface, QWORD start, LONGLONG duration) ++{ ++ WMSyncReader *This = impl_from_IWMSyncReader(iface); ++ FIXME("(%p)->(%s %s): stub!\n", This, wine_dbgstr_longlong(start), wine_dbgstr_longlong(duration)); ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI WMSyncReader_SetRangeByFrame(IWMSyncReader *iface, WORD stream_num, QWORD frame_num, ++ LONGLONG frames) ++{ ++ WMSyncReader *This = impl_from_IWMSyncReader(iface); ++ FIXME("(%p)->(%d %s %s): stub!\n", This, stream_num, wine_dbgstr_longlong(frame_num), wine_dbgstr_longlong(frames)); ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI WMSyncReader_SetReadStreamSamples(IWMSyncReader *iface, WORD stream_num, BOOL compressed) ++{ ++ WMSyncReader *This = impl_from_IWMSyncReader(iface); ++ FIXME("(%p)->(%u %x): stub!\n", This, stream_num, compressed); ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI WMSyncReader_SetStreamsSelected(IWMSyncReader *iface, WORD stream_count, ++ WORD *stream_numbers, WMT_STREAM_SELECTION *selections) ++{ ++ WMSyncReader *This = impl_from_IWMSyncReader(iface); ++ FIXME("(%p)->(%d %p %p): stub!\n", This, stream_count, stream_numbers, selections); ++ return S_OK; ++} ++ ++static const IWMSyncReaderVtbl WMSyncReaderVtbl = { ++ WMSyncReader_QueryInterface, ++ WMSyncReader_AddRef, ++ WMSyncReader_Release, ++ WMSyncReader_Open, ++ WMSyncReader_Close, ++ WMSyncReader_SetRange, ++ WMSyncReader_SetRangeByFrame, ++ WMSyncReader_GetNextSample, ++ WMSyncReader_SetStreamsSelected, ++ WMSyncReader_GetStreamSelected, ++ WMSyncReader_SetReadStreamSamples, ++ WMSyncReader_GetReadStreamSamples, ++ WMSyncReader_GetOutputSetting, ++ WMSyncReader_SetOutputSetting, ++ WMSyncReader_GetOutputCount, ++ WMSyncReader_GetOutputProps, ++ WMSyncReader_SetOutputProps, ++ WMSyncReader_GetOutputFormatCount, ++ WMSyncReader_GetOutputFormat, ++ WMSyncReader_GetOutputNumberForStream, ++ WMSyncReader_GetStreamNumberForOutput, ++ WMSyncReader_GetMaxOutputSampleSize, ++ WMSyncReader_GetMaxStreamSampleSize, ++ WMSyncReader_OpenStream ++}; ++ ++HRESULT WINAPI WMCreateSyncReader(IUnknown *pcert, DWORD rights, IWMSyncReader **syncreader) ++{ ++ WMSyncReader *sync; ++ ++ TRACE("(%p, %x, %p)\n", pcert, rights, syncreader); ++ ++ sync = heap_alloc(sizeof(*sync)); ++ ++ if (!sync) ++ return E_OUTOFMEMORY; ++ ++ sync->IWMSyncReader_iface.lpVtbl = &WMSyncReaderVtbl; ++ sync->ref = 1; ++ ++ *syncreader = &sync->IWMSyncReader_iface; ++ ++ return S_OK; ++} ++ + typedef struct { + IWMProfileManager IWMProfileManager_iface; + LONG ref; +-- +1.9.1 + diff --git a/patches/wmvcore-WMCreateSyncReader/definition b/patches/wmvcore-WMCreateSyncReader/definition new file mode 100644 index 00000000..467191f5 --- /dev/null +++ b/patches/wmvcore-WMCreateSyncReader/definition @@ -0,0 +1 @@ +Fixes: [35841] wmvcore: Implement WMCreateSyncReader diff --git a/patches/wmvcore-WMCreateSyncReaderPriv/0001-wmvcore-Implement-WMCreateSyncReaderPriv.patch b/patches/wmvcore-WMCreateSyncReaderPriv/0001-wmvcore-Implement-WMCreateSyncReaderPriv.patch index 7ebebdc4..0fe361cb 100644 --- a/patches/wmvcore-WMCreateSyncReaderPriv/0001-wmvcore-Implement-WMCreateSyncReaderPriv.patch +++ b/patches/wmvcore-WMCreateSyncReaderPriv/0001-wmvcore-Implement-WMCreateSyncReaderPriv.patch @@ -1,4 +1,4 @@ -From 7924a02651498da3a905ce8e41e1bc3f76f5a3d2 Mon Sep 17 00:00:00 2001 +From e27526b76229023c211e5541a2db7fef356b74f2 Mon Sep 17 00:00:00 2001 From: Andrey Gusev Date: Mon, 12 Nov 2018 14:54:32 +1100 Subject: [PATCH] wmvcore: Implement WMCreateSyncReaderPriv @@ -23,11 +23,11 @@ index 61c3c08..23d8caf 100644 @ stub WMValidateData @ stdcall -private DllRegisterServer() diff --git a/dlls/wmvcore/wmvcore_main.c b/dlls/wmvcore/wmvcore_main.c -index 14014ee..0fa7b57 100644 +index 951a1ec..511a66f 100644 --- a/dlls/wmvcore/wmvcore_main.c +++ b/dlls/wmvcore/wmvcore_main.c -@@ -2122,6 +2122,11 @@ HRESULT WINAPI WMCreateSyncReader(IUnknown *pcert, DWORD rights, IWMSyncReader * - return E_NOTIMPL; +@@ -2366,6 +2366,11 @@ HRESULT WINAPI WMCreateSyncReader(IUnknown *pcert, DWORD rights, IWMSyncReader * + return S_OK; } +HRESULT WINAPI WMCreateSyncReaderPriv(IWMSyncReader **syncreader) diff --git a/patches/wmvcore-WMCreateSyncReaderPriv/definition b/patches/wmvcore-WMCreateSyncReaderPriv/definition index 0db43a92..f681a86e 100644 --- a/patches/wmvcore-WMCreateSyncReaderPriv/definition +++ b/patches/wmvcore-WMCreateSyncReaderPriv/definition @@ -1,2 +1,3 @@ Fixes: [37327] wmvcore: Implement WMCreateSyncReaderPriv -Depends: wmvcore-WMCheckURlExtension \ No newline at end of file +Depends: wmvcore-WMCheckURlExtension +Depends: wmvcore-WMCreateSyncReader