ReactOS  0.4.14-dev-854-gb9426a3
createdevenum.c File Reference
#include "devenum_private.h"
#include "vfw.h"
#include "aviriff.h"
#include "dsound.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "mmddk.h"
#include "initguid.h"
#include "wine/fil_data.h"
Include dependency graph for createdevenum.c:

Go to the source code of this file.

Macros

#define NONAMELESSSTRUCT
 
#define NONAMELESSUNION
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (devenum)
 
static ULONG WINAPI DEVENUM_ICreateDevEnum_AddRef (ICreateDevEnum *iface)
 
static HRESULT DEVENUM_CreateAMCategoryKey (const CLSID *clsidCategory)
 
static HRESULT WINAPI DEVENUM_ICreateDevEnum_QueryInterface (ICreateDevEnum *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI DEVENUM_ICreateDevEnum_Release (ICreateDevEnum *iface)
 
static HRESULT register_codec (const GUID *class, const WCHAR *name, const GUID *clsid, const WCHAR *friendly_name, IPropertyBag **ret)
 
static void DEVENUM_ReadPinTypes (HKEY hkeyPinKey, REGFILTERPINS2 *rgPin)
 
static void DEVENUM_ReadPins (HKEY hkeyFilterClass, REGFILTER2 *rgf2)
 
static void free_regfilter2 (REGFILTER2 *rgf)
 
static void write_filter_data (IPropertyBag *prop_bag, REGFILTER2 *rgf)
 
static void register_legacy_filters (void)
 
static BOOL CALLBACK register_dsound_devices (GUID *guid, const WCHAR *desc, const WCHAR *module, void *context)
 
static void register_waveout_devices (void)
 
static void register_wavein_devices (void)
 
static void register_midiout_devices (void)
 
static void register_vfw_codecs (void)
 
static void register_avicap_devices (void)
 
static HRESULT WINAPI DEVENUM_ICreateDevEnum_CreateClassEnumerator (ICreateDevEnum *iface, REFCLSID class, IEnumMoniker **out, DWORD flags)
 

Variables

static const WCHAR wszFilterKeyName [] = {'F','i','l','t','e','r',0}
 
static const WCHAR wszMeritName [] = {'M','e','r','i','t',0}
 
static const WCHAR wszPins [] = {'P','i','n','s',0}
 
static const WCHAR wszAllowedMany [] = {'A','l','l','o','w','e','d','M','a','n','y',0}
 
static const WCHAR wszAllowedZero [] = {'A','l','l','o','w','e','d','Z','e','r','o',0}
 
static const WCHAR wszDirection [] = {'D','i','r','e','c','t','i','o','n',0}
 
static const WCHAR wszIsRendered [] = {'I','s','R','e','n','d','e','r','e','d',0}
 
static const WCHAR wszTypes [] = {'T','y','p','e','s',0}
 
static const WCHAR wszFriendlyName [] = {'F','r','i','e','n','d','l','y','N','a','m','e',0}
 
static const WCHAR wszFilterData [] = {'F','i','l','t','e','r','D','a','t','a',0}
 
static const ICreateDevEnumVtbl ICreateDevEnum_Vtbl
 
ICreateDevEnum DEVENUM_CreateDevEnum = { &ICreateDevEnum_Vtbl }
 

Macro Definition Documentation

◆ NONAMELESSSTRUCT

#define NONAMELESSSTRUCT

Definition at line 26 of file createdevenum.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 27 of file createdevenum.c.

Function Documentation

◆ DEVENUM_CreateAMCategoryKey()

static HRESULT DEVENUM_CreateAMCategoryKey ( const CLSID clsidCategory)
static

Definition at line 906 of file createdevenum.c.

907 {
908  WCHAR wszRegKey[MAX_PATH];
909  HRESULT res = S_OK;
910  HKEY hkeyDummy = NULL;
911 
912  lstrcpyW(wszRegKey, wszActiveMovieKey);
913 
914  if (!StringFromGUID2(clsidCategory, wszRegKey + lstrlenW(wszRegKey), ARRAY_SIZE(wszRegKey) - lstrlenW(wszRegKey)))
915  res = E_INVALIDARG;
916 
917  if (SUCCEEDED(res))
918  {
919  LONG lRes = RegCreateKeyW(HKEY_CURRENT_USER, wszRegKey, &hkeyDummy);
920  res = HRESULT_FROM_WIN32(lRes);
921  }
922 
923  if (hkeyDummy)
924  RegCloseKey(hkeyDummy);
925 
926  if (FAILED(res))
927  ERR("Failed to create key HKEY_CURRENT_USER\\%s\n", debugstr_w(wszRegKey));
928 
929  return res;
930 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define lstrlenW
Definition: compat.h:415
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
#define debugstr_w
Definition: kernel32.h:32
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
static const WCHAR wszActiveMovieKey[]
LONG WINAPI RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1199
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
#define lstrcpyW
Definition: compat.h:414
#define ARRAY_SIZE(a)
Definition: main.h:24
GLuint res
Definition: glext.h:9613
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by register_avicap_devices(), register_dsound_devices(), register_legacy_filters(), register_midiout_devices(), register_vfw_codecs(), register_wavein_devices(), and register_waveout_devices().

◆ DEVENUM_ICreateDevEnum_AddRef()

static ULONG WINAPI DEVENUM_ICreateDevEnum_AddRef ( ICreateDevEnum iface)
static

Definition at line 84 of file createdevenum.c.

85 {
86  TRACE("\n");
87 
89 
90  return 2; /* non-heap based object */
91 }
static void DEVENUM_LockModule(void)
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by DEVENUM_ICreateDevEnum_QueryInterface().

◆ DEVENUM_ICreateDevEnum_CreateClassEnumerator()

static HRESULT WINAPI DEVENUM_ICreateDevEnum_CreateClassEnumerator ( ICreateDevEnum iface,
REFCLSID  class,
IEnumMoniker **  out,
DWORD  flags 
)
static

Definition at line 829 of file createdevenum.c.

831 {
832  WCHAR guidstr[CHARS_IN_GUID];
833  HRESULT hr;
834  HKEY key;
835 
836  TRACE("iface %p, class %s, out %p, flags %#x.\n", iface, debugstr_guid(class), out, flags);
837 
838  if (!out)
839  return E_POINTER;
840 
841  *out = NULL;
842 
844  {
845  StringFromGUID2(class, guidstr, ARRAY_SIZE(guidstr));
846  RegDeleteTreeW(key, guidstr);
847  }
848 
849  if (IsEqualGUID(class, &CLSID_LegacyAmFilterCategory))
851  else if (IsEqualGUID(class, &CLSID_AudioRendererCategory))
852  {
854  if (FAILED(hr)) return hr;
857  }
858  else if (IsEqualGUID(class, &CLSID_AudioInputDeviceCategory))
860  else if (IsEqualGUID(class, &CLSID_VideoCompressorCategory))
862  else if (IsEqualGUID(class, &CLSID_VideoInputDeviceCategory))
864 
865  if (SUCCEEDED(hr = create_EnumMoniker(class, out)))
866  {
867  IMoniker *mon;
868  hr = IEnumMoniker_Next(*out, 1, &mon, NULL);
869  if (hr == S_OK)
870  {
871  IMoniker_Release(mon);
872  IEnumMoniker_Reset(*out);
873  }
874  else
875  {
876  IEnumMoniker_Release(*out);
877  *out = NULL;
878  }
879  }
880 
881  return hr;
882 }
static void register_legacy_filters(void)
HRESULT hr
Definition: shlfolder.c:183
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define CHARS_IN_GUID
HRESULT create_EnumMoniker(REFCLSID class, IEnumMoniker **enum_mon) DECLSPEC_HIDDEN
static void register_vfw_codecs(void)
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3296
smooth NULL
Definition: ftsmooth.c:416
static void register_midiout_devices(void)
#define debugstr_guid
Definition: kernel32.h:35
static void register_waveout_devices(void)
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
static FILE * out
Definition: regtests2xml.c:44
HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW lpDSEnumCallback, LPVOID lpContext)
Definition: enum.c:210
static const WCHAR wszActiveMovieKey[]
GLbitfield flags
Definition: glext.h:7161
static void register_avicap_devices(void)
HKEY key
Definition: reg.c:42
LSTATUS WINAPI RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey)
Definition: reg.c:1746
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static void register_wavein_devices(void)
#define E_POINTER
Definition: winerror.h:2365
static BOOL CALLBACK register_dsound_devices(GUID *guid, const WCHAR *desc, const WCHAR *module, void *context)
#define SUCCEEDED(hr)
Definition: intsafe.h:57
Definition: path.c:41

