ReactOS 0.4.15-dev-7681-g776c3a3
devenum_main.c File Reference
#include "devenum_private.h"
#include "rpcproxy.h"
#include "wine/debug.h"
Include dependency graph for devenum_main.c:

Go to the source code of this file.

Classes

struct  class_factory
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (devenum)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
 
static struct class_factoryimpl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI ClassFactory_QueryInterface (IClassFactory *iface, REFIID iid, void **obj)
 
static ULONG WINAPI ClassFactory_AddRef (IClassFactory *iface)
 
static ULONG WINAPI ClassFactory_Release (IClassFactory *iface)
 
static HRESULT WINAPI ClassFactory_CreateInstance (IClassFactory *iface, IUnknown *outer, REFIID iid, void **obj)
 
static HRESULT WINAPI ClassFactory_LockServer (IClassFactory *iface, BOOL lock)
 
HRESULT WINAPI DllGetClassObject (REFCLSID clsid, REFIID iid, void **obj)
 
HRESULT WINAPI DllCanUnloadNow (void)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 

Variables

DECLSPEC_HIDDEN LONG dll_refs
 
static HINSTANCE devenum_instance
 
static const IClassFactoryVtbl ClassFactory_vtbl
 
static struct class_factory create_devenum_cf = { { &ClassFactory_vtbl }, (IUnknown *)&DEVENUM_CreateDevEnum }
 
static struct class_factory device_moniker_cf = { { &ClassFactory_vtbl }, (IUnknown *)&DEVENUM_ParseDisplayName }
 

Function Documentation

◆ ClassFactory_AddRef()

static ULONG WINAPI ClassFactory_AddRef ( IClassFactory iface)
static

Definition at line 78 of file devenum_main.c.

79{
81 return 2;
82}
static void DEVENUM_LockModule(void)

◆ ClassFactory_CreateInstance()

static HRESULT WINAPI ClassFactory_CreateInstance ( IClassFactory iface,
IUnknown outer,
REFIID  iid,
void **  obj 
)
static

Definition at line 90 of file devenum_main.c.

92{
94
95 TRACE("(%p, %s, %p)\n", outer, debugstr_guid(iid), obj);
96
97 if (!obj) return E_POINTER;
98
99 if (outer) return CLASS_E_NOAGGREGATION;
100
101 return IUnknown_QueryInterface(This->obj, iid, obj);
102}
static struct class_factory * impl_from_IClassFactory(IClassFactory *iface)
Definition: devenum_main.c:57
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define E_POINTER
Definition: winerror.h:2365

◆ ClassFactory_LockServer()

static HRESULT WINAPI ClassFactory_LockServer ( IClassFactory iface,
BOOL  lock 
)
static

Definition at line 104 of file devenum_main.c.

105{
106 if (lock)
108 else
110 return S_OK;
111}
static void DEVENUM_UnlockModule(void)
#define S_OK
Definition: intsafe.h:52
rwlock_t lock
Definition: tcpcore.h:0

◆ ClassFactory_QueryInterface()

static HRESULT WINAPI ClassFactory_QueryInterface ( IClassFactory iface,
REFIID  iid,
void **  obj 
)
static

Definition at line 62 of file devenum_main.c.

63{
64 TRACE("(%p, %s, %p)\n", iface, debugstr_guid(iid), obj);
65
67 {
68 IClassFactory_AddRef(iface);
69 *obj = iface;
70 return S_OK;
71 }
72
73 *obj = NULL;
74 WARN("no interface for %s\n", debugstr_guid(iid));
75 return E_NOINTERFACE;
76}
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define WARN(fmt,...)
Definition: debug.h:112
#define NULL
Definition: types.h:112
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ ClassFactory_Release()

static ULONG WINAPI ClassFactory_Release ( IClassFactory iface)
static

Definition at line 84 of file devenum_main.c.

85{
87 return 1;
88}

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 145 of file devenum_main.c.

146{
147 return dll_refs != 0 ? S_FALSE : S_OK;
148}
DECLSPEC_HIDDEN LONG dll_refs
Definition: devenum_main.c:28
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

HRESULT WINAPI DllGetClassObject ( REFCLSID  clsid,
REFIID  iid,
void **  obj 
)

Definition at line 127 of file devenum_main.c.

128{
129 TRACE("(%s, %s, %p)\n", debugstr_guid(clsid), debugstr_guid(iid), obj);
130
131 *obj = NULL;
132
133 if (IsEqualGUID(clsid, &CLSID_SystemDeviceEnum))
134 return IClassFactory_QueryInterface(&create_devenum_cf.IClassFactory_iface, iid, obj);
135 else if (IsEqualGUID(clsid, &CLSID_CDeviceMoniker))
136 return IClassFactory_QueryInterface(&device_moniker_cf.IClassFactory_iface, iid, obj);
137
138 FIXME("class %s not available\n", debugstr_guid(clsid));
140}
#define FIXME(fmt,...)
Definition: debug.h:111
static struct class_factory create_devenum_cf
Definition: devenum_main.c:121
static struct class_factory device_moniker_cf
Definition: devenum_main.c:122
REFCLSID clsid
Definition: msctf.c:82
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  fdwReason,
LPVOID  fImpLoad 
)

Definition at line 38 of file devenum_main.c.

