quartz: Use an IDL file to define the IAMFilterData iface.

Michael Stefaniuc mstefani at redhat.de
Mon Sep 5 17:40:28 CDT 2011


fil_data.idl is a copy from dlls/dxdiagn/fil_data.idl with an added
"deprecated" note.
---

This is a follow up to my rejected patch
http://www.winehq.org/pipermail/wine-patches/2011-July/104110.html

dxdiagn's use of the deprecated IAMFilterData interface can be
trivially fixed too with:
# Revert: dxdiagn: Use quartz's IFilterMapper to get DirectShow filter information instead of looking through private structures.
git revert 27072f296f6770a4fe2407c8aefefe5b25d0b5de
# Revert: dxdiagn: Add fil_data.idl to describe IAMFilterData interface.
git revert 516aac77aa3af8a9b782e820372eb5bafd7e41ff
But that is left as an exercise for the interested reader.

Manually parsing the binary filter blob out of the registry is the
"correct" way of avoiding the deprecated IAMFilterData interface. See:
http://www.nntpnews.info/showthread.php?t=176008&pagenumber=
http://social.msdn.microsoft.com/Forums/pl-PL/windowsdirectshowdevelopment/thread/6b2cf500-a59c-485b-92cb-a6db05ee7f76
IFilterMapper2 doesn't offer a way to get the values from the REGFILTER2
structure of a filter. We know it better, you don't need that...


bye
        michael



 dlls/quartz/Makefile.in    |    1 +
 dlls/quartz/fil_data.idl   |   50 ++++++++++++++++++++++++++++++++++++++++++++
 dlls/quartz/filtermapper.c |   45 +-------------------------------------
 3 files changed, 53 insertions(+), 43 deletions(-)
 create mode 100644 dlls/quartz/fil_data.idl

diff --git a/dlls/quartz/Makefile.in b/dlls/quartz/Makefile.in
index 9a4e511..5827d65 100644
--- a/dlls/quartz/Makefile.in
+++ b/dlls/quartz/Makefile.in
@@ -29,6 +29,7 @@ C_SRCS = \
 
 RC_SRCS = version.rc
 
+IDL_H_SRCS = fil_data.idl
 IDL_P_SRCS = quartz_strmif.idl
 IDL_R_SRCS = quartz_strmif.idl
 
diff --git a/dlls/quartz/fil_data.idl b/dlls/quartz/fil_data.idl
new file mode 100644
index 0000000..1af488d
--- /dev/null
+++ b/dlls/quartz/fil_data.idl
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2009 Vitaliy Margolen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+import "objidl.idl";
+import "strmif.idl";
+import "unknwn.idl";
+
+
+/*****************************************************************************
+ * IAMFilterData interface
+ *
+ * Notes:
+ *     - This interface is deprecated and IFilterMapper2 should be used instead.
+ *     - There is no full replacement for IAMFilterData::ParseFilterData short of manually
+ *       parsing out the REGFILTER2 struct from the binary blob.
+ */
+[
+    object,
+    uuid(97f7c4d4-547b-4a5f-8332-536430ad2e4d),
+    pointer_default(unique)
+]
+interface IAMFilterData : IUnknown
+{
+    typedef [unique] IAMFilterData *LPIAMFILTERDATA;
+
+    HRESULT ParseFilterData(
+        [in] BYTE * rgbFilterData,
+        [in] ULONG cb,
+        [out] BYTE ** prgbRegFilter2);
+
+    HRESULT CreateFilterData(
+        [in] REGFILTER2 * prf2,
+        [out] BYTE ** prgbFilterData,
+        [out] ULONG * pcb);
+}
diff --git a/dlls/quartz/filtermapper.c b/dlls/quartz/filtermapper.c
index 78b6699..7d7599f 100644
--- a/dlls/quartz/filtermapper.c
+++ b/dlls/quartz/filtermapper.c
@@ -36,6 +36,8 @@
 #include "strmif.h"
 #include "wine/unicode.h"
 #include "uuids.h"
+#include "initguid.h"
+#include "fil_data.h"
 
 #include "wine/debug.h"
 
@@ -43,49 +45,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(quartz);
 
 #define ARRAYSIZE(array) (sizeof(array)/sizeof((array)[0]))
 
-/* Unexposed IAMFilterData interface */
-typedef struct IAMFilterData IAMFilterData;
-
-typedef struct IAMFilterDataVtbl
-{
-    BEGIN_INTERFACE
-
-    /*** IUnknown methods ***/
-    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
-        IAMFilterData *This,
-        REFIID riid,
-        void **ppvObject);
-
-    ULONG (STDMETHODCALLTYPE *AddRef)(
-        IAMFilterData *This);
-
-    ULONG (STDMETHODCALLTYPE *Release)(
-        IAMFilterData *This);
-
-    /*** IAMFilterData methods ***/
-    HRESULT (STDMETHODCALLTYPE *ParseFilterData)(
-        IAMFilterData *This,
-        BYTE *pData,
-        ULONG cb,
-        BYTE **ppRegFilter2);
-
-    HRESULT (STDMETHODCALLTYPE *CreateFilterData)(
-        IAMFilterData* This,
-        REGFILTER2 *prf2,
-        BYTE **pRegFilterData,
-        ULONG *pcb);
-
-    END_INTERFACE
-} IAMFilterDataVtbl;
-struct IAMFilterData
-{
-    const IAMFilterDataVtbl *lpVtbl;
-};
-static const GUID IID_IAMFilterData = {
- 0x97f7c4d4, 0x547b, 0x4a5f, { 0x83,0x32, 0x53,0x64,0x30,0xad,0x2e,0x4d }
-};
-
-
 typedef struct FilterMapper3Impl
 {
     IFilterMapper3 IFilterMapper3_iface;
-- 
1.7.6.1



More information about the wine-patches mailing list