2004-12-20 22:09:31 +00:00
|
|
|
/*
|
|
|
|
* exported dll functions for devenum.dll
|
|
|
|
*
|
|
|
|
* Copyright (C) 2002 John K. Hohm
|
|
|
|
* Copyright (C) 2002 Robert Shearman
|
|
|
|
*
|
|
|
|
* 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
|
Sync devenum, atl, comctl32, comdlg32, cryptdlg, cryptui, hhctrl, itss, jscript, mapi32, msacm32, mshtml, msi, msimtf, oleacc, pstorec, shdoclc, shdocvw, shlwapi, snmpapi, urlmon, usp10, uxtheme, windowscodecs, wldap32, wtsapi32, wuapi, xinput1_3
svn path=/trunk/; revision=47961
2010-07-06 23:29:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2004-12-20 22:09:31 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "devenum_private.h"
|
2018-03-08 12:30:52 +00:00
|
|
|
#include "rpcproxy.h"
|
|
|
|
#include "wine/debug.h"
|
2014-01-20 11:22:40 +00:00
|
|
|
|
2018-03-08 12:30:52 +00:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(devenum);
|
2004-12-20 22:09:31 +00:00
|
|
|
|
2013-10-01 22:07:54 +00:00
|
|
|
DECLSPEC_HIDDEN LONG dll_refs;
|
|
|
|
DECLSPEC_HIDDEN HINSTANCE DEVENUM_hInstance;
|
2004-12-20 22:09:31 +00:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
REFCLSID clsid;
|
|
|
|
LPCWSTR friendly_name;
|
|
|
|
BOOL instance;
|
|
|
|
} register_info;
|
|
|
|
|
2014-09-26 08:56:44 +00:00
|
|
|
#ifdef __REACTOS__
|
2004-12-20 22:09:31 +00:00
|
|
|
static void DEVENUM_RegisterQuartz(void);
|
2014-09-26 08:56:44 +00:00
|
|
|
#endif
|
2004-12-20 22:09:31 +00:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* Global string constant definitions
|
|
|
|
*/
|
|
|
|
const WCHAR clsid_keyname[6] = { 'C', 'L', 'S', 'I', 'D', 0 };
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DllEntryPoint
|
|
|
|
*/
|
|
|
|
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
|
|
|
|
{
|
Sync devenum, atl, comctl32, comdlg32, cryptdlg, cryptui, hhctrl, itss, jscript, mapi32, msacm32, mshtml, msi, msimtf, oleacc, pstorec, shdoclc, shdocvw, shlwapi, snmpapi, urlmon, usp10, uxtheme, windowscodecs, wldap32, wtsapi32, wuapi, xinput1_3
svn path=/trunk/; revision=47961
2010-07-06 23:29:26 +00:00
|
|
|
TRACE("%p 0x%x %p\n", hinstDLL, fdwReason, fImpLoad);
|
2004-12-20 22:09:31 +00:00
|
|
|
|
|
|
|
switch(fdwReason) {
|
|
|
|
case DLL_PROCESS_ATTACH:
|
|
|
|
DEVENUM_hInstance = hinstDLL;
|
|
|
|
DisableThreadLibraryCalls(hinstDLL);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DllGetClassObject (DEVENUM.@)
|
|
|
|
*/
|
Sync devenum, atl, comctl32, comdlg32, cryptdlg, cryptui, hhctrl, itss, jscript, mapi32, msacm32, mshtml, msi, msimtf, oleacc, pstorec, shdoclc, shdocvw, shlwapi, snmpapi, urlmon, usp10, uxtheme, windowscodecs, wldap32, wtsapi32, wuapi, xinput1_3
svn path=/trunk/; revision=47961
2010-07-06 23:29:26 +00:00
|
|
|
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
|
2004-12-20 22:09:31 +00:00
|
|
|
{
|
|
|
|
TRACE("(%s, %s, %p)\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
|
|
|
|
|
|
|
|
*ppv = NULL;
|
|
|
|
|
|
|
|
/* FIXME: we should really have two class factories.
|
|
|
|
* Oh well - works just fine as it is */
|
|
|
|
if (IsEqualGUID(rclsid, &CLSID_SystemDeviceEnum) ||
|
|
|
|
IsEqualGUID(rclsid, &CLSID_CDeviceMoniker))
|
2013-10-01 22:07:54 +00:00
|
|
|
return IClassFactory_QueryInterface(&DEVENUM_ClassFactory.IClassFactory_iface, iid, ppv);
|
2004-12-20 22:09:31 +00:00
|
|
|
|
Sync devenum, atl, comctl32, comdlg32, cryptdlg, cryptui, hhctrl, itss, jscript, mapi32, msacm32, mshtml, msi, msimtf, oleacc, pstorec, shdoclc, shdocvw, shlwapi, snmpapi, urlmon, usp10, uxtheme, windowscodecs, wldap32, wtsapi32, wuapi, xinput1_3
svn path=/trunk/; revision=47961
2010-07-06 23:29:26 +00:00
|
|
|
FIXME("CLSID: %s, IID: %s\n", debugstr_guid(rclsid), debugstr_guid(iid));
|
2004-12-20 22:09:31 +00:00
|
|
|
return CLASS_E_CLASSNOTAVAILABLE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DllCanUnloadNow (DEVENUM.@)
|
|
|
|
*/
|
Sync devenum, atl, comctl32, comdlg32, cryptdlg, cryptui, hhctrl, itss, jscript, mapi32, msacm32, mshtml, msi, msimtf, oleacc, pstorec, shdoclc, shdocvw, shlwapi, snmpapi, urlmon, usp10, uxtheme, windowscodecs, wldap32, wtsapi32, wuapi, xinput1_3
svn path=/trunk/; revision=47961
2010-07-06 23:29:26 +00:00
|
|
|
HRESULT WINAPI DllCanUnloadNow(void)
|
2004-12-20 22:09:31 +00:00
|
|
|
{
|
|
|
|
return dll_refs != 0 ? S_FALSE : S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DllRegisterServer (DEVENUM.@)
|
|
|
|
*/
|
Sync devenum, atl, comctl32, comdlg32, cryptdlg, cryptui, hhctrl, itss, jscript, mapi32, msacm32, mshtml, msi, msimtf, oleacc, pstorec, shdoclc, shdocvw, shlwapi, snmpapi, urlmon, usp10, uxtheme, windowscodecs, wldap32, wtsapi32, wuapi, xinput1_3
svn path=/trunk/; revision=47961
2010-07-06 23:29:26 +00:00
|
|
|
HRESULT WINAPI DllRegisterServer(void)
|
2004-12-20 22:09:31 +00:00
|
|
|
{
|
|
|
|
HRESULT res;
|
|
|
|
IFilterMapper2 * pMapper = NULL;
|
|
|
|
LPVOID mapvptr;
|
|
|
|
|
|
|
|
TRACE("\n");
|
|
|
|
|
2013-10-01 22:07:54 +00:00
|
|
|
res = __wine_register_resources( DEVENUM_hInstance );
|
2016-07-02 15:24:22 +00:00
|
|
|
if (FAILED(res))
|
|
|
|
return res;
|
2004-12-20 22:09:31 +00:00
|
|
|
|
2014-09-26 08:56:44 +00:00
|
|
|
#ifdef __REACTOS__
|
2004-12-20 22:09:31 +00:00
|
|
|
/* Quartz is needed for IFilterMapper2 */
|
|
|
|
DEVENUM_RegisterQuartz();
|
2014-09-26 08:56:44 +00:00
|
|
|
#endif
|
2004-12-20 22:09:31 +00:00
|
|
|
|
|
|
|
/*** ActiveMovieFilter Categories ***/
|
|
|
|
|
|
|
|
CoInitialize(NULL);
|
Sync devenum, atl, comctl32, comdlg32, cryptdlg, cryptui, hhctrl, itss, jscript, mapi32, msacm32, mshtml, msi, msimtf, oleacc, pstorec, shdoclc, shdocvw, shlwapi, snmpapi, urlmon, usp10, uxtheme, windowscodecs, wldap32, wtsapi32, wuapi, xinput1_3
svn path=/trunk/; revision=47961
2010-07-06 23:29:26 +00:00
|
|
|
|
2004-12-20 22:09:31 +00:00
|
|
|
res = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC,
|
|
|
|
&IID_IFilterMapper2, &mapvptr);
|
|
|
|
if (SUCCEEDED(res))
|
|
|
|
{
|
|
|
|
static const WCHAR friendlyvidcap[] = {'V','i','d','e','o',' ','C','a','p','t','u','r','e',' ','S','o','u','r','c','e','s',0};
|
|
|
|
static const WCHAR friendlydshow[] = {'D','i','r','e','c','t','S','h','o','w',' ','F','i','l','t','e','r','s',0};
|
|
|
|
static const WCHAR friendlyvidcomp[] = {'V','i','d','e','o',' ','C','o','m','p','r','e','s','s','o','r','s',0};
|
|
|
|
static const WCHAR friendlyaudcap[] = {'A','u','d','i','o',' ','C','a','p','t','u','r','e',' ','S','o','u','r','c','e','s',0};
|
|
|
|
static const WCHAR friendlyaudcomp[] = {'A','u','d','i','o',' ','C','o','m','p','r','e','s','s','o','r','s',0};
|
|
|
|
static const WCHAR friendlyaudrend[] = {'A','u','d','i','o',' ','R','e','n','d','e','r','e','r','s',0};
|
|
|
|
static const WCHAR friendlymidirend[] = {'M','i','d','i',' ','R','e','n','d','e','r','e','r','s',0};
|
|
|
|
static const WCHAR friendlyextrend[] = {'E','x','t','e','r','n','a','l',' ','R','e','n','d','e','r','e','r','s',0};
|
|
|
|
static const WCHAR friendlydevctrl[] = {'D','e','v','i','c','e',' ','C','o','n','t','r','o','l',' ','F','i','l','t','e','r','s',0};
|
|
|
|
|
Sync devenum, atl, comctl32, comdlg32, cryptdlg, cryptui, hhctrl, itss, jscript, mapi32, msacm32, mshtml, msi, msimtf, oleacc, pstorec, shdoclc, shdocvw, shlwapi, snmpapi, urlmon, usp10, uxtheme, windowscodecs, wldap32, wtsapi32, wuapi, xinput1_3
svn path=/trunk/; revision=47961
2010-07-06 23:29:26 +00:00
|
|
|
pMapper = mapvptr;
|
2004-12-20 22:09:31 +00:00
|
|
|
|
|
|
|
IFilterMapper2_CreateCategory(pMapper, &CLSID_VideoInputDeviceCategory, MERIT_DO_NOT_USE, friendlyvidcap);
|
|
|
|
IFilterMapper2_CreateCategory(pMapper, &CLSID_LegacyAmFilterCategory, MERIT_NORMAL, friendlydshow);
|
|
|
|
IFilterMapper2_CreateCategory(pMapper, &CLSID_VideoCompressorCategory, MERIT_DO_NOT_USE, friendlyvidcomp);
|
|
|
|
IFilterMapper2_CreateCategory(pMapper, &CLSID_AudioInputDeviceCategory, MERIT_DO_NOT_USE, friendlyaudcap);
|
|
|
|
IFilterMapper2_CreateCategory(pMapper, &CLSID_AudioCompressorCategory, MERIT_DO_NOT_USE, friendlyaudcomp);
|
|
|
|
IFilterMapper2_CreateCategory(pMapper, &CLSID_AudioRendererCategory, MERIT_NORMAL, friendlyaudrend);
|
|
|
|
IFilterMapper2_CreateCategory(pMapper, &CLSID_MidiRendererCategory, MERIT_NORMAL, friendlymidirend);
|
|
|
|
IFilterMapper2_CreateCategory(pMapper, &CLSID_TransmitCategory, MERIT_DO_NOT_USE, friendlyextrend);
|
|
|
|
IFilterMapper2_CreateCategory(pMapper, &CLSID_DeviceControlCategory, MERIT_DO_NOT_USE, friendlydevctrl);
|
|
|
|
|
|
|
|
IFilterMapper2_Release(pMapper);
|
|
|
|
}
|
|
|
|
|
|
|
|
CoUninitialize();
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DllUnregisterServer (DEVENUM.@)
|
|
|
|
*/
|
Sync devenum, atl, comctl32, comdlg32, cryptdlg, cryptui, hhctrl, itss, jscript, mapi32, msacm32, mshtml, msi, msimtf, oleacc, pstorec, shdoclc, shdocvw, shlwapi, snmpapi, urlmon, usp10, uxtheme, windowscodecs, wldap32, wtsapi32, wuapi, xinput1_3
svn path=/trunk/; revision=47961
2010-07-06 23:29:26 +00:00
|
|
|
HRESULT WINAPI DllUnregisterServer(void)
|
2004-12-20 22:09:31 +00:00
|
|
|
{
|
2013-10-01 22:07:54 +00:00
|
|
|
FIXME("stub!\n");
|
|
|
|
return __wine_unregister_resources( DEVENUM_hInstance );
|
2004-12-20 22:09:31 +00:00
|
|
|
}
|
|
|
|
|
2014-09-26 08:56:44 +00:00
|
|
|
#ifdef __REACTOS__
|
|
|
|
|
2004-12-20 22:09:31 +00:00
|
|
|
typedef HRESULT (WINAPI *DllRegisterServer_func)(void);
|
|
|
|
|
|
|
|
/* calls DllRegisterServer() for the Quartz DLL */
|
Sync devenum, atl, comctl32, comdlg32, cryptdlg, cryptui, hhctrl, itss, jscript, mapi32, msacm32, mshtml, msi, msimtf, oleacc, pstorec, shdoclc, shdocvw, shlwapi, snmpapi, urlmon, usp10, uxtheme, windowscodecs, wldap32, wtsapi32, wuapi, xinput1_3
svn path=/trunk/; revision=47961
2010-07-06 23:29:26 +00:00
|
|
|
static void DEVENUM_RegisterQuartz(void)
|
2004-12-20 22:09:31 +00:00
|
|
|
{
|
|
|
|
HANDLE hDLL = LoadLibraryA("quartz.dll");
|
|
|
|
DllRegisterServer_func pDllRegisterServer = NULL;
|
|
|
|
if (hDLL)
|
|
|
|
pDllRegisterServer = (DllRegisterServer_func)GetProcAddress(hDLL, "DllRegisterServer");
|
|
|
|
if (pDllRegisterServer)
|
|
|
|
{
|
|
|
|
HRESULT hr = pDllRegisterServer();
|
|
|
|
if (FAILED(hr))
|
Sync devenum, atl, comctl32, comdlg32, cryptdlg, cryptui, hhctrl, itss, jscript, mapi32, msacm32, mshtml, msi, msimtf, oleacc, pstorec, shdoclc, shdocvw, shlwapi, snmpapi, urlmon, usp10, uxtheme, windowscodecs, wldap32, wtsapi32, wuapi, xinput1_3
svn path=/trunk/; revision=47961
2010-07-06 23:29:26 +00:00
|
|
|
ERR("Failed to register Quartz. Error was 0x%x)\n", hr);
|
2004-12-20 22:09:31 +00:00
|
|
|
}
|
|
|
|
}
|
2014-09-26 08:56:44 +00:00
|
|
|
|
|
|
|
#endif
|