ReactOS 0.4.17-dev-966-gf06eace
devenum_main.c
Go to the documentation of this file.
1/*
2 * Device Enumeration
3 *
4 * Copyright (C) 2002 John K. Hohm
5 * Copyright (C) 2002 Robert Shearman
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22#include "devenum_private.h"
23#include "rpcproxy.h"
24#include "wine/debug.h"
25
27
29{
32};
33
35{
37}
38
40{
41 TRACE("(%p, %s, %p)\n", iface, debugstr_guid(iid), obj);
42
44 {
45 IClassFactory_AddRef(iface);
46 *obj = iface;
47 return S_OK;
48 }
49
50 *obj = NULL;
51 WARN("no interface for %s\n", debugstr_guid(iid));
52 return E_NOINTERFACE;
53}
54
56{
57 return 2;
58}
59
61{
62 return 1;
63}
64
66 IUnknown *outer, REFIID iid, void **obj)
67{
69
70 TRACE("(%p, %s, %p)\n", outer, debugstr_guid(iid), obj);
71
72 if (!obj) return E_POINTER;
73
74 if (outer) return CLASS_E_NOAGGREGATION;
75
76 return IUnknown_QueryInterface(This->obj, iid, obj);
77}
78
80{
81 TRACE("iface %p, lock %d.\n", iface, lock);
82 return S_OK;
83}
84
85static const IClassFactoryVtbl ClassFactory_vtbl = {
91};
92
95
96/***********************************************************************
97 * DllGetClassObject (DEVENUM.@)
98 */
100{
101 TRACE("(%s, %s, %p)\n", debugstr_guid(clsid), debugstr_guid(iid), obj);
102
103 *obj = NULL;
104
105 if (IsEqualGUID(clsid, &CLSID_SystemDeviceEnum))
106 return IClassFactory_QueryInterface(&create_devenum_cf.IClassFactory_iface, iid, obj);
107 else if (IsEqualGUID(clsid, &CLSID_CDeviceMoniker))
108 return IClassFactory_QueryInterface(&device_moniker_cf.IClassFactory_iface, iid, obj);
109
110 FIXME("class %s not available\n", debugstr_guid(clsid));
112}
113
114/***********************************************************************
115 * DllRegisterServer (DEVENUM.@)
116 */
118{
119 HRESULT res;
120 IFilterMapper2 * pMapper = NULL;
121 LPVOID mapvptr;
122
123 TRACE("\n");
124
126 if (FAILED(res))
127 return res;
128
129 res = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC,
130 &IID_IFilterMapper2, &mapvptr);
131 if (SUCCEEDED(res))
132 {
133 pMapper = mapvptr;
134
135 IFilterMapper2_CreateCategory(pMapper, &CLSID_AudioCompressorCategory, MERIT_DO_NOT_USE, L"Audio Compressors");
136 IFilterMapper2_CreateCategory(pMapper, &CLSID_AudioInputDeviceCategory, MERIT_DO_NOT_USE, L"Audio Capture Sources");
137 IFilterMapper2_CreateCategory(pMapper, &CLSID_AudioRendererCategory, MERIT_NORMAL, L"Audio Renderers");
138 IFilterMapper2_CreateCategory(pMapper, &CLSID_DeviceControlCategory, MERIT_DO_NOT_USE, L"Device Control Filters");
139 IFilterMapper2_CreateCategory(pMapper, &CLSID_LegacyAmFilterCategory, MERIT_NORMAL, L"DirectShow Filters");
140 IFilterMapper2_CreateCategory(pMapper, &CLSID_MidiRendererCategory, MERIT_NORMAL, L"Midi Renderers");
141 IFilterMapper2_CreateCategory(pMapper, &CLSID_TransmitCategory, MERIT_DO_NOT_USE, L"External Renderers");
142 IFilterMapper2_CreateCategory(pMapper, &CLSID_VideoInputDeviceCategory, MERIT_DO_NOT_USE, L"Video Capture Sources");
143 IFilterMapper2_CreateCategory(pMapper, &CLSID_VideoCompressorCategory, MERIT_DO_NOT_USE, L"Video Compressors");
144
145 IFilterMapper2_Release(pMapper);
146 }
147
148 return res;
149}
150
151/***********************************************************************
152 * DllUnregisterServer (DEVENUM.@)
153 */
155{
156 FIXME("stub!\n");
158}
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
HRESULT __wine_unregister_resources(HMODULE module)
Definition: register.c:124
HRESULT __wine_register_resources(HMODULE module)
Definition: register.c:112
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
const GUID IID_IClassFactory
ICreateDevEnum devenum_factory
HRESULT WINAPI DllRegisterServer(void)
Definition: devenum_main.c:117
static const IClassFactoryVtbl ClassFactory_vtbl
Definition: devenum_main.c:85
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
Definition: devenum_main.c:60
HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **obj)
Definition: devenum_main.c:99
static struct class_factory create_devenum_cf
Definition: devenum_main.c:93
HRESULT WINAPI DllUnregisterServer(void)
Definition: devenum_main.c:154
static struct class_factory device_moniker_cf
Definition: devenum_main.c:94
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
Definition: devenum_main.c:55
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL lock)
Definition: devenum_main.c:79
static struct class_factory * impl_from_IClassFactory(IClassFactory *iface)
Definition: devenum_main.c:34
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID iid, void **obj)
Definition: devenum_main.c:39
static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID iid, void **obj)
Definition: devenum_main.c:65
IParseDisplayName devenum_parser
#define NULL
Definition: types.h:112
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
Definition: combase.c:1685
#define L(x)
Definition: resources.c:13
#define MERIT_DO_NOT_USE
Definition: precomp.h:18
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint res
Definition: glext.h:9613
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
static IUnknown * outer
Definition: compobj.c:82
const CLSID * clsid
Definition: msctf.cpp:50
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
#define TRACE(s)
Definition: solgame.cpp:4
IUnknown * obj
Definition: devenum_main.c:31
IClassFactory IClassFactory_iface
Definition: devenum_main.c:30
rwlock_t lock
Definition: tcpcore.h:0
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:3479
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:3771
#define E_POINTER
Definition: winerror.h:3480
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:3772