39{
40 TRACE("%p 0x%x %p\n", hinstDLL, fdwReason, fImpLoad);
41
42 switch(fdwReason) {
44 devenum_instance = hinstDLL;
46 break;
47 }
48 return TRUE;
49}
DWORD LPVOID fImpLoad
Definition: misc.cpp:155
static HINSTANCE devenum_instance
Definition: devenum_main.c:29
#define TRUE
Definition: types.h:120
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 153 of file devenum_main.c.

154{
155 HRESULT res;
156 IFilterMapper2 * pMapper = NULL;
157 LPVOID mapvptr;
158
159 TRACE("\n");
160
162 if (FAILED(res))
163 return res;
164
165#ifdef __REACTOS__
166 /* Quartz is needed for IFilterMapper2 */
167 DEVENUM_RegisterQuartz();
168#endif
169
170/*** ActiveMovieFilter Categories ***/
171
173
174 res = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC,
175 &IID_IFilterMapper2, &mapvptr);
176 if (SUCCEEDED(res))
177 {
178 static const WCHAR friendlyvidcap[] = {'V','i','d','e','o',' ','C','a','p','t','u','r','e',' ','S','o','u','r','c','e','s',0};
179 static const WCHAR friendlydshow[] = {'D','i','r','e','c','t','S','h','o','w',' ','F','i','l','t','e','r','s',0};
180 static const WCHAR friendlyvidcomp[] = {'V','i','d','e','o',' ','C','o','m','p','r','e','s','s','o','r','s',0};
181 static const WCHAR friendlyaudcap[] = {'A','u','d','i','o',' ','C','a','p','t','u','r','e',' ','S','o','u','r','c','e','s',0};
182 static const WCHAR friendlyaudcomp[] = {'A','u','d','i','o',' ','C','o','m','p','r','e','s','s','o','r','s',0};
183 static const WCHAR friendlyaudrend[] = {'A','u','d','i','o',' ','R','e','n','d','e','r','e','r','s',0};
184 static const WCHAR friendlymidirend[] = {'M','i','d','i',' ','R','e','n','d','e','r','e','r','s',0};
185 static const WCHAR friendlyextrend[] = {'E','x','t','e','r','n','a','l',' ','R','e','n','d','e','r','e','r','s',0};
186 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};
187
188 pMapper = mapvptr;
189
190 IFilterMapper2_CreateCategory(pMapper, &CLSID_VideoInputDeviceCategory, MERIT_DO_NOT_USE, friendlyvidcap);
191 IFilterMapper2_CreateCategory(pMapper, &CLSID_LegacyAmFilterCategory, MERIT_NORMAL, friendlydshow);
192 IFilterMapper2_CreateCategory(pMapper, &CLSID_VideoCompressorCategory, MERIT_DO_NOT_USE, friendlyvidcomp);
193 IFilterMapper2_CreateCategory(pMapper, &CLSID_AudioInputDeviceCategory, MERIT_DO_NOT_USE, friendlyaudcap);
194 IFilterMapper2_CreateCategory(pMapper, &CLSID_AudioCompressorCategory, MERIT_DO_NOT_USE, friendlyaudcomp);
195 IFilterMapper2_CreateCategory(pMapper, &CLSID_AudioRendererCategory, MERIT_NORMAL, friendlyaudrend);
196 IFilterMapper2_CreateCategory(pMapper, &CLSID_MidiRendererCategory, MERIT_NORMAL, friendlymidirend);
197 IFilterMapper2_CreateCategory(pMapper, &CLSID_TransmitCategory, MERIT_DO_NOT_USE, friendlyextrend);
198 IFilterMapper2_CreateCategory(pMapper, &CLSID_DeviceControlCategory, MERIT_DO_NOT_USE, friendlydevctrl);
199
200 IFilterMapper2_Release(pMapper);
201 }
202
204
205 return res;
206}
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
#define MERIT_DO_NOT_USE
Definition: precomp.h:18
GLuint res
Definition: glext.h:9613
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 211 of file devenum_main.c.

212{
213 FIXME("stub!\n");
215}
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110

◆ impl_from_IClassFactory()

static struct class_factory * impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 57 of file devenum_main.c.

58{
59 return CONTAINING_RECORD( iface, struct class_factory, IClassFactory_iface );
60}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by ClassFactory_CreateInstance().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( devenum  )

Variable Documentation

◆ ClassFactory_vtbl

const IClassFactoryVtbl ClassFactory_vtbl
static
Initial value:
= {
}
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
Definition: devenum_main.c:84
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
Definition: devenum_main.c:78
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL lock)
Definition: devenum_main.c:104
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID iid, void **obj)
Definition: devenum_main.c:62
static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID iid, void **obj)
Definition: devenum_main.c:90

Definition at line 113 of file devenum_main.c.

◆ create_devenum_cf

struct class_factory create_devenum_cf = { { &ClassFactory_vtbl }, (IUnknown *)&DEVENUM_CreateDevEnum }
static

Definition at line 121 of file devenum_main.c.

Referenced by DllGetClassObject().

◆ devenum_instance

HINSTANCE devenum_instance
static

Definition at line 29 of file devenum_main.c.

Referenced by DllMain(), DllRegisterServer(), and DllUnregisterServer().

◆ device_moniker_cf

struct class_factory device_moniker_cf = { { &ClassFactory_vtbl }, (IUnknown *)&DEVENUM_ParseDisplayName }
static

Definition at line 122 of file devenum_main.c.

Referenced by DllGetClassObject().

◆ dll_refs