38DEFINE_GUID(
GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
40static const WCHAR friendly_name[] = {
'F',
'r',
'i',
'e',
'n',
'd',
'l',
'y',
'N',
'a',
'm',
'e',0};
58 while ((--
n > 0) && *str1 && (*str1 == *str2)) { str1++; str2++; }
75 &IID_ICreateDevEnum, (
LPVOID*)&create_devenum);
76 ok(
hr ==
S_OK,
"Failed to create devenum: %#x\n",
hr);
78 hr = ICreateDevEnum_CreateClassEnumerator(create_devenum, &CLSID_ActiveMovieCategories, &enum_cat, 0);
79 ok(
hr ==
S_OK,
"Failed to enum categories: %#x\n",
hr);
84 ok(
hr ==
S_OK,
"IMoniker_BindToStorage failed: %#x\n",
hr);
88 ok(
hr ==
S_OK,
"Failed to read CLSID: %#x\n",
hr);
95 ok(
hr ==
S_OK,
"Failed to read FriendlyName: %#x\n",
hr);
101 IPropertyBag_Release(prop_bag);
104 hr = ICreateDevEnum_CreateClassEnumerator(create_devenum, &cat_guid, &enum_moniker, 0);
120 ok(
hr ==
S_OK,
"IMoniker_GetClassID failed with error %x\n",
hr);
126 ok(
hr ==
S_OK,
"IMoniker_BindToStorage failed with error %x\n",
hr);
130 "IPropertyBag_Read failed: %#x\n",
hr);
140 IPropertyBag_Release(prop_bag);
144 IEnumMoniker_Release(enum_moniker);
146 ok(
count > 0,
"CreateClassEnumerator() returned S_OK but no devices were enumerated.\n");
150 IEnumMoniker_Release(enum_cat);
151 ICreateDevEnum_Release(create_devenum);
162 &IID_ICreateDevEnum, (
LPVOID*)&create_devenum);
165 skip(
"Cannot create SystemDeviceEnum object (%x)\n",
res);
169 res = ICreateDevEnum_CreateClassEnumerator(create_devenum, &CLSID_LegacyAmFilterCategory, &enum_moniker0, 0);
173 if (IEnumMoniker_Next(enum_moniker0, 1, &moniker0,
NULL) ==
S_OK &&
174 IEnumMoniker_Next(enum_moniker0, 1, &moniker1,
NULL) ==
S_OK)
176 res = IMoniker_IsEqual(moniker0, moniker1);
179 res = IMoniker_IsEqual(moniker1, moniker0);
182 IMoniker_Release(moniker0);
183 IMoniker_Release(moniker1);
186 skip(
"Cannot get moniker for testing.\n");
188 IEnumMoniker_Release(enum_moniker0);
190 res = ICreateDevEnum_CreateClassEnumerator(create_devenum, &CLSID_LegacyAmFilterCategory, &enum_moniker0, 0);
192 res = ICreateDevEnum_CreateClassEnumerator(create_devenum, &CLSID_AudioRendererCategory, &enum_moniker1, 0);
196 if (IEnumMoniker_Next(enum_moniker0, 1, &moniker0,
NULL) ==
S_OK &&
197 IEnumMoniker_Next(enum_moniker1, 1, &moniker1,
NULL) ==
S_OK)
199 res = IMoniker_IsEqual(moniker0, moniker1);
200 ok(
res ==
S_FALSE,
"IMoniker_IsEqual should failed (res = %x)\n",
res);
202 res = IMoniker_IsEqual(moniker1, moniker0);
203 ok(
res ==
S_FALSE,
"IMoniker_IsEqual should failed (res = %x)\n",
res);
205 IMoniker_Release(moniker0);
206 IMoniker_Release(moniker1);
209 skip(
"Cannot get moniker for testing.\n");
211 IEnumMoniker_Release(enum_moniker0);
212 IEnumMoniker_Release(enum_moniker1);
214 res = ICreateDevEnum_CreateClassEnumerator(create_devenum, &CLSID_LegacyAmFilterCategory, &enum_moniker0, 0);
216 res = ICreateDevEnum_CreateClassEnumerator(create_devenum, &CLSID_LegacyAmFilterCategory, &enum_moniker1, 0);
220 if (IEnumMoniker_Next(enum_moniker0, 1, &moniker0,
NULL) ==
S_OK &&
221 IEnumMoniker_Next(enum_moniker1, 1, &moniker1,
NULL) ==
S_OK)
223 res = IMoniker_IsEqual(moniker0, moniker1);
224 ok(
res ==
S_OK,
"IMoniker_IsEqual failed (res = %x)\n",
res);
226 res = IMoniker_IsEqual(moniker1, moniker0);
227 ok(
res ==
S_OK,
"IMoniker_IsEqual failed (res = %x)\n",
res);
229 IMoniker_Release(moniker0);
230 IMoniker_Release(moniker1);
233 skip(
"Cannot get moniker for testing.\n");
235 IEnumMoniker_Release(enum_moniker0);
236 IEnumMoniker_Release(enum_moniker1);
238 ICreateDevEnum_Release(create_devenum);
250 CoCreateInstance(&CLSID_SystemDeviceEnum,
NULL, CLSCTX_INPROC, &IID_ICreateDevEnum, (
void **)&devenum);
251 ICreateDevEnum_CreateClassEnumerator(devenum,
class, &enum_mon, 0);
252 while (!found && IEnumMoniker_Next(enum_mon, 1, &mon,
NULL) ==
S_OK)
254 if (IMoniker_IsEqual(mon, needle) ==
S_OK)
257 IMoniker_Release(mon);
260 IEnumMoniker_Release(enum_mon);
261 ICreateDevEnum_Release(devenum);
265DEFINE_GUID(CLSID_TestFilter, 0xdeadbeef,0xcf51,0x43e6,0xb6,0xc5,0x29,0x9e,0xa8,0xb6,0xb5,0x91);
269 static const WCHAR name[] = {
'd',
'e',
'v',
'e',
'n',
'u',
'm',
' ',
't',
'e',
's',
't',0};
276 ok(
hr ==
S_OK,
"Failed to create FilterMapper2: %#x\n",
hr);
280 S2(
U(rgf2)).cPins2 = 0;
282 hr = IFilterMapper2_RegisterFilter(mapper2, &CLSID_TestFilter,
name, &mon,
NULL,
NULL, &rgf2);
285 skip(
"Not enough permissions to register filters\n");
286 IFilterMapper2_Release(mapper2);
289 ok(
hr ==
S_OK,
"RegisterFilter failed: %#x\n",
hr);
291 ok(
find_moniker(&CLSID_LegacyAmFilterCategory, mon),
"filter should be registered\n");
293 hr = IFilterMapper2_UnregisterFilter(mapper2,
NULL,
NULL, &CLSID_TestFilter);
294 ok(
hr ==
S_OK,
"UnregisterFilter failed: %#x\n",
hr);
296 ok(!
find_moniker(&CLSID_LegacyAmFilterCategory, mon),
"filter should not be registered\n");
297 IMoniker_Release(mon);
300 hr = IFilterMapper2_RegisterFilter(mapper2, &CLSID_TestFilter,
name, &mon, &CLSID_AudioRendererCategory,
NULL, &rgf2);
301 ok(
hr ==
S_OK,
"RegisterFilter failed: %#x\n",
hr);
303 ok(
find_moniker(&CLSID_AudioRendererCategory, mon),
"filter should be registered\n");
305 hr = IFilterMapper2_UnregisterFilter(mapper2, &CLSID_AudioRendererCategory,
NULL, &CLSID_TestFilter);
306 ok(
hr ==
S_OK,
"UnregisterFilter failed: %#x\n",
hr);
308 ok(!
find_moniker(&CLSID_AudioRendererCategory, mon),
"filter should not be registered\n");
309 IMoniker_Release(mon);
311 IFilterMapper2_Release(mapper2);
332#define check_display_name(parser, buffer) check_display_name_(__LINE__, parser, buffer)
336 static const WCHAR instanceW[] = {
'\\',
'I',
'n',
's',
't',
'a',
'n',
'c',
'e',0};
337 static const WCHAR clsidW[] = {
'C',
'L',
'S',
'I',
'D',
'\\',0};
338 static WCHAR testW[] = {
'\\',
't',
'e',
's',
't',0};
349 ok(
hr ==
S_OK,
"Failed to create ParseDisplayName: %#x\n",
hr);
358 ok(!
find_moniker(&CLSID_AudioRendererCategory, mon),
"filter should not be registered\n");
361 ok(
hr ==
S_OK,
"BindToStorage failed: %#x\n",
hr);
375 ok(
find_moniker(&CLSID_AudioRendererCategory, mon),
"filter should be registered\n");
382 IMoniker_Release(mon);
390 ok(!
res,
"RegDeleteKey failed: %lu\n",
res);
394 IPropertyBag_Release(prop_bag);
404 ok(
hr ==
S_OK,
"BindToStorage failed: %#x\n",
hr);
422 IMoniker_Release(mon);
428 ok(!
res,
"RegDeleteKey failed: %lu\n",
res);
432 IPropertyBag_Release(prop_bag);
433 IParseDisplayName_Release(
parser);
438 static WCHAR testW[] = {
'\\',
't',
'e',
's',
't',0};
448 ok(
hr ==
S_OK,
"Failed to create ParseDisplayName: %#x\n",
hr);
457 ok(!
find_moniker(&CLSID_AudioRendererCategory, mon),
"codec should not be registered\n");
460 ok(
hr ==
S_OK,
"BindToStorage failed: %#x\n",
hr);
478 ok(!
find_moniker(&CLSID_AudioRendererCategory, mon),
"codec should not be registered\n");
484 IPropertyBag_Release(prop_bag);
485 IMoniker_Release(mon);
487 IParseDisplayName_Release(
parser);
492 static const WCHAR name[] = {
'd',
'e',
'v',
'e',
'n',
'u',
'm',
' ',
't',
'e',
's',
't',0};
501 ok(
hr ==
S_OK,
"Failed to create ParseDisplayName: %#x\n",
hr);
509 ok(!
find_moniker(&CLSID_AudioRendererCategory, mon),
"DMO should not be registered\n");
528 ok(
find_moniker(&CLSID_AudioRendererCategory, mon),
"DMO should be registered\n");
548 IPropertyBag_Release(prop_bag);
549 IMoniker_Release(mon);
550 IParseDisplayName_Release(
parser);
555 static const WCHAR nameW[] = {
't',
'e',
's',
't',0};
558 IFilterMapper *mapper;
565 ok(
hr ==
S_OK,
"Failed to create ParseDisplayName: %#x\n",
hr);
568 ok(
hr ==
S_OK,
"Failed to create FilterMapper: %#x\n",
hr);
570 hr = IFilterMapper_RegisterFilter(mapper, CLSID_TestFilter,
nameW, 0xdeadbeef);
573 win_skip(
"not enough permissions to register filters\n");
576 ok(
hr ==
S_OK,
"RegisterFilter failed: %#x\n",
hr);
585 ok(
find_moniker(&CLSID_LegacyAmFilterCategory, mon),
"filter should be registered\n");
588 ok(
hr ==
S_OK,
"BindToStorage failed: %#x\n",
hr);
605 IPropertyBag_Release(prop_bag);
607 hr = IFilterMapper_UnregisterFilter(mapper, CLSID_TestFilter);
608 ok(
hr ==
S_OK,
"UnregisterFilter failed: %#x\n",
hr);
610 ok(!
find_moniker(&CLSID_LegacyAmFilterCategory, mon),
"filter should not be registered\n");
611 IMoniker_Release(mon);
614 IFilterMapper_Release(mapper);
615 IParseDisplayName_Release(
parser);
620 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};
621 static const WCHAR directsoundW[] = {
'D',
'i',
'r',
'e',
'c',
't',
'S',
'o',
'u',
'n',
'd',
':',
' ',0};
622 static const WCHAR dsguidW[] = {
'D',
'S',
'G',
'u',
'i',
'd',0};
643 ok(
hr ==
S_OK,
"Failed to create ParseDisplayName: %#x\n",
hr);
654 ok(
hr ==
S_OK,
"BindToStorage failed: %#x\n",
hr);
661 IPropertyBag_Release(prop_bag);
662 IMoniker_Release(mon);
674 ok(
hr ==
S_OK,
"BindToStorage failed: %#x\n",
hr);
693 hr = IPropertyBag_Read(prop_bag, dsguidW, &
var,
NULL);
701 IPropertyBag_Release(prop_bag);
702 IMoniker_Release(mon);
703 IParseDisplayName_Release(
parser);
709 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};
710 static const WCHAR waveoutidW[] = {
'W',
'a',
'v',
'e',
'O',
'u',
't',
'I',
'd',0};
724 ok(
hr ==
S_OK,
"Failed to create ParseDisplayName: %#x\n",
hr);
746 ok(
hr ==
S_OK,
"BindToStorage failed: %#x\n",
hr);
752 IPropertyBag_Release(prop_bag);
753 IMoniker_Release(mon);
758 ok(!mmr,
"waveOutMessage failed: %u\n", mmr);
770 ok(
hr ==
S_OK,
"BindToStorage failed: %#x\n",
hr);
788 hr = IPropertyBag_Read(prop_bag, waveoutidW, &
var,
NULL);
793 IPropertyBag_Release(prop_bag);
794 IMoniker_Release(mon);
797 IParseDisplayName_Release(
parser);
802 static const WCHAR waveinidW[] = {
'W',
'a',
'v',
'e',
'I',
'n',
'I',
'd',0};
815 ok(
hr ==
S_OK,
"Failed to create ParseDisplayName: %#x\n",
hr);
832 ok(
hr ==
S_OK,
"BindToStorage failed: %#x\n",
hr);
838 IPropertyBag_Release(prop_bag);
839 IMoniker_Release(mon);
844 ok(!mmr,
"waveInMessage failed: %u\n", mmr);
856 ok(
hr ==
S_OK,
"BindToStorage failed: %#x\n",
hr);
874 hr = IPropertyBag_Read(prop_bag, waveinidW, &
var,
NULL);
879 IPropertyBag_Release(prop_bag);
880 IMoniker_Release(mon);
883 IParseDisplayName_Release(
parser);
888 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};
889 static const WCHAR midioutidW[] = {
'M',
'i',
'd',
'i',
'O',
'u',
't',
'I',
'd',0};
901 ok(
hr ==
S_OK,
"Failed to create ParseDisplayName: %#x\n",
hr);
923 ok(
hr ==
S_OK,
"BindToStorage failed: %#x\n",
hr);
941 hr = IPropertyBag_Read(prop_bag, midioutidW, &
var,
NULL);
946 IPropertyBag_Release(prop_bag);
947 IMoniker_Release(mon);
950 IParseDisplayName_Release(
parser);
955 static const WCHAR fcchandlerW[] = {
'F',
'c',
'c',
'H',
'a',
'n',
'd',
'l',
'e',
'r',0};
966 if (
broken(
sizeof(
void *) == 8))
968 win_skip(
"VFW codecs are not enumerated on 64-bit Windows\n");
973 ok(
hr ==
S_OK,
"Failed to create ParseDisplayName: %#x\n",
hr);
993 ok(
hr ==
S_OK,
"BindToStorage failed: %#x\n",
hr);
1011 hr = IPropertyBag_Read(prop_bag, fcchandlerW, &
var,
NULL);
1017 IPropertyBag_Release(prop_bag);
1018 IMoniker_Release(mon);
1021 IParseDisplayName_Release(
parser);
1035 ok(
hr ==
S_OK,
"Cannot create BindCtx: (res = 0x%x)\n",
hr);
1038 IBindCtx_Release(bind_ctx);
static const WCHAR nameW[]
static const WCHAR instanceW[]
HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW lpDSEnumCallback, LPVOID lpContext)
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
HRESULT WINAPI DMORegister(LPCWSTR szName, REFCLSID clsidDMO, REFGUID guidCategory, DWORD dwFlags, DWORD cInTypes, const DMO_PARTIAL_MEDIATYPE *pInTypes, DWORD cOutTypes, const DMO_PARTIAL_MEDIATYPE *pOutTypes)
HRESULT WINAPI DMOUnregister(REFCLSID dmo, REFGUID category)
GLuint GLuint GLsizei count
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
VOID WINAPI CoTaskMemFree(LPVOID ptr)
static const WCHAR testW[]
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
#define ERROR_FILE_NOT_FOUND
static const WCHAR desc[]
static void test_midiout(void)
static void test_legacy_filter(void)
static const WCHAR dmoW[]
static void test_dmo(void)
#define check_display_name(parser, buffer)
static void test_devenum(IBindCtx *bind_ctx)
static const WCHAR deviceW[]
static void test_register_filter(void)
static void test_moniker_isequal(void)
static IMoniker * check_display_name_(int line, IParseDisplayName *parser, WCHAR *buffer)
static void test_wavein(void)
static BOOL find_moniker(const GUID *class, IMoniker *needle)
static void test_codec(void)
static void test_directshow_filter(void)
static const WCHAR backslashW[]
static const WCHAR waveW[]
static void test_vfw(void)
static void test_waveout(void)
static const WCHAR friendly_name[]
static BOOL CALLBACK test_dsound(GUID *guid, const WCHAR *desc, const WCHAR *module, void *context)
static const WCHAR clsidW[]
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)
HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC *ppbc)
BSTR WINAPI SysAllocString(LPCOLESTR str)
const GUID IID_IParseDisplayName
const GUID IID_IPropertyBag
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
#define IsEqualGUID(rguid1, rguid2)
#define strncmpW(s1, s2, n)
#define DRV_QUERYFUNCTIONINSTANCEID
static __inline const char * wine_dbgstr_guid(const GUID *id)
#define ERROR_KEY_DOES_NOT_EXIST
WCHAR szPname[MAXPNAMELEN]
WCHAR szPname[MAXPNAMELEN]
WCHAR szPname[MAXPNAMELEN]
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
void WINAPI VariantInit(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 waveInMessage(HWAVEIN hWaveIn, UINT uMessage, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
UINT WINAPI waveOutMessage(HWAVEOUT hWaveOut, UINT uMessage, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
UINT WINAPI waveInGetDevCapsW(UINT_PTR uDeviceID, LPWAVEINCAPSW lpCaps, UINT uSize)
#define HKEY_CLASSES_ROOT