26#define NONAMELESSSTRUCT
27#define NONAMELESSUNION
39#include "wine/fil_data.h"
46static const WCHAR wszAllowedMany[] = {
'A',
'l',
'l',
'o',
'w',
'e',
'd',
'M',
'a',
'n',
'y',0};
47static const WCHAR wszAllowedZero[] = {
'A',
'l',
'l',
'o',
'w',
'e',
'd',
'Z',
'e',
'r',
'o',0};
49static const WCHAR wszIsRendered[] = {
'I',
's',
'R',
'e',
'n',
'd',
'e',
'r',
'e',
'd',0};
51static const WCHAR wszFriendlyName[] = {
'F',
'r',
'i',
'e',
'n',
'd',
'l',
'y',
'N',
'a',
'm',
'e',0};
52static const WCHAR wszFilterData[] = {
'F',
'i',
'l',
't',
'e',
'r',
'D',
'a',
't',
'a',0};
108 static const WCHAR deviceW[] = {
'@',
'd',
'e',
'v',
'i',
'c',
'e',
':',
'c',
'm',
':',0};
125 IParseDisplayName_Release(
parser);
135 IParseDisplayName_Release(
parser);
139 IMoniker_Release(mon);
147 IPropertyBag_Release(propbag);
158 IPropertyBag_Release(propbag);
171 DWORD dwMediaTypeSize = 0;
176 if (
RegQueryInfoKeyW(hkeyTypes,
NULL,
NULL,
NULL, &dwMajorTypes,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL)
183 for (
i = 0;
i < dwMajorTypes;
i++)
186 WCHAR wszMajorTypeName[64];
188 DWORD dwMinorTypes, i1;
194 if (
RegQueryInfoKeyW(hkeyMajorType,
NULL,
NULL,
NULL, &dwMinorTypes,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL)
201 for (i1 = 0; i1 < dwMinorTypes; i1++)
203 WCHAR wszMinorTypeName[64];
214 if (!clsMajorType)
goto error_cleanup_types;
217 if (
FAILED(
hr))
goto error_cleanup_types;
220 if (
FAILED(
hr))
goto error_cleanup_types;
224 DWORD dwNewSize = dwMediaTypeSize + (dwMediaTypeSize < 2 ? 1 : dwMediaTypeSize / 2);
228 if (!lpNewMediaType)
goto error_cleanup_types;
230 lpMediaType = lpNewMediaType;
231 dwMediaTypeSize = dwNewSize;
234 lpMediaType[rgPin->
nMediaTypes].clsMajorType = clsMajorType;
272 if (
RegQueryInfoKeyW(hkeyPins,
NULL,
NULL,
NULL, &dwPinsSubkeys,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL)
289 for (
i = 0;
i < dwPinsSubkeys;
i++)
298 memset(rgPin, 0,
sizeof(*rgPin));
345 if (rgPins && !rgf2->u.s2.
cPins2)
360 for (iPin = 0; iPin < rgf->u.s2.
cPins2; iPin++)
392 hr = IAMFilterData_CreateFilterData(fildata, rgf, &
data, &
size);
413 IAMFilterData_Release(fildata);
428 lRet =
RegQueryInfoKeyW(hkeyFilter,
NULL,
NULL,
NULL, &dwFilterSubkeys,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
437 for (
i = 0;
i < dwFilterSubkeys;
i++)
439 WCHAR wszFilterSubkeyName[64];
458 lstrcatW(wszRegKey, wszFilterSubkeyName);
475 &
clsid, friendlyname, &prop_bag);
481 &
clsid, wszFilterSubkeyName, &prop_bag);
498 IPropertyBag_Release(prop_bag);
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};
533 &CLSID_DSoundRender,
name, &prop_bag);
538 &CLSID_DSoundRender,
defaultW, &prop_bag);
551 rgtypes.clsMajorType = &MEDIATYPE_Audio;
552 rgtypes.clsMinorType = &MEDIASUBTYPE_PCM;
560 hr = IPropertyBag_Write(prop_bag, dsguidW, &
var);
563 IPropertyBag_Release(prop_bag);
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};
593 &CLSID_AudioRender,
name, &prop_bag);
605 rgtypes.clsMajorType = &MEDIATYPE_Audio;
613 IPropertyBag_Write(prop_bag, waveoutidW, &
var);
616 if (prop_bag) IPropertyBag_Release(prop_bag);
622 static const WCHAR waveinidW[] = {
'W',
'a',
'v',
'e',
'I',
'n',
'I',
'd',0};
640 &CLSID_AudioRecord, caps.
szPname, &prop_bag);
653 IPropertyBag_Write(prop_bag, waveinidW, &
var);
656 IPropertyBag_Release(prop_bag);
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};
686 &CLSID_AVIMIDIRender,
name, &prop_bag);
698 rgtypes.clsMajorType = &MEDIATYPE_Midi;
706 IPropertyBag_Write(prop_bag, midioutidW, &
var);
709 IPropertyBag_Release(prop_bag);
715 static const WCHAR fcchandlerW[] = {
'F',
'c',
'c',
'H',
'a',
'n',
'd',
'l',
'e',
'r',0};
740 &CLSID_AVICo,
info.szDescription, &prop_bag);
752 rgtypes[0].clsMajorType = &MEDIATYPE_Video;
753 typeguid = MEDIASUBTYPE_PCM;
754 typeguid.Data1 =
info.fccHandler;
755 rgtypes[0].clsMinorType = &typeguid;
759 rgtypes[1].clsMajorType = &MEDIATYPE_Video;
767 IPropertyBag_Write(prop_bag, fcchandlerW, &
var);
770 IPropertyBag_Release(prop_bag);
776 static const WCHAR vfwindexW[] = {
'V',
'F',
'W',
'I',
'n',
'd',
'e',
'x',0};
777 WCHAR name[] = {
'v',
'i',
'd',
'e',
'o',
'0',0};
791 for (
i = 0;
i < 10; ++
i)
800 &CLSID_VfwCapture, friendlyname, &prop_bag);
811 rgtypes.clsMajorType = &MEDIATYPE_Video;
812 rgtypes.clsMinorType = &MEDIASUBTYPE_None;
819 IPropertyBag_Write(prop_bag, vfwindexW, &
var);
822 IPropertyBag_Release(prop_bag);
849 if (
IsEqualGUID(
class, &CLSID_LegacyAmFilterCategory))
851 else if (
IsEqualGUID(
class, &CLSID_AudioRendererCategory))
858 else if (
IsEqualGUID(
class, &CLSID_AudioInputDeviceCategory))
860 else if (
IsEqualGUID(
class, &CLSID_VideoCompressorCategory))
862 else if (
IsEqualGUID(
class, &CLSID_VideoInputDeviceCategory))
868 hr = IEnumMoniker_Next(*
out, 1, &mon,
NULL);
871 IMoniker_Release(mon);
872 IEnumMoniker_Reset(*
out);
876 IEnumMoniker_Release(*
out);
927 ERR(
"Failed to create key HKEY_CURRENT_USER\\%s\n",
debugstr_w(wszRegKey));
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
BOOL VFWAPI capGetDriverDescriptionW(WORD wDriverIndex, LPWSTR lpszName, INT cbName, LPWSTR lpszVer, INT cbVer)
const CLSID * clsMinorType
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define RegCloseKey(hKey)
LSTATUS WINAPI RegDeleteTreeW(_In_ HKEY, _In_opt_ LPCWSTR)
static const WCHAR wszDirection[]
static ULONG WINAPI DEVENUM_ICreateDevEnum_Release(ICreateDevEnum *iface)
static const WCHAR wszFilterKeyName[]
static void register_vfw_codecs(void)
static const WCHAR wszFilterData[]
static HRESULT DEVENUM_CreateAMCategoryKey(const CLSID *clsidCategory)
static HRESULT register_codec(const GUID *class, const WCHAR *name, const GUID *clsid, const WCHAR *friendly_name, IPropertyBag **ret)
static const WCHAR wszTypes[]
static void register_wavein_devices(void)
static void register_legacy_filters(void)
static void register_midiout_devices(void)
static const WCHAR wszAllowedMany[]
static HRESULT WINAPI DEVENUM_ICreateDevEnum_QueryInterface(ICreateDevEnum *iface, REFIID riid, void **ppv)
ICreateDevEnum DEVENUM_CreateDevEnum
static void free_regfilter2(REGFILTER2 *rgf)
static void DEVENUM_ReadPins(HKEY hkeyFilterClass, REGFILTER2 *rgf2)
static ULONG WINAPI DEVENUM_ICreateDevEnum_AddRef(ICreateDevEnum *iface)
static const WCHAR wszMeritName[]
static void write_filter_data(IPropertyBag *prop_bag, REGFILTER2 *rgf)
static const WCHAR wszPins[]
static void DEVENUM_ReadPinTypes(HKEY hkeyPinKey, REGFILTERPINS2 *rgPin)
static const ICreateDevEnumVtbl ICreateDevEnum_Vtbl
static HRESULT WINAPI DEVENUM_ICreateDevEnum_CreateClassEnumerator(ICreateDevEnum *iface, REFCLSID class, IEnumMoniker **out, DWORD flags)
static const WCHAR wszAllowedZero[]
static void register_avicap_devices(void)
static void register_waveout_devices(void)
static const WCHAR wszFriendlyName[]
static const WCHAR wszIsRendered[]
static BOOL CALLBACK register_dsound_devices(GUID *guid, const WCHAR *desc, const WCHAR *module, void *context)
static const WCHAR wszActiveMovieKey[]
static const WCHAR deviceW[]
static void DEVENUM_UnlockModule(void)
HRESULT create_EnumMoniker(REFCLSID class, IEnumMoniker **enum_mon) DECLSPEC_HIDDEN
static const WCHAR backslashW[]
static void DEVENUM_LockModule(void)
static const WCHAR clsidW[]
HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW lpDSEnumCallback, LPVOID lpContext)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
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)
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
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)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
LONG WINAPI RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
static const WCHAR version[]
static void cleanup(void)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
HRESULT WINAPI SafeArrayAccessData(SAFEARRAY *psa, void **ppvData)
HRESULT WINAPI SafeArrayUnaccessData(SAFEARRAY *psa)
SAFEARRAY *WINAPI SafeArrayCreate(VARTYPE vt, UINT cDims, SAFEARRAYBOUND *rgsabound)
#define REG_PINFLAG_B_MANY
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
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
LPVOID WINAPI CoTaskMemRealloc(LPVOID pvOld, SIZE_T size)
VOID WINAPI CoTaskMemFree(LPVOID ptr)
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
#define memcpy(s1, s2, n)
static const WCHAR desc[]
static const WCHAR friendly_name[]
HIC VFWAPI ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode)
LRESULT VFWAPI ICGetInfo(HIC hic, ICINFO *picinfo, DWORD cb)
BOOL VFWAPI ICInfo(DWORD type, DWORD handler, ICINFO *info)
LRESULT WINAPI ICClose(HIC hic)
BSTR WINAPI SysAllocString(LPCOLESTR str)
const GUID IID_IParseDisplayName
const GUID IID_IPropertyBag
#define IsEqualGUID(rguid1, rguid2)
const REGFILTERPINS2 * rgPins2
const REGPINTYPES * lpMediaType
WCHAR szPname[MAXPNAMELEN]
WCHAR szPname[MAXPNAMELEN]
WCHAR szPname[MAXPNAMELEN]
#define MEDIASUBTYPE_NULL
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
static const WCHAR defaultW[]
#define HRESULT_FROM_WIN32(x)
UINT WINAPI midiOutGetNumDevs(void)
UINT WINAPI waveOutGetNumDevs(void)
UINT WINAPI waveOutGetDevCapsW(UINT_PTR uDeviceID, LPWAVEOUTCAPSW lpCaps, UINT uSize)
UINT WINAPI waveInGetNumDevs(void)
UINT WINAPI midiOutGetDevCapsW(UINT_PTR uDeviceID, LPMIDIOUTCAPSW lpCaps, UINT uSize)
UINT WINAPI waveInGetDevCapsW(UINT_PTR uDeviceID, LPWAVEINCAPSW lpCaps, UINT uSize)
#define HKEY_CURRENT_USER
#define HKEY_CLASSES_ROOT