diff --git a/dlls/devenum/Makefile.in b/dlls/devenum/Makefile.in index 8c24da0c0dd..9ac67f36897 100644 --- a/dlls/devenum/Makefile.in +++ b/dlls/devenum/Makefile.in @@ -8,6 +8,8 @@ C_SRCS = \ mediacatenum.c \ parsedisplayname.c +IDL_R_SRCS = devenum_classes.idl + RC_SRCS = \ Cs.rc \ Cy.rc \ diff --git a/dlls/devenum/devenum_classes.idl b/dlls/devenum/devenum_classes.idl new file mode 100644 index 00000000000..872291026e8 --- /dev/null +++ b/dlls/devenum/devenum_classes.idl @@ -0,0 +1,90 @@ +/* + * COM Classes for devenum + * + * Copyright 2010 Alexandre Julliard + * + * 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 + */ + +[ + helpstring("System Device Enum"), + threading(both), + uuid(62be5d10-60eb-11d0-bd3b-00a0c911ce86) +] +coclass SystemDeviceEnum { interface ICreateDevEnum; } + +[ + threading(both), + progid("device.1"), + vi_progid("device"), + uuid(4315d437-5b8c-11d0-bd3b-00a0c911ce86) +] +coclass DeviceMoniker { interface IParseDisplayName; } + +[ + helpstring("ACM Class Manager"), + threading(both), + uuid(33d9a761-90c8-11d0-bd43-00a0c911ce86) +] +coclass AudioCompressorCategory { } + +[ + helpstring("ICM Class Manager"), + threading(both), + uuid(33d9a760-90c8-11d0-bd43-00a0c911ce86) +] +coclass VideoCompressorCategory { } + +[ + helpstring("ActiveMovie Filter Class Manager"), + threading(both), + uuid(083863f1-70de-11d0-bd40-00a0c911ce86) +] +coclass LegacyAmFilterCategory { } + +[ + helpstring("VFW Capture Class Manager"), + threading(both), + uuid(860bb310-5d01-11d0-bd3b-00a0c911ce86) +] +coclass VideoInputDeviceCategory { } + +[ + helpstring("WaveIn Class Manager"), + threading(both), + uuid(33d9a762-90c8-11d0-bd43-00a0c911ce86) +] +coclass AudioInputDeviceCategory { } + +[ + helpstring("WaveOut and DSound Class Manager"), + threading(both), + uuid(e0f158e1-cb04-11d0-bd4e-00a0c911ce86) +] +coclass AudioRendererCategory { } + +[ + helpstring("MidiOut Class Manager"), + threading(both), + uuid(4efe2452-168a-11d1-bc76-00c04fb9453b) +] +coclass MidiRendererCategory { } + +[ + helpstring("ActiveMovie Filter Categories"), + threading(both), + uuid(da4e3da0-d07d-11d0-bd50-00a0c911ce86) +] +coclass ActiveMovieCategories { } diff --git a/dlls/devenum/devenum_main.c b/dlls/devenum/devenum_main.c index 32caa7e2490..57805bce33f 100644 --- a/dlls/devenum/devenum_main.c +++ b/dlls/devenum/devenum_main.c @@ -20,8 +20,8 @@ */ #include "devenum_private.h" +#include "rpcproxy.h" #include "wine/debug.h" -#include "winreg.h" WINE_DEFAULT_DEBUG_CHANNEL(devenum); @@ -35,7 +35,6 @@ typedef struct BOOL instance; } register_info; -static HRESULT register_clsids(int count, const register_info * pRegInfo, LPCWSTR pszThreadingModel); static void DEVENUM_RegisterQuartz(void); /*********************************************************************** @@ -96,42 +95,12 @@ HRESULT WINAPI DllCanUnloadNow(void) HRESULT WINAPI DllRegisterServer(void) { HRESULT res; - HKEY hkeyClsid = NULL; - HKEY hkey1 = NULL; - HKEY hkey2 = NULL; - LPOLESTR pszClsidDevMon = NULL; IFilterMapper2 * pMapper = NULL; LPVOID mapvptr; - static const WCHAR threadingModel[] = {'B','o','t','h',0}; - static const WCHAR sysdevenum[] = {'S','y','s','t','e','m',' ','D','e','v','i','c','e',' ','E','n','u','m',0}; - static const WCHAR devmon[] = {'D','e','v','i','c','e','M','o','n','i','k','e','r',0}; - static const WCHAR acmcat[] = {'A','C','M',' ','C','l','a','s','s',' ','M','a','n','a','g','e','r',0}; - static const WCHAR vidcat[] = {'I','C','M',' ','C','l','a','s','s',' ','M','a','n','a','g','e','r',0}; - static const WCHAR filtcat[] = {'A','c','t','i','v','e','M','o','v','i','e',' ','F','i','l','t','e','r',' ','C','l','a','s','s',' ','M','a','n','a','g','e','r',0}; - static const WCHAR vfwcat[] = {'V','F','W',' ','C','a','p','t','u','r','e',' ','C','l','a','s','s',' ','M','a','n','a','g','e','r',0}; - static const WCHAR wavein[] = {'W','a','v','e','I','n',' ','C','l','a','s','s',' ','M','a','n','a','g','e','r', 0}; - static const WCHAR waveout[] = {'W','a','v','e','O','u','t',' ','a','n','d',' ','D','S','o','u','n','d',' ','C','l','a','s','s',' ','M','a','n','a','g','e','r',0}; - static const WCHAR midiout[] = {'M','i','d','i','O','u','t',' ','C','l','a','s','s',' ','M','a','n','a','g','e','r',0}; - static const WCHAR amcat[] = {'A','c','t','i','v','e','M','o','v','i','e',' ','F','i','l','t','e','r',' ','C','a','t','e','g','o','r','i','e','s',0}; - static const WCHAR device[] = {'d','e','v','i','c','e',0}; - static const WCHAR device_1[] = {'d','e','v','i','c','e','.','1',0}; - static const register_info ri[] = - { - {&CLSID_SystemDeviceEnum, sysdevenum, FALSE}, - {&CLSID_CDeviceMoniker, devmon, FALSE}, - {&CLSID_AudioCompressorCategory, acmcat, TRUE}, - {&CLSID_VideoCompressorCategory, vidcat, TRUE}, - {&CLSID_LegacyAmFilterCategory, filtcat, TRUE}, - {&CLSID_VideoInputDeviceCategory, vfwcat, FALSE}, - {&CLSID_AudioInputDeviceCategory, wavein, FALSE}, - {&CLSID_AudioRendererCategory, waveout, FALSE}, - {&CLSID_MidiRendererCategory, midiout, FALSE}, - {&CLSID_ActiveMovieCategories, amcat, TRUE} - }; TRACE("\n"); - res = register_clsids(sizeof(ri) / sizeof(register_info), ri, threadingModel); + res = __wine_register_resources( DEVENUM_hInstance, NULL ); /* Quartz is needed for IFilterMapper2 */ DEVENUM_RegisterQuartz(); @@ -169,116 +138,6 @@ HRESULT WINAPI DllRegisterServer(void) IFilterMapper2_Release(pMapper); } -/*** CDeviceMoniker ***/ - if (SUCCEEDED(res)) - { - res = StringFromCLSID(&CLSID_CDeviceMoniker, &pszClsidDevMon); - } - if (SUCCEEDED(res)) - { - res = RegOpenKeyW(HKEY_CLASSES_ROOT, clsid_keyname, &hkeyClsid) - == ERROR_SUCCESS ? S_OK : E_FAIL; - } - if (SUCCEEDED(res)) - { - res = RegOpenKeyW(hkeyClsid, pszClsidDevMon, &hkey1) - == ERROR_SUCCESS ? S_OK : E_FAIL; - } - if (SUCCEEDED(res)) - { - static const WCHAR wszProgID[] = {'P','r','o','g','I','D',0}; - res = RegCreateKeyW(hkey1, wszProgID, &hkey2) - == ERROR_SUCCESS ? S_OK : E_FAIL; - } - if (SUCCEEDED(res)) - { - res = RegSetValueW(hkey2, NULL, REG_SZ, device_1, (lstrlenW(device_1) + 1) * sizeof(WCHAR)) - == ERROR_SUCCESS ? S_OK : E_FAIL; - } - - if (hkey2) - { - RegCloseKey(hkey2); - hkey2 = NULL; - } - - if (SUCCEEDED(res)) - { - static const WCHAR wszVProgID[] = {'V','e','r','s','i','o','n','I','n','d','e','p','e','d','e','n','t','P','r','o','g','I','D',0}; - res = RegCreateKeyW(hkey1, wszVProgID, &hkey2) - == ERROR_SUCCESS ? S_OK : E_FAIL; - } - if (SUCCEEDED(res)) - { - res = RegSetValueW(hkey2, NULL, REG_SZ, device, (lstrlenW(device) + 1) * sizeof(WCHAR)) - == ERROR_SUCCESS ? S_OK : E_FAIL; - } - - if (hkey2) - { - RegCloseKey(hkey2); - hkey2 = NULL; - } - - if (hkey1) - { - RegCloseKey(hkey1); - hkey1 = NULL; - } - - if (SUCCEEDED(res)) - { - res = RegCreateKeyW(HKEY_CLASSES_ROOT, device, &hkey1) - == ERROR_SUCCESS ? S_OK : E_FAIL; - } - if (SUCCEEDED(res)) - { - res = RegCreateKeyW(hkey1, clsid_keyname, &hkey2) - == ERROR_SUCCESS ? S_OK : E_FAIL; - } - if (SUCCEEDED(res)) - { - res = RegSetValueW(hkey2, NULL, REG_SZ, pszClsidDevMon, (lstrlenW(pszClsidDevMon) + 1) * sizeof(WCHAR)) - == ERROR_SUCCESS ? S_OK : E_FAIL; - } - if (hkey2) - { - RegCloseKey(hkey2); - hkey2 = NULL; - } - - if (hkey1) - { - RegCloseKey(hkey1); - hkey1 = NULL; - } - - if (SUCCEEDED(res)) - { - res = RegCreateKeyW(HKEY_CLASSES_ROOT, device_1, &hkey1) - == ERROR_SUCCESS ? S_OK : E_FAIL; - } - if (SUCCEEDED(res)) - { - res = RegCreateKeyW(hkey1, clsid_keyname, &hkey2) - == ERROR_SUCCESS ? S_OK : E_FAIL; - } - if (SUCCEEDED(res)) - { - res = RegSetValueW(hkey2, NULL, REG_SZ, pszClsidDevMon, (lstrlenW(pszClsidDevMon) + 1) * sizeof(WCHAR)) - == ERROR_SUCCESS ? S_OK : E_FAIL; - } - - if (hkey2) - RegCloseKey(hkey2); - - if (hkey1) - RegCloseKey(hkey1); - - if (hkeyClsid) - RegCloseKey(hkeyClsid); - - CoTaskMemFree(pszClsidDevMon); CoUninitialize(); return res; @@ -289,77 +148,8 @@ HRESULT WINAPI DllRegisterServer(void) */ HRESULT WINAPI DllUnregisterServer(void) { - FIXME("stub!\n"); - return E_FAIL; -} - -static HRESULT register_clsids(int count, const register_info * pRegInfo, LPCWSTR pszThreadingModel) -{ - HRESULT res = S_OK; - LPOLESTR clsidString = NULL; - HKEY hkeyClsid; - HKEY hkeySub; - HKEY hkeyInproc32; - HKEY hkeyInstance = NULL; - int i; - static const WCHAR wcszInproc32[] = {'I','n','p','r','o','c','S','e','r','v','e','r','3','2',0}; - static const WCHAR wcszThreadingModel[] = {'T','h','r','e','a','d','i','n','g','M','o','d','e','l',0}; - static const WCHAR dll_module[] = {'d','e','v','e','n','u','m','.','d','l','l',0}; - - res = RegOpenKeyW(HKEY_CLASSES_ROOT, clsid_keyname, &hkeyClsid) - == ERROR_SUCCESS ? S_OK : E_FAIL; - - for (i = 0; i < count; i++) - { - hkeySub = 0; - if (SUCCEEDED(res)) - { - res = StringFromCLSID(pRegInfo[i].clsid, &clsidString); - } - if (SUCCEEDED(res)) - { - res = RegCreateKeyW(hkeyClsid, clsidString, &hkeySub) - == ERROR_SUCCESS ? S_OK : E_FAIL; - } - if (pRegInfo[i].instance && SUCCEEDED(res)) - { - res = RegCreateKeyW(hkeySub, wszInstanceKeyName, &hkeyInstance) - == ERROR_SUCCESS ? S_OK : E_FAIL; - RegCloseKey(hkeyInstance); - } - if (SUCCEEDED(res)) - { - RegSetValueW(hkeySub, - NULL, - REG_SZ, - pRegInfo->friendly_name ? pRegInfo[i].friendly_name : clsidString, - (lstrlenW(pRegInfo[i].friendly_name ? pRegInfo->friendly_name : clsidString) + 1) * sizeof(WCHAR)); - res = RegCreateKeyW(hkeySub, wcszInproc32, &hkeyInproc32) - == ERROR_SUCCESS ? S_OK : E_FAIL; - } - if (SUCCEEDED(res)) - { - RegSetValueW(hkeyInproc32, - NULL, - REG_SZ, - dll_module, - (lstrlenW(dll_module) + 1) * sizeof(WCHAR)); - RegSetValueExW(hkeyInproc32, - wcszThreadingModel, - 0, - REG_SZ, - (LPCVOID)pszThreadingModel, - (lstrlenW(pszThreadingModel) + 1) * sizeof(WCHAR)); - RegCloseKey(hkeyInproc32); - } - if (hkeySub) RegCloseKey(hkeySub); - CoTaskMemFree(clsidString); - clsidString = NULL; - } - - RegCloseKey(hkeyClsid); - - return res; + FIXME("stub!\n"); + return __wine_unregister_resources( DEVENUM_hInstance, NULL ); } typedef HRESULT (WINAPI *DllRegisterServer_func)(void);