Jacek Caban : devenum: Populate CLSID_VideoCompressorCategory category in key in DEVENUM_CreateSpecialCategories.

Alexandre Julliard julliard at winehq.org
Wed Jan 8 13:41:34 CST 2014


Module: wine
Branch: master
Commit: 81c42ce710bdc9385391310ecb3f22e2a153ac5f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=81c42ce710bdc9385391310ecb3f22e2a153ac5f

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Jan  8 14:12:25 2014 +0100

devenum: Populate CLSID_VideoCompressorCategory category in key in DEVENUM_CreateSpecialCategories.

---

 dlls/devenum/Makefile.in     |    1 +
 dlls/devenum/createdevenum.c |   44 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+)

diff --git a/dlls/devenum/Makefile.in b/dlls/devenum/Makefile.in
index fe12606..38ca83d 100644
--- a/dlls/devenum/Makefile.in
+++ b/dlls/devenum/Makefile.in
@@ -1,5 +1,6 @@
 MODULE    = devenum.dll
 IMPORTS   = strmiids uuid ole32 oleaut32 avicap32 winmm user32 advapi32
+DELAYIMPORTS = msvfw32
 
 C_SRCS = \
 	createdevenum.c \
diff --git a/dlls/devenum/createdevenum.c b/dlls/devenum/createdevenum.c
index baeb91e..11990d6 100644
--- a/dlls/devenum/createdevenum.c
+++ b/dlls/devenum/createdevenum.c
@@ -28,6 +28,7 @@
 
 #include "devenum_private.h"
 #include "vfw.h"
+#include "aviriff.h"
 
 #include "wine/debug.h"
 #include "wine/unicode.h"
@@ -598,6 +599,44 @@ static HRESULT DEVENUM_CreateAMCategoryKey(const CLSID * clsidCategory)
     return res;
 }
 
+static void register_vfw_codecs(void)
+{
+    WCHAR avico_clsid_str[CHARS_IN_GUID];
+    HKEY basekey, key;
+    ICINFO icinfo;
+    DWORD i, res;
+
+    static const WCHAR CLSIDW[] = {'C','L','S','I','D',0};
+    static const WCHAR FccHandlerW[] = {'F','c','c','H','a','n','d','l','e','r',0};
+    static const WCHAR FriendlyNameW[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0};
+
+    StringFromGUID2(&CLSID_AVICo, avico_clsid_str, sizeof(avico_clsid_str)/sizeof(WCHAR));
+
+    basekey = open_special_category_key(&CLSID_VideoCompressorCategory, TRUE);
+    if(!basekey) {
+        ERR("Could not create key\n");
+        return;
+    }
+
+    for(i=0; ICInfo(FCC('v','i','d','c'), i, &icinfo); i++) {
+        WCHAR fcc_str[5] = {LOBYTE(LOWORD(icinfo.fccHandler)), HIBYTE(LOWORD(icinfo.fccHandler)),
+                            LOBYTE(HIWORD(icinfo.fccHandler)), HIBYTE(HIWORD(icinfo.fccHandler))};
+
+        res = RegCreateKeyW(basekey, fcc_str, &key);
+        if(res != ERROR_SUCCESS)
+            continue;
+
+        RegSetValueExW(key, CLSIDW, 0, REG_SZ, (const BYTE*)avico_clsid_str, sizeof(avico_clsid_str));
+        RegSetValueExW(key, FccHandlerW, 0, REG_SZ, (const BYTE*)fcc_str, sizeof(fcc_str));
+        RegSetValueExW(key, FriendlyNameW, 0, REG_SZ, (const BYTE*)icinfo.szName, (strlenW(icinfo.szName)+1)*sizeof(WCHAR));
+        /* FIXME: Set ClassManagerFlags and FilterData values */
+
+        RegCloseKey(key);
+    }
+
+    RegCloseKey(basekey);
+}
+
 static HANDLE DEVENUM_populate_handle;
 static const WCHAR DEVENUM_populate_handle_nameW[] =
     {'_','_','W','I','N','E','_',
@@ -648,6 +687,8 @@ static HRESULT DEVENUM_CreateSpecialCategories(void)
         RegDeleteTreeW(basekey, path);
     if (SUCCEEDED(DEVENUM_GetCategoryKey(&CLSID_MidiRendererCategory, &basekey, path, MAX_PATH)))
         RegDeleteTreeW(basekey, path);
+    if (SUCCEEDED(DEVENUM_GetCategoryKey(&CLSID_VideoCompressorCategory, &basekey, path, MAX_PATH)))
+        RegDeleteTreeW(basekey, path);
 
     rf2.dwVersion = 2;
     rf2.dwMerit = MERIT_PREFERRED;
@@ -927,6 +968,9 @@ static HRESULT DEVENUM_CreateSpecialCategories(void)
 
     if (pMapper)
         IFilterMapper2_Release(pMapper);
+
+    register_vfw_codecs();
+
     SetEvent(DEVENUM_populate_handle);
     return res;
 }




More information about the wine-cvs mailing list