◆ DEVENUM_ICreateDevEnum_QueryInterface()

static HRESULT WINAPI DEVENUM_ICreateDevEnum_QueryInterface ( ICreateDevEnum iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 60 of file createdevenum.c.

62 {
63  TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
64 
65  if (!ppv)
66  return E_POINTER;
67 
68  if (IsEqualGUID(riid, &IID_IUnknown) ||
69  IsEqualGUID(riid, &IID_ICreateDevEnum))
70  {
71  *ppv = iface;
73  return S_OK;
74  }
75 
76  FIXME("- no interface IID: %s\n", debugstr_guid(riid));
77  *ppv = NULL;
78  return E_NOINTERFACE;
79 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define FIXME(fmt,...)
Definition: debug.h:110
static ULONG WINAPI DEVENUM_ICreateDevEnum_AddRef(ICreateDevEnum *iface)
Definition: createdevenum.c:84
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
#define E_POINTER
Definition: winerror.h:2365

◆ DEVENUM_ICreateDevEnum_Release()

static ULONG WINAPI DEVENUM_ICreateDevEnum_Release ( ICreateDevEnum iface)
static

Definition at line 96 of file createdevenum.c.

97 {
98  TRACE("\n");
99 
101 
102  return 1; /* non-heap based object */
103 }
static void DEVENUM_UnlockModule(void)
#define TRACE(s)
Definition: solgame.cpp:4

◆ DEVENUM_ReadPins()

static void DEVENUM_ReadPins ( HKEY  hkeyFilterClass,
REGFILTER2 rgf2 
)
static

Definition at line 259 of file createdevenum.c.

260 {
261  HKEY hkeyPins = NULL;
262  DWORD dwPinsSubkeys, i;
263  REGFILTERPINS2 *rgPins = NULL;
264 
265  rgf2->dwVersion = 2;
266  rgf2->u.s2.cPins2 = 0;
267  rgf2->u.s2.rgPins2 = NULL;
268 
269  if (RegOpenKeyExW(hkeyFilterClass, wszPins, 0, KEY_READ, &hkeyPins) != ERROR_SUCCESS)
270  return ;
271 
272  if (RegQueryInfoKeyW(hkeyPins, NULL, NULL, NULL, &dwPinsSubkeys, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
273  != ERROR_SUCCESS)
274  {
275  RegCloseKey(hkeyPins);
276  return ;
277  }
278 
279  if (dwPinsSubkeys)
280  {
281  rgPins = CoTaskMemAlloc(sizeof(REGFILTERPINS2) * dwPinsSubkeys);
282  if (!rgPins)
283  {
284  RegCloseKey(hkeyPins);
285  return ;
286  }
287  }
288 
289  for (i = 0; i < dwPinsSubkeys; i++)
290  {
291  HKEY hkeyPinKey = NULL;
292  WCHAR wszPinName[MAX_PATH];
293  DWORD cName = ARRAY_SIZE(wszPinName);
294  REGFILTERPINS2 *rgPin = &rgPins[rgf2->u.s2.cPins2];
295  DWORD value, size, Type;
296  LONG lRet;
297 
298  memset(rgPin, 0, sizeof(*rgPin));
299 
300  if (RegEnumKeyExW(hkeyPins, i, wszPinName, &cName, NULL, NULL, NULL, NULL) != ERROR_SUCCESS) continue;
301 
302  if (RegOpenKeyExW(hkeyPins, wszPinName, 0, KEY_READ, &hkeyPinKey) != ERROR_SUCCESS) continue;
303 
304  size = sizeof(DWORD);
305  lRet = RegQueryValueExW(hkeyPinKey, wszAllowedMany, NULL, &Type, (BYTE *)&value, &size);
306  if (lRet != ERROR_SUCCESS || Type != REG_DWORD)
307  goto error_cleanup;
308  if (value)
309  rgPin->dwFlags |= REG_PINFLAG_B_MANY;
310 
311  size = sizeof(DWORD);
312  lRet = RegQueryValueExW(hkeyPinKey, wszAllowedZero, NULL, &Type, (BYTE *)&value, &size);
313  if (lRet != ERROR_SUCCESS || Type != REG_DWORD)
314  goto error_cleanup;
315  if (value)
316  rgPin->dwFlags |= REG_PINFLAG_B_ZERO;
317 
318  size = sizeof(DWORD);
319  lRet = RegQueryValueExW(hkeyPinKey, wszDirection, NULL, &Type, (BYTE *)&value, &size);
320  if (lRet != ERROR_SUCCESS || Type != REG_DWORD)
321  goto error_cleanup;
322  if (value)
323  rgPin->dwFlags |= REG_PINFLAG_B_OUTPUT;
324 
325 
326  size = sizeof(DWORD);
327  lRet = RegQueryValueExW(hkeyPinKey, wszIsRendered, NULL, &Type, (BYTE *)&value, &size);
328  if (lRet != ERROR_SUCCESS || Type != REG_DWORD)
329  goto error_cleanup;
330  if (value)
332 
333  DEVENUM_ReadPinTypes(hkeyPinKey, rgPin);
334 
335  ++rgf2->u.s2.cPins2;
336  continue;
337 
338  error_cleanup:
339 
340  RegCloseKey(hkeyPinKey);
341  }
342 
343  RegCloseKey(hkeyPins);
344 
345  if (rgPins && !rgf2->u.s2.cPins2)
346  {
347  CoTaskMemFree(rgPins);
348  rgPins = NULL;
349  }
350 
351  rgf2->u.s2.rgPins2 = rgPins;
352 }
static const WCHAR wszDirection[]
Definition: createdevenum.c:48
return
Definition: dirsup.c:529
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
Type
Definition: Type.h:6
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
const REGFILTERPINS2 * rgPins2
Definition: axextend.idl:246
static void DEVENUM_ReadPinTypes(HKEY hkeyPinKey, REGFILTERPINS2 *rgPin)
static const WCHAR wszAllowedMany[]
Definition: createdevenum.c:46
#define DWORD
Definition: nt_native.h:44
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR wszAllowedZero[]
Definition: createdevenum.c:47
ULONG cPins2
Definition: axextend.idl:245
GLsizeiptr size
Definition: glext.h:5919
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
LONG WINAPI RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
Definition: reg.c:3686
unsigned char BYTE
Definition: mem.h:68
GLsizei const GLfloat * value
Definition: glext.h:6069
static const WCHAR wszPins[]
Definition: createdevenum.c:45
#define ARRAY_SIZE(a)
Definition: main.h:24
DWORD dwVersion
Definition: axextend.idl:231
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2527
static const WCHAR wszIsRendered[]
Definition: createdevenum.c:49
#define memset(x, y, z)
Definition: compat.h:39
#define REG_DWORD
Definition: sdbapi.c:596
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404

Referenced by register_legacy_filters().

◆ DEVENUM_ReadPinTypes()

static void DEVENUM_ReadPinTypes ( HKEY  hkeyPinKey,
REGFILTERPINS2 rgPin 
)
static

Definition at line 166 of file createdevenum.c.

167 {
168  HKEY hkeyTypes = NULL;
169  DWORD dwMajorTypes, i;
170  REGPINTYPES *lpMediaType = NULL;
171  DWORD dwMediaTypeSize = 0;
172 
173  if (RegOpenKeyExW(hkeyPinKey, wszTypes, 0, KEY_READ, &hkeyTypes) != ERROR_SUCCESS)
174  return ;
175 
176  if (RegQueryInfoKeyW(hkeyTypes, NULL, NULL, NULL, &dwMajorTypes, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
177  != ERROR_SUCCESS)
178  {
179  RegCloseKey(hkeyTypes);
180  return ;
181  }
182 
183  for (i = 0; i < dwMajorTypes; i++)
184  {
185  HKEY hkeyMajorType = NULL;
186  WCHAR wszMajorTypeName[64];
187  DWORD cName = ARRAY_SIZE(wszMajorTypeName);
188  DWORD dwMinorTypes, i1;
189 
190  if (RegEnumKeyExW(hkeyTypes, i, wszMajorTypeName, &cName, NULL, NULL, NULL, NULL) != ERROR_SUCCESS) continue;
191 
192  if (RegOpenKeyExW(hkeyTypes, wszMajorTypeName, 0, KEY_READ, &hkeyMajorType) != ERROR_SUCCESS) continue;
193 
194  if (RegQueryInfoKeyW(hkeyMajorType, NULL, NULL, NULL, &dwMinorTypes, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
195  != ERROR_SUCCESS)
196  {
197  RegCloseKey(hkeyMajorType);
198  continue;
199  }
200 
201  for (i1 = 0; i1 < dwMinorTypes; i1++)
202  {
203  WCHAR wszMinorTypeName[64];
204  CLSID *clsMajorType = NULL, *clsMinorType = NULL;
205  HRESULT hr;
206 
207  cName = ARRAY_SIZE(wszMinorTypeName);
208  if (RegEnumKeyExW(hkeyMajorType, i1, wszMinorTypeName, &cName, NULL, NULL, NULL, NULL) != ERROR_SUCCESS) continue;
209 
210  clsMinorType = CoTaskMemAlloc(sizeof(CLSID));
211  if (!clsMinorType) continue;
212 
213  clsMajorType = CoTaskMemAlloc(sizeof(CLSID));
214  if (!clsMajorType) goto error_cleanup_types;
215 
216  hr = CLSIDFromString(wszMinorTypeName, clsMinorType);
217  if (FAILED(hr)) goto error_cleanup_types;
218 
219  hr = CLSIDFromString(wszMajorTypeName, clsMajorType);
220  if (FAILED(hr)) goto error_cleanup_types;
221 
222  if (rgPin->nMediaTypes == dwMediaTypeSize)
223  {
224  DWORD dwNewSize = dwMediaTypeSize + (dwMediaTypeSize < 2 ? 1 : dwMediaTypeSize / 2);
225  REGPINTYPES *lpNewMediaType;
226 
227  lpNewMediaType = CoTaskMemRealloc(lpMediaType, sizeof(REGPINTYPES) * dwNewSize);
228  if (!lpNewMediaType) goto error_cleanup_types;
229 
230  lpMediaType = lpNewMediaType;
231  dwMediaTypeSize = dwNewSize;
232  }
233 
234  lpMediaType[rgPin->nMediaTypes].clsMajorType = clsMajorType;
235  lpMediaType[rgPin->nMediaTypes].clsMinorType = clsMinorType;
236  rgPin->nMediaTypes++;
237  continue;
238 
239  error_cleanup_types:
240 
241  CoTaskMemFree(clsMajorType);
243  }
244 
245  RegCloseKey(hkeyMajorType);
246  }
247 
248  RegCloseKey(hkeyTypes);
249 
250  if (lpMediaType && !rgPin->nMediaTypes)
251  {
252  CoTaskMemFree(lpMediaType);
253  lpMediaType = NULL;
254  }
255 
256  rgPin->lpMediaType = lpMediaType;
257 }
return
Definition: dirsup.c:529
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
#define KEY_READ
Definition: nt_native.h:1023
REGPINTYPES
Definition: axextend.idl:187
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
const CLSID * clsMinorType
Definition: axextend.idl:186
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
LONG WINAPI RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
Definition: reg.c:3686
#define ARRAY_SIZE(a)
Definition: main.h:24
static const WCHAR wszTypes[]
Definition: createdevenum.c:50
const REGPINTYPES * lpMediaType
Definition: axextend.idl:223
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2338
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
LPVOID WINAPI CoTaskMemRealloc(LPVOID pvOld, SIZE_T size)
Definition: ifs.c:438
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2527
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404

Referenced by DEVENUM_ReadPins().

◆ free_regfilter2()

static void free_regfilter2 ( REGFILTER2 rgf)
static

Definition at line 354 of file createdevenum.c.

355 {
356  if (rgf->u.s2.rgPins2)
357  {
358  UINT iPin;
359 
360  for (iPin = 0; iPin < rgf->u.s2.cPins2; iPin++)
361  {
362  if (rgf->u.s2.rgPins2[iPin].lpMediaType)
363  {
364  UINT iType;
365 
366  for (iType = 0; iType < rgf->u.s2.rgPins2[iPin].nMediaTypes; iType++)
367  {
368  CoTaskMemFree((void *)rgf->u.s2.rgPins2[iPin].lpMediaType[iType].clsMajorType);
369  CoTaskMemFree((void *)rgf->u.s2.rgPins2[iPin].lpMediaType[iType].clsMinorType);
370  }
371 
372  CoTaskMemFree((void *)rgf->u.s2.rgPins2[iPin].lpMediaType);
373  }
374  }
375 
376  CoTaskMemFree((void *)rgf->u.s2.rgPins2);
377  }
378 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
_In_ ULONG iType
Definition: winddi.h:3748
const REGFILTERPINS2 * rgPins2
Definition: axextend.idl:246
ULONG cPins2
Definition: axextend.idl:245
unsigned int UINT
Definition: ndis.h:50
const REGPINTYPES * lpMediaType
Definition: axextend.idl:223

Referenced by register_legacy_filters().

◆ register_avicap_devices()

static void register_avicap_devices ( void  )
static

Definition at line 774 of file createdevenum.c.

775 {
776  static const WCHAR vfwindexW[] = {'V','F','W','I','n','d','e','x',0};
777  WCHAR name[] = {'v','i','d','e','o','0',0};
778  WCHAR friendlyname[32], version[32];
779  IPropertyBag *prop_bag = NULL;
780  REGFILTERPINS2 rgpins = {0};
781  REGPINTYPES rgtypes;
782  REGFILTER2 rgf;
783  VARIANT var;
784  HRESULT hr;
785  int i = 0;
786 
787  hr = DEVENUM_CreateAMCategoryKey(&CLSID_VideoInputDeviceCategory);
788  if (FAILED(hr))
789  return;
790 
791  for (i = 0; i < 10; ++i)
792  {
793  if (!capGetDriverDescriptionW(i, friendlyname, ARRAY_SIZE(friendlyname),
795  continue;
796 
797  name[5] = '0' + i;
798 
799  hr = register_codec(&CLSID_VideoInputDeviceCategory, name,
800  &CLSID_VfwCapture, friendlyname, &prop_bag);
801  if (FAILED(hr))
802  continue;
803 
804  rgf.dwVersion = 2;
806  rgf.u.s2.cPins2 = 1;
807  rgf.u.s2.rgPins2 = &rgpins;
808  rgpins.dwFlags = 0;
809  rgpins.nMediaTypes = 1;
810  rgpins.lpMediaType = &rgtypes;
811  rgtypes.clsMajorType = &MEDIATYPE_Video;
812  rgtypes.clsMinorType = &MEDIASUBTYPE_None;
813 
814  write_filter_data(prop_bag, &rgf);
815 
816  /* write VFWIndex */
817  V_VT(&var) = VT_I4;
818  V_I4(&var) = i;
819  IPropertyBag_Write(prop_bag, vfwindexW, &var);
820 
821  VariantClear(&var);
822  IPropertyBag_Release(prop_bag);
823  }
824 }
Definition: compat.h:1947
static void write_filter_data(IPropertyBag *prop_bag, REGFILTER2 *rgf)
HRESULT hr
Definition: shlfolder.c:183
const REGFILTERPINS2 * rgPins2
Definition: axextend.idl:246
#define V_I4(A)
Definition: oleauto.h:247
REGPINTYPES
Definition: axextend.idl:187
static HRESULT DEVENUM_CreateAMCategoryKey(const CLSID *clsidCategory)
DWORD dwMerit
Definition: axextend.idl:232
#define MERIT_DO_NOT_USE
Definition: precomp.h:18
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR version[]
Definition: asmname.c:66
ULONG cPins2
Definition: axextend.idl:245
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
static HRESULT register_codec(const GUID *class, const WCHAR *name, const GUID *clsid, const WCHAR *friendly_name, IPropertyBag **ret)
#define ARRAY_SIZE(a)
Definition: main.h:24
DWORD dwVersion
Definition: axextend.idl:231
const REGPINTYPES * lpMediaType
Definition: axextend.idl:223
Definition: name.c:38
BOOL VFWAPI capGetDriverDescriptionW(WORD wDriverIndex, LPWSTR lpszName, INT cbName, LPWSTR lpszVer, INT cbVer)
Definition: avicap32.c:142

Referenced by DEVENUM_ICreateDevEnum_CreateClassEnumerator().

◆ register_codec()

static HRESULT register_codec ( const GUID class,
const WCHAR name,
const GUID clsid,
const WCHAR friendly_name,
IPropertyBag **  ret 
)
static

Definition at line 105 of file createdevenum.c.

107 {
108  static const WCHAR deviceW[] = {'@','d','e','v','i','c','e',':','c','m',':',0};
109  WCHAR guidstr[CHARS_IN_GUID];
111  IPropertyBag *propbag;
112  IMoniker *mon;
113  WCHAR *buffer;
114  VARIANT var;
115  ULONG eaten;
116  HRESULT hr;
117 
118  hr = CoCreateInstance(&CLSID_CDeviceMoniker, NULL, CLSCTX_INPROC, &IID_IParseDisplayName, (void **)&parser);
119  if (FAILED(hr))
120  return hr;
121 
123  if (!buffer)
124  {
125  IParseDisplayName_Release(parser);
126  return E_OUTOFMEMORY;
127  }
128 
132  lstrcatW(buffer, name);
133 
134  IParseDisplayName_ParseDisplayName(parser, NULL, buffer, &eaten, &mon);
135  IParseDisplayName_Release(parser);
136  heap_free(buffer);
137 
138  IMoniker_BindToStorage(mon, NULL, NULL, &IID_IPropertyBag, (void **)&propbag);
139  IMoniker_Release(mon);
140 
141  V_VT(&var) = VT_BSTR;
143  hr = IPropertyBag_Write(propbag, wszFriendlyName, &var);
144  VariantClear(&var);
145  if (FAILED(hr))
146  {
147  IPropertyBag_Release(propbag);
148  return hr;
149  }
150 
151  V_VT(&var) = VT_BSTR;
152  StringFromGUID2(clsid, guidstr, ARRAY_SIZE(guidstr));
153  V_BSTR(&var) = SysAllocString(guidstr);
154  hr = IPropertyBag_Write(propbag, clsidW, &var);
155  VariantClear(&var);
156  if (FAILED(hr))
157  {
158  IPropertyBag_Release(propbag);
159  return hr;
160  }
161 
162  *ret = propbag;
163  return S_OK;
164 }
static const WCHAR wszFriendlyName[]
Definition: createdevenum.c:51
HRESULT hr
Definition: shlfolder.c:183
#define CHARS_IN_GUID
GLuint buffer
Definition: glext.h:5915
#define lstrlenW
Definition: compat.h:415
static const WCHAR deviceW[]
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IPropertyBag
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
const GUID IID_IParseDisplayName
static const WCHAR backslashW[]
static const WCHAR clsidW[]
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
int ret
REFCLSID clsid
Definition: msctf.c:82
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define S_OK
Definition: intsafe.h:59
#define lstrcpyW
Definition: compat.h:414
#define ARRAY_SIZE(a)
Definition: main.h:24
static const WCHAR friendly_name[]
Definition: devenum.c:40
Definition: import.c:85
Definition: name.c:38
unsigned int ULONG
Definition: retypes.h:1
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by register_avicap_devices(), register_dsound_devices(), register_legacy_filters(), register_midiout_devices(), register_vfw_codecs(), register_wavein_devices(), and register_waveout_devices().

◆ register_dsound_devices()

static BOOL CALLBACK register_dsound_devices ( GUID guid,
const WCHAR desc,
const WCHAR module,
void context 
)
static

Definition at line 507 of file createdevenum.c.

508 {
509  static const WCHAR defaultW[] = {'D','e','f','a','u','l','t',' ','D','i','r','e','c','t','S','o','u','n','d',' ','D','e','v','i','c','e',0};
510  static const WCHAR directsoundW[] = {'D','i','r','e','c','t','S','o','u','n','d',':',' ',0};
511  static const WCHAR dsguidW[] = {'D','S','G','u','i','d',0};
512  IPropertyBag *prop_bag = NULL;
513  REGFILTERPINS2 rgpins = {0};
514  REGPINTYPES rgtypes = {0};
515  REGFILTER2 rgf = {0};
517  VARIANT var;
518  HRESULT hr;
519 
520  hr = DEVENUM_CreateAMCategoryKey(&CLSID_AudioRendererCategory);
521  if (FAILED(hr))
522  return FALSE;
523 
524  if (guid)
525  {
526  WCHAR *name = heap_alloc(sizeof(defaultW) + lstrlenW(desc) * sizeof(WCHAR));
527  if (!name)
528  return FALSE;
529  lstrcpyW(name, directsoundW);
530  lstrcatW(name, desc);
531 
532  hr = register_codec(&CLSID_AudioRendererCategory, name,
533  &CLSID_DSoundRender, name, &prop_bag);
534  heap_free(name);
535  }
536  else
537  hr = register_codec(&CLSID_AudioRendererCategory, defaultW,
538  &CLSID_DSoundRender, defaultW, &prop_bag);
539  if (FAILED(hr))
540  return FALSE;
541 
542  /* write filter data */
543  rgf.dwVersion = 2;
544  rgf.dwMerit = guid ? MERIT_DO_NOT_USE : MERIT_PREFERRED;
545  rgf.u.s2.cPins2 = 1;
546  rgf.u.s2.rgPins2 = &rgpins;
548  /* FIXME: native registers many more formats */
549  rgpins.nMediaTypes = 1;
550  rgpins.lpMediaType = &rgtypes;
551  rgtypes.clsMajorType = &MEDIATYPE_Audio;
552  rgtypes.clsMinorType = &MEDIASUBTYPE_PCM;
553 
554  write_filter_data(prop_bag, &rgf);
555 
556  /* write DSound guid */
557  V_VT(&var) = VT_BSTR;
559  if ((V_BSTR(&var) = SysAllocString(clsid)))
560  hr = IPropertyBag_Write(prop_bag, dsguidW, &var);
561 
562  VariantClear(&var);
563  IPropertyBag_Release(prop_bag);
564  return TRUE;
565 }
#define TRUE
Definition: types.h:120
static void write_filter_data(IPropertyBag *prop_bag, REGFILTER2 *rgf)
HRESULT hr
Definition: shlfolder.c:183
static const WCHAR defaultW[]
Definition: lex.c:42
#define CHARS_IN_GUID
const REGFILTERPINS2 * rgPins2
Definition: axextend.idl:246
#define lstrlenW
Definition: compat.h:415
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
REGPINTYPES
Definition: axextend.idl:187
static HRESULT DEVENUM_CreateAMCategoryKey(const CLSID *clsidCategory)
DWORD dwMerit
Definition: axextend.idl:232
#define MERIT_DO_NOT_USE
Definition: precomp.h:18
const GUID * guid
static const WCHAR desc[]
Definition: protectdata.c:36
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
ULONG cPins2
Definition: axextend.idl:245
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
REFCLSID clsid
Definition: msctf.c:82
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
#define GUID_NULL
Definition: ks.h:106
#define V_BSTR(A)
Definition: oleauto.h:226
#define lstrcpyW
Definition: compat.h:414
static HRESULT register_codec(const GUID *class, const WCHAR *name, const GUID *clsid, const WCHAR *friendly_name, IPropertyBag **ret)
DWORD dwVersion
Definition: axextend.idl:231
const REGPINTYPES * lpMediaType
Definition: axextend.idl:223
Definition: name.c:38
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by DEVENUM_ICreateDevEnum_CreateClassEnumerator().

◆ register_legacy_filters()

static void register_legacy_filters ( void  )
static

Definition at line 416 of file createdevenum.c.

417 {
418  HKEY hkeyFilter = NULL;
419  DWORD dwFilterSubkeys, i;
420  LONG lRet;
421  HRESULT hr;
422 
423  lRet = RegOpenKeyExW(HKEY_CLASSES_ROOT, wszFilterKeyName, 0, KEY_READ, &hkeyFilter);
424  hr = HRESULT_FROM_WIN32(lRet);
425 
426  if (SUCCEEDED(hr))
427  {
428  lRet = RegQueryInfoKeyW(hkeyFilter, NULL, NULL, NULL, &dwFilterSubkeys, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
429  hr = HRESULT_FROM_WIN32(lRet);
430  }
431 
432  if (SUCCEEDED(hr))
433  hr = DEVENUM_CreateAMCategoryKey(&CLSID_LegacyAmFilterCategory);
434 
435  if (SUCCEEDED(hr))
436  {
437  for (i = 0; i < dwFilterSubkeys; i++)
438  {
439  WCHAR wszFilterSubkeyName[64];
440  DWORD cName = ARRAY_SIZE(wszFilterSubkeyName);
441  IPropertyBag *prop_bag = NULL;
442  WCHAR wszRegKey[MAX_PATH];
443  HKEY classkey = NULL;
444  REGFILTER2 rgf2;
445  DWORD Type, len;
446  GUID clsid;
447 
448  if (RegEnumKeyExW(hkeyFilter, i, wszFilterSubkeyName, &cName, NULL, NULL, NULL, NULL) != ERROR_SUCCESS) continue;
449 
450  TRACE("Registering %s\n", debugstr_w(wszFilterSubkeyName));
451 
452  hr = CLSIDFromString(wszFilterSubkeyName, &clsid);
453  if (FAILED(hr))
454  continue;
455 
456  lstrcpyW(wszRegKey, clsidW);
457  lstrcatW(wszRegKey, backslashW);
458  lstrcatW(wszRegKey, wszFilterSubkeyName);
459 
460  if (RegOpenKeyExW(HKEY_CLASSES_ROOT, wszRegKey, 0, KEY_READ, &classkey) != ERROR_SUCCESS)
461  continue;
462 
463  len = 0;
464  if (!RegQueryValueExW(classkey, NULL, NULL, &Type, NULL, &len))
465  {
466  WCHAR *friendlyname = heap_alloc(len);
467  if (!friendlyname)
468  {
469  RegCloseKey(classkey);
470  continue;
471  }
472  RegQueryValueExW(classkey, NULL, NULL, &Type, (BYTE *)friendlyname, &len);
473 
474  hr = register_codec(&CLSID_LegacyAmFilterCategory, wszFilterSubkeyName,
475  &clsid, friendlyname, &prop_bag);
476 
477  heap_free(friendlyname);
478  }
479  else
480  hr = register_codec(&CLSID_LegacyAmFilterCategory, wszFilterSubkeyName,
481  &clsid, wszFilterSubkeyName, &prop_bag);
482  if (FAILED(hr))
483  {
484  RegCloseKey(classkey);
485  continue;
486  }
487 
488  /* write filter data */
489  rgf2.dwMerit = MERIT_NORMAL;
490 
491  len = sizeof(rgf2.dwMerit);
492  RegQueryValueExW(classkey, wszMeritName, NULL, &Type, (BYTE *)&rgf2.dwMerit, &len);
493 
494  DEVENUM_ReadPins(classkey, &rgf2);
495 
496  write_filter_data(prop_bag, &rgf2);
497 
498  IPropertyBag_Release(prop_bag);
499  RegCloseKey(classkey);
500  free_regfilter2(&rgf2);
501  }
502  }
503 
504  if (hkeyFilter) RegCloseKey(hkeyFilter);
505 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
static void write_filter_data(IPropertyBag *prop_bag, REGFILTER2 *rgf)
Type
Definition: Type.h:6
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
#define KEY_READ
Definition: nt_native.h:1023
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
static HRESULT DEVENUM_CreateAMCategoryKey(const CLSID *clsidCategory)
DWORD dwMerit
Definition: axextend.idl:232
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
static void free_regfilter2(REGFILTER2 *rgf)
static void DEVENUM_ReadPins(HKEY hkeyFilterClass, REGFILTER2 *rgf2)
static const WCHAR backslashW[]
#define TRACE(s)
Definition: solgame.cpp:4
static const WCHAR clsidW[]
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR wszFilterKeyName[]
Definition: createdevenum.c:43
LONG WINAPI RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
Definition: reg.c:3686
REFCLSID clsid
Definition: msctf.c:82
GLenum GLsizei len
Definition: glext.h:6722
unsigned char BYTE
Definition: mem.h:68
#define lstrcpyW
Definition: compat.h:414
static HRESULT register_codec(const GUID *class, const WCHAR *name, const GUID *clsid, const WCHAR *friendly_name, IPropertyBag **ret)
#define ARRAY_SIZE(a)
Definition: main.h:24
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2338
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2527
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
static const WCHAR wszMeritName[]
Definition: createdevenum.c:44
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by DEVENUM_ICreateDevEnum_CreateClassEnumerator().

◆ register_midiout_devices()

static void register_midiout_devices ( void  )
static

Definition at line 660 of file createdevenum.c.

661 {
662  static const WCHAR defaultW[] = {'D','e','f','a','u','l','t',' ','M','i','d','i','O','u','t',' ','D','e','v','i','c','e',0};
663  static const WCHAR midioutidW[] = {'M','i','d','i','O','u','t','I','d',0};
664  IPropertyBag *prop_bag = NULL;
665  REGFILTERPINS2 rgpins = {0};
666  REGPINTYPES rgtypes = {0};
667  REGFILTER2 rgf = {0};
668  MIDIOUTCAPSW caps;
669  const WCHAR *name;
670  int i, count;
671  VARIANT var;
672  HRESULT hr;
673 
674  hr = DEVENUM_CreateAMCategoryKey(&CLSID_AudioRendererCategory);
675  if (FAILED(hr)) return;
676 
678 
679  for (i = -1; i < count; i++)
680  {
681  midiOutGetDevCapsW(i, &caps, sizeof(caps));
682 
683  name = (i == -1) ? defaultW : caps.szPname;
684 
685  hr = register_codec(&CLSID_MidiRendererCategory, name,
686  &CLSID_AVIMIDIRender, name, &prop_bag);
687  if (FAILED(hr))
688  continue;
689 
690  /* write filter data */
691  rgf.dwVersion = 2;
692  rgf.dwMerit = (i == -1) ? MERIT_PREFERRED : MERIT_DO_NOT_USE;
693  rgf.u.s2.cPins2 = 1;
694  rgf.u.s2.rgPins2 = &rgpins;
696  rgpins.nMediaTypes = 1;
697  rgpins.lpMediaType = &rgtypes;
698  rgtypes.clsMajorType = &MEDIATYPE_Midi;
699  rgtypes.clsMinorType = &MEDIASUBTYPE_NULL;
700 
701  write_filter_data(prop_bag, &rgf);
702 
703  /* write MidiOutId */
704  V_VT(&var) = VT_I4;
705  V_I4(&var) = i;
706  IPropertyBag_Write(prop_bag, midioutidW, &var);
707 
708  VariantClear(&var);
709  IPropertyBag_Release(prop_bag);
710  }
711 }
Definition: compat.h:1947
static void write_filter_data(IPropertyBag *prop_bag, REGFILTER2 *rgf)
HRESULT hr
Definition: shlfolder.c:183
GLuint GLuint GLsizei count
Definition: gl.h:1545
static const WCHAR defaultW[]
Definition: lex.c:42
const REGFILTERPINS2 * rgPins2
Definition: axextend.idl:246
#define V_I4(A)
Definition: oleauto.h:247
REGPINTYPES
Definition: axextend.idl:187
static HRESULT DEVENUM_CreateAMCategoryKey(const CLSID *clsidCategory)
DWORD dwMerit
Definition: axextend.idl:232
#define MERIT_DO_NOT_USE
Definition: precomp.h:18
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
ULONG cPins2
Definition: axextend.idl:245
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1126
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MEDIASUBTYPE_NULL
Definition: uuids.h:25
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
static HRESULT register_codec(const GUID *class, const WCHAR *name, const GUID *clsid, const WCHAR *friendly_name, IPropertyBag **ret)
DWORD dwVersion
Definition: axextend.idl:231
UINT WINAPI midiOutGetDevCapsW(UINT_PTR uDeviceID, LPMIDIOUTCAPSW lpCaps, UINT uSize)
Definition: winmm.c:817
const REGPINTYPES * lpMediaType
Definition: axextend.idl:223
Definition: name.c:38
UINT WINAPI midiOutGetNumDevs(void)
Definition: winmm.c:809
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by DEVENUM_ICreateDevEnum_CreateClassEnumerator().

◆ register_vfw_codecs()

static void register_vfw_codecs ( void  )
static

Definition at line 713 of file createdevenum.c.

714 {
715  static const WCHAR fcchandlerW[] = {'F','c','c','H','a','n','d','l','e','r',0};
716  REGFILTERPINS2 rgpins[2] = {{0}};
717  IPropertyBag *prop_bag = NULL;
718  REGPINTYPES rgtypes[2];
719  REGFILTER2 rgf;
720  GUID typeguid;
721  ICINFO info;
722  VARIANT var;
723  HRESULT hr;
724  int i = 0;
725  HIC hic;
726 
727  hr = DEVENUM_CreateAMCategoryKey(&CLSID_AudioRendererCategory);
728  if (FAILED(hr)) return;
729 
730  while (ICInfo(ICTYPE_VIDEO, i++, &info))
731  {
732  WCHAR name[5] = {LOBYTE(LOWORD(info.fccHandler)), HIBYTE(LOWORD(info.fccHandler)),
733  LOBYTE(HIWORD(info.fccHandler)), HIBYTE(HIWORD(info.fccHandler))};
734 
735  hic = ICOpen(ICTYPE_VIDEO, info.fccHandler, ICMODE_QUERY);
736  ICGetInfo(hic, &info, sizeof(info));
737  ICClose(hic);
738 
739  hr = register_codec(&CLSID_VideoCompressorCategory, name,
740  &CLSID_AVICo, info.szDescription, &prop_bag);
741  if (FAILED(hr))
742  continue;
743 
744  /* write filter data */
745  rgf.dwVersion = 2;
747  rgf.u.s2.cPins2 = 2;
748  rgf.u.s2.rgPins2 = rgpins;
749  rgpins[0].dwFlags = 0;
750  rgpins[0].nMediaTypes = 1;
751  rgpins[0].lpMediaType = &rgtypes[0];
752  rgtypes[0].clsMajorType = &MEDIATYPE_Video;
753  typeguid = MEDIASUBTYPE_PCM;
754  typeguid.Data1 = info.fccHandler;
755  rgtypes[0].clsMinorType = &typeguid;
756  rgpins[1].dwFlags = REG_PINFLAG_B_OUTPUT;
757  rgpins[1].nMediaTypes = 1;
758  rgpins[1].lpMediaType = &rgtypes[1];
759  rgtypes[1].clsMajorType = &MEDIATYPE_Video;
760  rgtypes[1].clsMinorType = &GUID_NULL;
761 
762  write_filter_data(prop_bag, &rgf);
763 
764  /* write WaveInId */
765  V_VT(&var) = VT_BSTR;
766  V_BSTR(&var) = SysAllocString(name);
767  IPropertyBag_Write(prop_bag, fcchandlerW, &var);
768 
769  VariantClear(&var);
770  IPropertyBag_Release(prop_bag);
771  }
772 }
HIC VFWAPI ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode)
Definition: msvideo_main.c:441
static void write_filter_data(IPropertyBag *prop_bag, REGFILTER2 *rgf)
HRESULT hr
Definition: shlfolder.c:183
#define LOBYTE(W)
Definition: jmemdos.c:487
const REGFILTERPINS2 * rgPins2
Definition: axextend.idl:246
#define HIBYTE(W)
Definition: jmemdos.c:486
#define ICMODE_QUERY
Definition: vfw.h:271
struct _test_info info[]
Definition: SetCursorPos.c:19
REGPINTYPES
Definition: axextend.idl:187
static HRESULT DEVENUM_CreateAMCategoryKey(const CLSID *clsidCategory)
DWORD dwMerit
Definition: axextend.idl:232
#define MERIT_DO_NOT_USE
Definition: precomp.h:18
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
LRESULT WINAPI ICClose(HIC hic)
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
LRESULT VFWAPI ICGetInfo(HIC hic, ICINFO *picinfo, DWORD cb)
Definition: msvideo_main.c:594
ULONG cPins2
Definition: axextend.idl:245
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define ICTYPE_VIDEO
Definition: mmreg.h:531
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
#define GUID_NULL
Definition: ks.h:106
BOOL VFWAPI ICInfo(DWORD type, DWORD handler, ICINFO *info)
Definition: msvideo_main.c:270
#define V_BSTR(A)
Definition: oleauto.h:226
Definition: vfw.h:280
static HRESULT register_codec(const GUID *class, const WCHAR *name, const GUID *clsid, const WCHAR *friendly_name, IPropertyBag **ret)
DWORD dwVersion
Definition: axextend.idl:231
const REGPINTYPES * lpMediaType
Definition: axextend.idl:223
Definition: name.c:38
#define HIWORD(l)
Definition: typedefs.h:246
#define LOWORD(l)
Definition: pedump.c:82

Referenced by DEVENUM_ICreateDevEnum_CreateClassEnumerator().

◆ register_wavein_devices()

static void register_wavein_devices ( void  )
static

Definition at line 620 of file createdevenum.c.

621 {
622  static const WCHAR waveinidW[] = {'W','a','v','e','I','n','I','d',0};
623  IPropertyBag *prop_bag = NULL;
624  REGFILTER2 rgf = {0};
625  WAVEINCAPSW caps;
626  int i, count;
627  VARIANT var;
628  HRESULT hr;
629 
630  hr = DEVENUM_CreateAMCategoryKey(&CLSID_AudioRendererCategory);
631  if (FAILED(hr)) return;
632 
634 
635  for (i = 0; i < count; i++)
636  {
637  waveInGetDevCapsW(i, &caps, sizeof(caps));
638 
639  hr = register_codec(&CLSID_AudioInputDeviceCategory, caps.szPname,
640  &CLSID_AudioRecord, caps.szPname, &prop_bag);
641  if (FAILED(hr))
642  continue;
643 
644  /* write filter data */
645  rgf.dwVersion = 2;
647 
648  write_filter_data(prop_bag, &rgf);
649 
650  /* write WaveInId */
651  V_VT(&var) = VT_I4;
652  V_I4(&var) = i;
653  IPropertyBag_Write(prop_bag, waveinidW, &var);
654 
655  VariantClear(&var);
656  IPropertyBag_Release(prop_bag);
657  }
658 }
Definition: compat.h:1947
static void write_filter_data(IPropertyBag *prop_bag, REGFILTER2 *rgf)
HRESULT hr
Definition: shlfolder.c:183
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1060
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define V_I4(A)
Definition: oleauto.h:247
static HRESULT DEVENUM_CreateAMCategoryKey(const CLSID *clsidCategory)
DWORD dwMerit
Definition: axextend.idl:232
UINT WINAPI waveInGetDevCapsW(UINT_PTR uDeviceID, LPWAVEINCAPSW lpCaps, UINT uSize)
Definition: winmm.c:2576
#define MERIT_DO_NOT_USE
Definition: precomp.h:18
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
static HRESULT register_codec(const GUID *class, const WCHAR *name, const GUID *clsid, const WCHAR *friendly_name, IPropertyBag **ret)
DWORD dwVersion
Definition: axextend.idl:231
UINT WINAPI waveInGetNumDevs(void)
Definition: winmm.c:2568

Referenced by DEVENUM_ICreateDevEnum_CreateClassEnumerator().

◆ register_waveout_devices()

static void register_waveout_devices ( void  )
static

Definition at line 567 of file createdevenum.c.

568 {
569  static const WCHAR defaultW[] = {'D','e','f','a','u','l','t',' ','W','a','v','e','O','u','t',' ','D','e','v','i','c','e',0};
570  static const WCHAR waveoutidW[] = {'W','a','v','e','O','u','t','I','d',0};
571  IPropertyBag *prop_bag = NULL;
572  REGFILTERPINS2 rgpins = {0};
573  REGPINTYPES rgtypes = {0};
574  REGFILTER2 rgf = {0};
575  WAVEOUTCAPSW caps;
576  const WCHAR *name;
577  int i, count;
578  VARIANT var;
579  HRESULT hr;
580 
581  hr = DEVENUM_CreateAMCategoryKey(&CLSID_AudioRendererCategory);
582  if (FAILED(hr)) return;
583 
585 
586  for (i = -1; i < count; i++)
587  {
588  waveOutGetDevCapsW(i, &caps, sizeof(caps));
589 
590  name = (i == -1) ? defaultW : caps.szPname;
591 
592  hr = register_codec(&CLSID_AudioRendererCategory, name,
593  &CLSID_AudioRender, name, &prop_bag);
594  if (FAILED(hr))
595  continue;
596 
597  /* write filter data */
598  rgf.dwVersion = 2;
600  rgf.u.s2.cPins2 = 1;
601  rgf.u.s2.rgPins2 = &rgpins;
603  rgpins.nMediaTypes = 1;
604  rgpins.lpMediaType = &rgtypes;
605  rgtypes.clsMajorType = &MEDIATYPE_Audio;
606  rgtypes.clsMinorType = &MEDIASUBTYPE_NULL;
607 
608  write_filter_data(prop_bag, &rgf);
609 
610  /* write WaveOutId */
611  V_VT(&var) = VT_I4;
612  V_I4(&var) = i;
613  IPropertyBag_Write(prop_bag, waveoutidW, &var);
614 
615  VariantClear(&var);
616  if (prop_bag) IPropertyBag_Release(prop_bag);
617  }
618 }
Definition: compat.h:1947
static void write_filter_data(IPropertyBag *prop_bag, REGFILTER2 *rgf)
HRESULT hr
Definition: shlfolder.c:183
GLuint GLuint GLsizei count
Definition: gl.h:1545
static const WCHAR defaultW[]
Definition: lex.c:42
const REGFILTERPINS2 * rgPins2
Definition: axextend.idl:246
#define V_I4(A)
Definition: oleauto.h:247
REGPINTYPES
Definition: axextend.idl:187
static HRESULT DEVENUM_CreateAMCategoryKey(const CLSID *clsidCategory)
DWORD dwMerit
Definition: axextend.idl:232
#define MERIT_DO_NOT_USE
Definition: precomp.h:18
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
UINT WINAPI waveOutGetDevCapsW(UINT_PTR uDeviceID, LPWAVEOUTCAPSW lpCaps, UINT uSize)
Definition: winmm.c:2176
smooth NULL
Definition: ftsmooth.c:416
UINT WINAPI waveOutGetNumDevs(void)
Definition: winmm.c:2140
ULONG cPins2
Definition: axextend.idl:245
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MEDIASUBTYPE_NULL
Definition: uuids.h:25
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1039
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
static HRESULT register_codec(const GUID *class, const WCHAR *name, const GUID *clsid, const WCHAR *friendly_name, IPropertyBag **ret)
DWORD dwVersion
Definition: axextend.idl:231
const REGPINTYPES * lpMediaType
Definition: axextend.idl:223
Definition: name.c:38
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by DEVENUM_ICreateDevEnum_CreateClassEnumerator().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( devenum  )

◆ write_filter_data()

static void write_filter_data ( IPropertyBag prop_bag,
REGFILTER2 rgf 
)
static

Definition at line 380 of file createdevenum.c.

381 {
382  BYTE *data = NULL, *array;
383  IAMFilterData *fildata;
384  SAFEARRAYBOUND sabound;
385  VARIANT var;
386  ULONG size;
387  HRESULT hr;
388 
389  hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC, &IID_IAMFilterData, (void **)&fildata);
390  if (FAILED(hr)) goto cleanup;
391 
392  hr = IAMFilterData_CreateFilterData(fildata, rgf, &data, &size);
393  if (FAILED(hr)) goto cleanup;
394 
395  V_VT(&var) = VT_ARRAY | VT_UI1;
396  sabound.lLbound = 0;
397  sabound.cElements = size;
398  if (!(V_ARRAY(&var) = SafeArrayCreate(VT_UI1, 1, &sabound)))
399  goto cleanup;
400  hr = SafeArrayAccessData(V_ARRAY(&var), (void *)&array);
401  if (FAILED(hr)) goto cleanup;
402 
403  memcpy(array, data, size);
405  if (FAILED(hr)) goto cleanup;
406 
407  hr = IPropertyBag_Write(prop_bag, wszFilterData, &var);
408  if (FAILED(hr)) goto cleanup;
409 
410 cleanup:
411  VariantClear(&var);
413  IAMFilterData_Release(fildata);
414 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
HRESULT hr
Definition: shlfolder.c:183
#define V_ARRAY(A)
Definition: oleauto.h:222
HRESULT WINAPI SafeArrayAccessData(SAFEARRAY *psa, void **ppvData)
Definition: safearray.c:1137
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
LONG HRESULT
Definition: typedefs.h:77
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
SAFEARRAY *WINAPI SafeArrayCreate(VARTYPE vt, UINT cDims, SAFEARRAYBOUND *rgsabound)
Definition: safearray.c:600
static const WCHAR wszFilterData[]
Definition: createdevenum.c:52
unsigned int ULONG
Definition: retypes.h:1
char * cleanup(char *str)
Definition: wpickclick.c:99
HRESULT WINAPI SafeArrayUnaccessData(SAFEARRAY *psa)
Definition: safearray.c:1168
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum GLint const GLfloat GLenum GLint const GLushort GLint GLint GLsizei GLsizei GLenum GLsizei GLsizei GLenum GLenum const GLvoid GLenum GLdouble GLenum GLint GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLenum GLfloat GLenum GLfloat GLenum GLushort const GLubyte GLenum GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLvoid GLenum GLenum GLint GLenum GLint GLenum GLint GLuint GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble const GLfloat GLenum const GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLint GLint GLsizei GLsizei GLenum GLuint GLenum array
Definition: glfuncs.h:320

Referenced by register_avicap_devices(), register_dsound_devices(), register_legacy_filters(), register_midiout_devices(), register_vfw_codecs(), register_wavein_devices(), and register_waveout_devices().

Variable Documentation

◆ DEVENUM_CreateDevEnum

ICreateDevEnum DEVENUM_CreateDevEnum = { &ICreateDevEnum_Vtbl }

Definition at line 898 of file createdevenum.c.

◆ ICreateDevEnum_Vtbl

const ICreateDevEnumVtbl ICreateDevEnum_Vtbl
static
Initial value:
=
{
}
static ULONG WINAPI DEVENUM_ICreateDevEnum_AddRef(ICreateDevEnum *iface)
Definition: createdevenum.c:84
static ULONG WINAPI DEVENUM_ICreateDevEnum_Release(ICreateDevEnum *iface)
Definition: createdevenum.c:96
static HRESULT WINAPI DEVENUM_ICreateDevEnum_CreateClassEnumerator(ICreateDevEnum *iface, REFCLSID class, IEnumMoniker **out, DWORD flags)
static HRESULT WINAPI DEVENUM_ICreateDevEnum_QueryInterface(ICreateDevEnum *iface, REFIID riid, void **ppv)
Definition: createdevenum.c:60

Definition at line 887 of file createdevenum.c.

◆ wszAllowedMany

const WCHAR wszAllowedMany[] = {'A','l','l','o','w','e','d','M','a','n','y',0}
static

Definition at line 46 of file createdevenum.c.

Referenced by DEVENUM_ReadPins().

◆ wszAllowedZero

const WCHAR wszAllowedZero[] = {'A','l','l','o','w','e','d','Z','e','r','o',0}
static

Definition at line 47 of file createdevenum.c.

Referenced by DEVENUM_ReadPins().

◆ wszDirection

const WCHAR wszDirection[] = {'D','i','r','e','c','t','i','o','n',0}
static

Definition at line 48 of file createdevenum.c.

Referenced by DEVENUM_ReadPins().

◆ wszFilterData

const WCHAR wszFilterData[] = {'F','i','l','t','e','r','D','a','t','a',0}
static

Definition at line 52 of file createdevenum.c.

Referenced by write_filter_data().

◆ wszFilterKeyName

const WCHAR wszFilterKeyName[] = {'F','i','l','t','e','r',0}
static

Definition at line 43 of file createdevenum.c.

Referenced by register_legacy_filters().

◆ wszFriendlyName

const WCHAR wszFriendlyName[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0}
static

Definition at line 51 of file createdevenum.c.

Referenced by GetFilterInfo(), read_property_names(), and register_codec().

◆ wszIsRendered

const WCHAR wszIsRendered[] = {'I','s','R','e','n','d','e','r','e','d',0}
static

Definition at line 49 of file createdevenum.c.

Referenced by DEVENUM_ReadPins().

◆ wszMeritName

const WCHAR wszMeritName[] = {'M','e','r','i','t',0}
static

Definition at line 44 of file createdevenum.c.

Referenced by register_legacy_filters().

◆ wszPins

const WCHAR wszPins[] = {'P','i','n','s',0}
static

Definition at line 45 of file createdevenum.c.

Referenced by DEVENUM_ReadPins().

◆ wszTypes

const WCHAR wszTypes[] = {'T','y','p','e','s',0}
static

Definition at line 50 of file createdevenum.c.

Referenced by DEVENUM_ReadPinTypes().