From: Zebediah Figura z.figura12@gmail.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qedit/main.c | 77 +++++++++++++++++++++++++++++++++++++- dlls/qedit/qedit_private.h | 3 +- dlls/quartz/regsvr.c | 12 ------ 3 files changed, 77 insertions(+), 15 deletions(-)
diff --git a/dlls/qedit/main.c b/dlls/qedit/main.c index a271f9adb79..3797d96dcf3 100644 --- a/dlls/qedit/main.c +++ b/dlls/qedit/main.c @@ -192,12 +192,71 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) return S_OK; }
+static const REGPINTYPES reg_null_mt = {&GUID_NULL, &GUID_NULL}; + +static const REGFILTERPINS2 reg_sample_grabber_pins[2] = +{ + { + .cInstances = 1, + .nMediaTypes = 1, + .lpMediaType = ®_null_mt, + }, + { + .dwFlags = REG_PINFLAG_B_OUTPUT, + .cInstances = 1, + .nMediaTypes = 1, + .lpMediaType = ®_null_mt, + }, +}; + +static const REGFILTER2 reg_sample_grabber = +{ + .dwVersion = 2, + .dwMerit = MERIT_DO_NOT_USE, + .u.s2.cPins2 = 2, + .u.s2.rgPins2 = reg_sample_grabber_pins, +}; + +static const REGFILTERPINS2 reg_null_renderer_pins[1] = +{ + { + .dwFlags = REG_PINFLAG_B_OUTPUT, + .cInstances = 1, + .nMediaTypes = 1, + .lpMediaType = ®_null_mt, + }, +}; + +static const REGFILTER2 reg_null_renderer = +{ + .dwVersion = 2, + .dwMerit = MERIT_DO_NOT_USE, + .u.s2.cPins2 = 1, + .u.s2.rgPins2 = reg_null_renderer_pins, +}; + /*********************************************************************** * DllRegisterServer (QEDIT.@) */ HRESULT WINAPI DllRegisterServer(void) { - return __wine_register_resources( instance ); + IFilterMapper2 *mapper; + HRESULT hr; + + if (FAILED(hr = __wine_register_resources( instance ))) + return hr; + + if (FAILED(hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, + &IID_IFilterMapper2, (void **)&mapper))) + return hr; + + IFilterMapper2_RegisterFilter(mapper, &CLSID_SampleGrabber, L"SampleGrabber", + NULL, NULL, NULL, ®_sample_grabber); + IFilterMapper2_RegisterFilter(mapper, &CLSID_NullRenderer, L"Null Renderer", + NULL, NULL, NULL, ®_null_renderer); + + IFilterMapper2_Release(mapper); + return S_OK; }
/*********************************************************************** @@ -205,5 +264,19 @@ HRESULT WINAPI DllRegisterServer(void) */ HRESULT WINAPI DllUnregisterServer(void) { - return __wine_unregister_resources( instance ); + IFilterMapper2 *mapper; + HRESULT hr; + + if (FAILED(hr = __wine_unregister_resources( instance ))) + return hr; + + if (FAILED(hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, + &IID_IFilterMapper2, (void **)&mapper))) + return hr; + + IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_SampleGrabber); + IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_NullRenderer); + + IFilterMapper2_Release(mapper); + return S_OK; } diff --git a/dlls/qedit/qedit_private.h b/dlls/qedit/qedit_private.h index 344656d7d87..96f21bcb3ba 100644 --- a/dlls/qedit/qedit_private.h +++ b/dlls/qedit/qedit_private.h @@ -23,7 +23,8 @@ #include <stdarg.h>
#define COBJMACROS - +#define NONAMELESSSTRUCT +#define NONAMELESSUNION #include "windef.h" #include "winbase.h" #include "wtypes.h" diff --git a/dlls/quartz/regsvr.c b/dlls/quartz/regsvr.c index ff5db662f04..7196f79a54c 100644 --- a/dlls/quartz/regsvr.c +++ b/dlls/quartz/regsvr.c @@ -174,18 +174,6 @@ static HRESULT unregister_filters(struct regsvr_filter const *list) */
static struct regsvr_filter const filter_list[] = { - { &CLSID_NullRenderer, - &CLSID_LegacyAmFilterCategory, - L"Null Renderer", - 0x200000, - { { REG_PINFLAG_B_RENDERER, - { { &MEDIATYPE_NULL, &GUID_NULL }, - { NULL } - }, - }, - { 0xFFFFFFFF }, - } - }, { &CLSID_VideoRenderer, &CLSID_LegacyAmFilterCategory, L"Video Renderer",