2014-01-10 10:42:57 +01:00
|
|
|
/*
|
|
|
|
* Copyright 2012, 2014 Michael Stefaniuc
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <windef.h>
|
|
|
|
#include <wine/test.h>
|
2018-03-02 01:16:08 +01:00
|
|
|
#include <ole2.h>
|
2014-01-10 10:42:57 +01:00
|
|
|
#include <dmusici.h>
|
2018-03-02 01:16:08 +01:00
|
|
|
#include <dmusicf.h>
|
2017-01-13 11:10:42 +01:00
|
|
|
#include <audioclient.h>
|
2017-06-28 12:50:52 +02:00
|
|
|
#include <guiddef.h>
|
2014-01-10 10:42:57 +01:00
|
|
|
|
|
|
|
static BOOL missing_dmime(void)
|
|
|
|
{
|
|
|
|
IDirectMusicSegment8 *dms;
|
|
|
|
HRESULT hr = CoCreateInstance(&CLSID_DirectMusicSegment, NULL, CLSCTX_INPROC_SERVER,
|
|
|
|
&IID_IDirectMusicSegment, (void**)&dms);
|
|
|
|
|
|
|
|
if (hr == S_OK && dms)
|
|
|
|
{
|
|
|
|
IDirectMusicSegment_Release(dms);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2014-01-10 10:54:48 +01:00
|
|
|
static void test_COM_audiopath(void)
|
|
|
|
{
|
|
|
|
IDirectMusicAudioPath *dmap;
|
|
|
|
IUnknown *unk;
|
|
|
|
IDirectMusicPerformance8 *performance;
|
2017-06-28 12:50:52 +02:00
|
|
|
IDirectSoundBuffer *dsound;
|
|
|
|
IDirectSoundBuffer8 *dsound8;
|
|
|
|
IDirectSoundNotify *notify;
|
|
|
|
IDirectSound3DBuffer *dsound3d;
|
|
|
|
IKsPropertySet *propset;
|
2014-01-10 10:54:48 +01:00
|
|
|
ULONG refcount;
|
|
|
|
HRESULT hr;
|
2017-06-28 12:50:52 +02:00
|
|
|
DWORD buffer = 0;
|
2014-01-10 10:54:48 +01:00
|
|
|
|
|
|
|
hr = CoCreateInstance(&CLSID_DirectMusicPerformance, NULL, CLSCTX_INPROC_SERVER,
|
|
|
|
&IID_IDirectMusicPerformance8, (void**)&performance);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK || broken(hr == E_NOINTERFACE), "DirectMusicPerformance create failed: %#lx\n", hr);
|
2014-01-10 10:54:48 +01:00
|
|
|
if (!performance) {
|
|
|
|
win_skip("IDirectMusicPerformance8 not available\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
hr = IDirectMusicPerformance8_InitAudio(performance, NULL, NULL, NULL,
|
|
|
|
DMUS_APATH_SHARED_STEREOPLUSREVERB, 64, DMUS_AUDIOF_ALL, NULL);
|
2017-01-13 11:10:42 +01:00
|
|
|
ok(hr == S_OK || hr == DSERR_NODRIVER ||
|
|
|
|
broken(hr == AUDCLNT_E_ENDPOINT_CREATE_FAILED), /* Win 10 testbot */
|
2022-02-08 23:14:47 +01:00
|
|
|
"DirectMusicPerformance_InitAudio failed: %#lx\n", hr);
|
2017-01-13 11:10:42 +01:00
|
|
|
if (FAILED(hr)) {
|
|
|
|
skip("Audio failed to initialize\n");
|
2014-01-10 23:07:15 +01:00
|
|
|
return;
|
|
|
|
}
|
2014-01-10 10:54:48 +01:00
|
|
|
hr = IDirectMusicPerformance8_GetDefaultAudioPath(performance, &dmap);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "DirectMusicPerformance_GetDefaultAudioPath failed: %#lx\n", hr);
|
2014-01-10 10:54:48 +01:00
|
|
|
|
|
|
|
/* IDirectMusicObject and IPersistStream are not supported */
|
|
|
|
hr = IDirectMusicAudioPath_QueryInterface(dmap, &IID_IDirectMusicObject, (void**)&unk);
|
2022-02-08 23:14:47 +01:00
|
|
|
todo_wine ok(FAILED(hr) && !unk, "Unexpected IDirectMusicObject interface: hr=%#lx, iface=%p\n",
|
2014-01-10 10:54:48 +01:00
|
|
|
hr, unk);
|
|
|
|
if (unk) IUnknown_Release(unk);
|
|
|
|
hr = IDirectMusicAudioPath_QueryInterface(dmap, &IID_IPersistStream, (void**)&unk);
|
2022-02-08 23:14:47 +01:00
|
|
|
todo_wine ok(FAILED(hr) && !unk, "Unexpected IPersistStream interface: hr=%#lx, iface=%p\n",
|
2014-01-10 10:54:48 +01:00
|
|
|
hr, unk);
|
|
|
|
if (unk) IUnknown_Release(unk);
|
|
|
|
|
|
|
|
/* Same refcount for all DirectMusicAudioPath interfaces */
|
|
|
|
refcount = IDirectMusicAudioPath_AddRef(dmap);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(refcount == 3, "refcount == %lu, expected 3\n", refcount);
|
2014-01-10 10:54:48 +01:00
|
|
|
|
|
|
|
hr = IDirectMusicAudioPath_QueryInterface(dmap, &IID_IUnknown, (void**)&unk);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %#lx\n", hr);
|
2015-04-27 01:10:26 +02:00
|
|
|
ok(unk == (IUnknown*)dmap, "got %p, %p\n", unk, dmap);
|
2014-01-10 10:54:48 +01:00
|
|
|
refcount = IUnknown_AddRef(unk);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(refcount == 5, "refcount == %lu, expected 5\n", refcount);
|
2014-01-10 10:54:48 +01:00
|
|
|
refcount = IUnknown_Release(unk);
|
|
|
|
|
2017-06-28 12:50:52 +02:00
|
|
|
hr = IDirectMusicAudioPath_GetObjectInPath(dmap, DMUS_PCHANNEL_ALL, DMUS_PATH_BUFFER, buffer, &GUID_NULL,
|
|
|
|
0, &IID_IDirectSoundBuffer, (void**)&dsound);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "Failed: %#lx\n", hr);
|
2017-06-28 12:50:52 +02:00
|
|
|
IDirectSoundBuffer_Release(dsound);
|
|
|
|
|
|
|
|
hr = IDirectMusicAudioPath_GetObjectInPath(dmap, DMUS_PCHANNEL_ALL, DMUS_PATH_BUFFER, buffer, &GUID_NULL,
|
|
|
|
0, &IID_IDirectSoundBuffer8, (void**)&dsound8);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "Failed: %#lx\n", hr);
|
2017-06-28 12:50:52 +02:00
|
|
|
IDirectSoundBuffer8_Release(dsound8);
|
|
|
|
|
|
|
|
hr = IDirectMusicAudioPath_GetObjectInPath(dmap, DMUS_PCHANNEL_ALL, DMUS_PATH_BUFFER, buffer, &GUID_NULL,
|
|
|
|
0, &IID_IDirectSoundNotify, (void**)¬ify);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOINTERFACE, "Failed: %#lx\n", hr);
|
2017-06-28 12:50:52 +02:00
|
|
|
|
|
|
|
hr = IDirectMusicAudioPath_GetObjectInPath(dmap, DMUS_PCHANNEL_ALL, DMUS_PATH_BUFFER, buffer, &GUID_NULL,
|
|
|
|
0, &IID_IDirectSound3DBuffer, (void**)&dsound3d);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOINTERFACE, "Failed: %#lx\n", hr);
|
2017-06-28 12:50:52 +02:00
|
|
|
|
|
|
|
hr = IDirectMusicAudioPath_GetObjectInPath(dmap, DMUS_PCHANNEL_ALL, DMUS_PATH_BUFFER, buffer, &GUID_NULL,
|
|
|
|
0, &IID_IKsPropertySet, (void**)&propset);
|
2022-02-08 23:14:47 +01:00
|
|
|
todo_wine ok(hr == S_OK, "Failed: %#lx\n", hr);
|
2017-06-28 12:50:52 +02:00
|
|
|
if (propset)
|
|
|
|
IKsPropertySet_Release(propset);
|
|
|
|
|
|
|
|
hr = IDirectMusicAudioPath_GetObjectInPath(dmap, DMUS_PCHANNEL_ALL, DMUS_PATH_BUFFER, buffer, &GUID_NULL,
|
|
|
|
0, &IID_IUnknown, (void**)&unk);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "Failed: %#lx\n", hr);
|
2017-06-28 12:50:52 +02:00
|
|
|
IUnknown_Release(unk);
|
|
|
|
|
|
|
|
hr = IDirectMusicAudioPath_GetObjectInPath(dmap, DMUS_PCHANNEL_ALL, DMUS_PATH_BUFFER, buffer, &GUID_NULL,
|
|
|
|
0, &GUID_NULL, (void**)&unk);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOINTERFACE, "Failed: %#lx\n", hr);
|
2017-06-28 12:50:52 +02:00
|
|
|
|
2014-01-10 10:54:48 +01:00
|
|
|
while (IDirectMusicAudioPath_Release(dmap) > 1); /* performance has a reference too */
|
|
|
|
IDirectMusicPerformance8_CloseDown(performance);
|
|
|
|
IDirectMusicPerformance8_Release(performance);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_COM_audiopathconfig(void)
|
|
|
|
{
|
|
|
|
IDirectMusicAudioPath *dmap = (IDirectMusicAudioPath*)0xdeadbeef;
|
|
|
|
IDirectMusicObject *dmo;
|
|
|
|
IPersistStream *ps;
|
|
|
|
IUnknown *unk;
|
|
|
|
ULONG refcount;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
/* COM aggregation */
|
2017-04-24 20:19:16 +02:00
|
|
|
hr = CoCreateInstance(&CLSID_DirectMusicAudioPathConfig, (IUnknown *)0xdeadbeef, CLSCTX_INPROC_SERVER,
|
2014-01-10 10:54:48 +01:00
|
|
|
&IID_IUnknown, (void**)&dmap);
|
|
|
|
if (hr == REGDB_E_CLASSNOTREG) {
|
|
|
|
win_skip("DirectMusicAudioPathConfig not registered\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
ok(hr == CLASS_E_NOAGGREGATION,
|
2022-02-08 23:14:47 +01:00
|
|
|
"DirectMusicAudioPathConfig create failed: %#lx, expected CLASS_E_NOAGGREGATION\n", hr);
|
2014-01-10 10:54:48 +01:00
|
|
|
ok(!dmap, "dmap = %p\n", dmap);
|
|
|
|
|
|
|
|
/* IDirectMusicAudioPath not supported */
|
|
|
|
hr = CoCreateInstance(&CLSID_DirectMusicAudioPathConfig, NULL, CLSCTX_INPROC_SERVER,
|
|
|
|
&IID_IDirectMusicAudioPath, (void**)&dmap);
|
|
|
|
todo_wine ok(FAILED(hr) && !dmap,
|
2022-02-08 23:14:47 +01:00
|
|
|
"Unexpected IDirectMusicAudioPath interface: hr=%#lx, iface=%p\n", hr, dmap);
|
2014-01-10 10:54:48 +01:00
|
|
|
|
|
|
|
/* IDirectMusicObject and IPersistStream supported */
|
|
|
|
hr = CoCreateInstance(&CLSID_DirectMusicAudioPathConfig, NULL, CLSCTX_INPROC_SERVER,
|
|
|
|
&IID_IPersistStream, (void**)&ps);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "DirectMusicObject create failed: %#lx, expected S_OK\n", hr);
|
2014-01-10 10:54:48 +01:00
|
|
|
IPersistStream_Release(ps);
|
|
|
|
hr = CoCreateInstance(&CLSID_DirectMusicAudioPathConfig, NULL, CLSCTX_INPROC_SERVER,
|
|
|
|
&IID_IDirectMusicObject, (void**)&dmo);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "DirectMusicObject create failed: %#lx, expected S_OK\n", hr);
|
2014-01-10 10:54:48 +01:00
|
|
|
|
|
|
|
/* Same refcount for all DirectMusicObject interfaces */
|
|
|
|
refcount = IDirectMusicObject_AddRef(dmo);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(refcount == 2, "refcount == %lu, expected 2\n", refcount);
|
2014-01-10 10:54:48 +01:00
|
|
|
|
|
|
|
hr = IDirectMusicObject_QueryInterface(dmo, &IID_IPersistStream, (void**)&ps);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "QueryInterface for IID_IPersistStream failed: %#lx\n", hr);
|
2014-01-10 10:54:48 +01:00
|
|
|
refcount = IPersistStream_AddRef(ps);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(refcount == 4, "refcount == %lu, expected 4\n", refcount);
|
2015-01-15 12:09:15 +01:00
|
|
|
IPersistStream_Release(ps);
|
2014-01-10 10:54:48 +01:00
|
|
|
|
|
|
|
hr = IDirectMusicObject_QueryInterface(dmo, &IID_IUnknown, (void**)&unk);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %#lx\n", hr);
|
2014-01-10 10:54:48 +01:00
|
|
|
refcount = IUnknown_AddRef(unk);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(refcount == 5, "refcount == %lu, expected 5\n", refcount);
|
2014-01-10 10:54:48 +01:00
|
|
|
refcount = IUnknown_Release(unk);
|
|
|
|
|
|
|
|
/* IDirectMusicAudioPath still not supported */
|
|
|
|
hr = IDirectMusicObject_QueryInterface(dmo, &IID_IDirectMusicAudioPath, (void**)&dmap);
|
|
|
|
todo_wine ok(FAILED(hr) && !dmap,
|
2022-02-08 23:14:47 +01:00
|
|
|
"Unexpected IDirectMusicAudioPath interface: hr=%#lx, iface=%p\n", hr, dmap);
|
2014-01-10 10:54:48 +01:00
|
|
|
|
|
|
|
while (IDirectMusicObject_Release(dmo));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-01-10 10:48:05 +01:00
|
|
|
static void test_COM_graph(void)
|
|
|
|
{
|
|
|
|
IDirectMusicGraph *dmg = (IDirectMusicGraph*)0xdeadbeef;
|
|
|
|
IDirectMusicObject *dmo;
|
|
|
|
IPersistStream *ps;
|
|
|
|
IUnknown *unk;
|
|
|
|
ULONG refcount;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
/* COM aggregation */
|
2017-04-24 20:19:16 +02:00
|
|
|
hr = CoCreateInstance(&CLSID_DirectMusicGraph, (IUnknown *)0xdeadbeef, CLSCTX_INPROC_SERVER,
|
2014-01-10 10:48:05 +01:00
|
|
|
&IID_IUnknown, (void**)&dmg);
|
|
|
|
ok(hr == CLASS_E_NOAGGREGATION,
|
2022-02-08 23:14:47 +01:00
|
|
|
"DirectMusicGraph create failed: %#lx, expected CLASS_E_NOAGGREGATION\n", hr);
|
2014-01-10 10:48:05 +01:00
|
|
|
ok(!dmg, "dmg = %p\n", dmg);
|
|
|
|
|
|
|
|
/* Invalid RIID */
|
|
|
|
hr = CoCreateInstance(&CLSID_DirectMusicGraph, NULL, CLSCTX_INPROC_SERVER, &IID_IClassFactory,
|
|
|
|
(void**)&dmg);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOINTERFACE, "DirectMusicGraph create failed: %#lx, expected E_NOINTERFACE\n", hr);
|
2014-01-10 10:48:05 +01:00
|
|
|
|
|
|
|
/* Same refcount for all DirectMusicGraph interfaces */
|
|
|
|
hr = CoCreateInstance(&CLSID_DirectMusicGraph, NULL, CLSCTX_INPROC_SERVER,
|
|
|
|
&IID_IDirectMusicGraph, (void**)&dmg);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "DirectMusicGraph create failed: %#lx, expected S_OK\n", hr);
|
2014-01-10 10:48:05 +01:00
|
|
|
refcount = IDirectMusicGraph_AddRef(dmg);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(refcount == 2, "refcount == %lu, expected 2\n", refcount);
|
2014-01-10 10:48:05 +01:00
|
|
|
|
|
|
|
hr = IDirectMusicGraph_QueryInterface(dmg, &IID_IDirectMusicObject, (void**)&dmo);
|
|
|
|
if (hr == E_NOINTERFACE) {
|
|
|
|
win_skip("DirectMusicGraph without IDirectMusicObject\n");
|
|
|
|
return;
|
|
|
|
}
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "QueryInterface for IID_IDirectMusicObject failed: %#lx\n", hr);
|
2014-01-10 10:48:05 +01:00
|
|
|
refcount = IDirectMusicObject_AddRef(dmo);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(refcount == 4, "refcount == %lu, expected 4\n", refcount);
|
2014-01-10 10:48:05 +01:00
|
|
|
refcount = IDirectMusicObject_Release(dmo);
|
|
|
|
|
|
|
|
hr = IDirectMusicGraph_QueryInterface(dmg, &IID_IPersistStream, (void**)&ps);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "QueryInterface for IID_IPersistStream failed: %#lx\n", hr);
|
2014-01-10 10:48:05 +01:00
|
|
|
refcount = IPersistStream_AddRef(ps);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(refcount == 5, "refcount == %lu, expected 5\n", refcount);
|
2014-01-10 10:48:05 +01:00
|
|
|
refcount = IPersistStream_Release(ps);
|
|
|
|
|
|
|
|
hr = IDirectMusicGraph_QueryInterface(dmg, &IID_IUnknown, (void**)&unk);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %#lx\n", hr);
|
2014-01-10 10:48:05 +01:00
|
|
|
refcount = IUnknown_AddRef(unk);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(refcount == 6, "refcount == %lu, expected 6\n", refcount);
|
2014-01-10 10:48:05 +01:00
|
|
|
refcount = IUnknown_Release(unk);
|
|
|
|
|
|
|
|
while (IDirectMusicGraph_Release(dmg));
|
|
|
|
}
|
|
|
|
|
2014-01-10 10:42:57 +01:00
|
|
|
static void test_COM_segment(void)
|
|
|
|
{
|
|
|
|
IDirectMusicSegment8 *dms = (IDirectMusicSegment8*)0xdeadbeef;
|
|
|
|
IDirectMusicObject *dmo;
|
|
|
|
IPersistStream *stream;
|
|
|
|
IUnknown *unk;
|
|
|
|
ULONG refcount;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
/* COM aggregation */
|
2017-04-24 20:19:16 +02:00
|
|
|
hr = CoCreateInstance(&CLSID_DirectMusicSegment, (IUnknown *)0xdeadbeef, CLSCTX_INPROC_SERVER,
|
2014-01-10 10:42:57 +01:00
|
|
|
&IID_IUnknown, (void**)&dms);
|
|
|
|
ok(hr == CLASS_E_NOAGGREGATION,
|
2022-02-08 23:14:47 +01:00
|
|
|
"DirectMusicSegment create failed: %#lx, expected CLASS_E_NOAGGREGATION\n", hr);
|
2014-01-10 10:42:57 +01:00
|
|
|
ok(!dms, "dms = %p\n", dms);
|
|
|
|
|
|
|
|
/* Invalid RIID */
|
|
|
|
hr = CoCreateInstance(&CLSID_DirectMusicSegment, NULL, CLSCTX_INPROC_SERVER,
|
|
|
|
&IID_IDirectSound, (void**)&dms);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOINTERFACE, "DirectMusicSegment create failed: %#lx, expected E_NOINTERFACE\n", hr);
|
2014-01-10 10:42:57 +01:00
|
|
|
|
|
|
|
/* Same refcount */
|
|
|
|
hr = CoCreateInstance(&CLSID_DirectMusicSegment, NULL, CLSCTX_INPROC_SERVER,
|
|
|
|
&IID_IDirectMusicSegment8, (void**)&dms);
|
|
|
|
if (hr == E_NOINTERFACE) {
|
|
|
|
win_skip("DirectMusicSegment without IDirectMusicSegment8\n");
|
|
|
|
return;
|
|
|
|
}
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "DirectMusicSegment create failed: %#lx, expected S_OK\n", hr);
|
2014-01-10 10:42:57 +01:00
|
|
|
refcount = IDirectMusicSegment8_AddRef(dms);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok (refcount == 2, "refcount == %lu, expected 2\n", refcount);
|
2014-01-10 10:42:57 +01:00
|
|
|
hr = IDirectMusicSegment8_QueryInterface(dms, &IID_IDirectMusicObject, (void**)&dmo);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "QueryInterface for IID_IDirectMusicObject failed: %#lx\n", hr);
|
2014-01-10 10:42:57 +01:00
|
|
|
IDirectMusicSegment8_AddRef(dms);
|
|
|
|
refcount = IDirectMusicSegment8_Release(dms);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok (refcount == 3, "refcount == %lu, expected 3\n", refcount);
|
2014-01-10 10:42:57 +01:00
|
|
|
hr = IDirectMusicSegment8_QueryInterface(dms, &IID_IPersistStream, (void**)&stream);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "QueryInterface for IID_IPersistStream failed: %#lx\n", hr);
|
2014-01-10 10:42:57 +01:00
|
|
|
refcount = IDirectMusicSegment8_Release(dms);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok (refcount == 3, "refcount == %lu, expected 3\n", refcount);
|
2014-01-10 10:42:57 +01:00
|
|
|
hr = IDirectMusicSegment8_QueryInterface(dms, &IID_IUnknown, (void**)&unk);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %#lx\n", hr);
|
2014-01-10 10:42:57 +01:00
|
|
|
refcount = IUnknown_Release(unk);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok (refcount == 3, "refcount == %lu, expected 3\n", refcount);
|
2014-01-10 10:42:57 +01:00
|
|
|
refcount = IDirectMusicObject_Release(dmo);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok (refcount == 2, "refcount == %lu, expected 2\n", refcount);
|
2014-01-10 10:42:57 +01:00
|
|
|
refcount = IPersistStream_Release(stream);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok (refcount == 1, "refcount == %lu, expected 1\n", refcount);
|
2014-01-10 10:42:57 +01:00
|
|
|
refcount = IDirectMusicSegment8_Release(dms);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok (refcount == 0, "refcount == %lu, expected 0\n", refcount);
|
2014-01-10 10:42:57 +01:00
|
|
|
}
|
|
|
|
|
2014-01-10 10:44:34 +01:00
|
|
|
static void test_COM_segmentstate(void)
|
|
|
|
{
|
|
|
|
IDirectMusicSegmentState8 *dmss8 = (IDirectMusicSegmentState8*)0xdeadbeef;
|
|
|
|
IUnknown *unk;
|
|
|
|
ULONG refcount;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
/* COM aggregation */
|
2017-04-24 20:19:16 +02:00
|
|
|
hr = CoCreateInstance(&CLSID_DirectMusicSegmentState, (IUnknown *)0xdeadbeef, CLSCTX_INPROC_SERVER,
|
2014-01-10 10:44:34 +01:00
|
|
|
&IID_IUnknown, (void**)&dmss8);
|
|
|
|
ok(hr == CLASS_E_NOAGGREGATION,
|
2022-02-08 23:14:47 +01:00
|
|
|
"DirectMusicSegmentState8 create failed: %#lx, expected CLASS_E_NOAGGREGATION\n", hr);
|
2014-01-10 10:44:34 +01:00
|
|
|
ok(!dmss8, "dmss8 = %p\n", dmss8);
|
|
|
|
|
|
|
|
/* Invalid RIID */
|
|
|
|
hr = CoCreateInstance(&CLSID_DirectMusicSegmentState, NULL, CLSCTX_INPROC_SERVER,
|
|
|
|
&IID_IDirectMusicObject, (void**)&dmss8);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOINTERFACE, "DirectMusicSegmentState8 create failed: %#lx, expected E_NOINTERFACE\n", hr);
|
2014-01-10 10:44:34 +01:00
|
|
|
|
|
|
|
/* Same refcount for all DirectMusicSegmentState interfaces */
|
|
|
|
hr = CoCreateInstance(&CLSID_DirectMusicSegmentState, NULL, CLSCTX_INPROC_SERVER,
|
|
|
|
&IID_IDirectMusicSegmentState8, (void**)&dmss8);
|
|
|
|
if (hr == E_NOINTERFACE) {
|
|
|
|
win_skip("DirectMusicSegmentState without IDirectMusicSegmentState8\n");
|
|
|
|
return;
|
|
|
|
}
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "DirectMusicSegmentState8 create failed: %#lx, expected S_OK\n", hr);
|
2014-01-10 10:44:34 +01:00
|
|
|
refcount = IDirectMusicSegmentState8_AddRef(dmss8);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(refcount == 2, "refcount == %lu, expected 2\n", refcount);
|
2014-01-10 10:44:34 +01:00
|
|
|
|
|
|
|
hr = IDirectMusicSegmentState8_QueryInterface(dmss8, &IID_IUnknown, (void**)&unk);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %#lx\n", hr);
|
2014-01-10 10:44:34 +01:00
|
|
|
refcount = IUnknown_AddRef(unk);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(refcount == 4, "refcount == %lu, expected 4\n", refcount);
|
2014-01-10 10:44:34 +01:00
|
|
|
refcount = IUnknown_Release(unk);
|
|
|
|
|
2014-05-04 18:35:15 +02:00
|
|
|
hr = IDirectMusicSegmentState8_QueryInterface(dmss8, &IID_IUnknown, NULL);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_POINTER, "got %#lx\n", hr);
|
2014-05-04 18:35:15 +02:00
|
|
|
|
2014-01-10 10:44:34 +01:00
|
|
|
while (IDirectMusicSegmentState8_Release(dmss8));
|
|
|
|
}
|
|
|
|
|
2014-01-10 10:47:03 +01:00
|
|
|
static void test_COM_track(void)
|
|
|
|
{
|
2015-07-02 11:49:22 +02:00
|
|
|
IDirectMusicTrack *dmt;
|
2014-01-10 10:47:03 +01:00
|
|
|
IDirectMusicTrack8 *dmt8;
|
|
|
|
IPersistStream *ps;
|
|
|
|
IUnknown *unk;
|
|
|
|
ULONG refcount;
|
|
|
|
HRESULT hr;
|
|
|
|
#define X(class) &CLSID_ ## class, #class
|
|
|
|
const struct {
|
|
|
|
REFCLSID clsid;
|
|
|
|
const char *name;
|
2015-07-02 11:49:22 +02:00
|
|
|
BOOL has_dmt8;
|
2014-01-10 10:47:03 +01:00
|
|
|
} class[] = {
|
2015-07-02 11:49:22 +02:00
|
|
|
{ X(DirectMusicLyricsTrack), TRUE },
|
|
|
|
{ X(DirectMusicMarkerTrack), FALSE },
|
|
|
|
{ X(DirectMusicParamControlTrack), TRUE },
|
|
|
|
{ X(DirectMusicSegmentTriggerTrack), TRUE },
|
|
|
|
{ X(DirectMusicSeqTrack), TRUE },
|
|
|
|
{ X(DirectMusicSysExTrack), TRUE },
|
|
|
|
{ X(DirectMusicTempoTrack), TRUE },
|
|
|
|
{ X(DirectMusicTimeSigTrack), FALSE },
|
|
|
|
{ X(DirectMusicWaveTrack), TRUE }
|
2014-01-10 10:47:03 +01:00
|
|
|
};
|
|
|
|
#undef X
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_SIZE(class); i++) {
|
2015-07-02 11:49:22 +02:00
|
|
|
trace("Testing %s\n", class[i].name);
|
2014-01-10 10:47:03 +01:00
|
|
|
/* COM aggregation */
|
|
|
|
dmt8 = (IDirectMusicTrack8*)0xdeadbeef;
|
2017-04-24 20:19:16 +02:00
|
|
|
hr = CoCreateInstance(class[i].clsid, (IUnknown *)0xdeadbeef, CLSCTX_INPROC_SERVER, &IID_IUnknown,
|
2014-01-10 10:47:03 +01:00
|
|
|
(void**)&dmt8);
|
|
|
|
if (hr == REGDB_E_CLASSNOTREG) {
|
|
|
|
win_skip("%s not registered\n", class[i].name);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
ok(hr == CLASS_E_NOAGGREGATION,
|
2022-02-08 23:14:47 +01:00
|
|
|
"%s create failed: %#lx, expected CLASS_E_NOAGGREGATION\n", class[i].name, hr);
|
2014-01-10 10:47:03 +01:00
|
|
|
ok(!dmt8, "dmt8 = %p\n", dmt8);
|
|
|
|
|
|
|
|
/* Invalid RIID */
|
|
|
|
hr = CoCreateInstance(class[i].clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicObject,
|
|
|
|
(void**)&dmt8);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOINTERFACE, "%s create failed: %#lx, expected E_NOINTERFACE\n", class[i].name, hr);
|
2014-01-10 10:47:03 +01:00
|
|
|
|
|
|
|
/* Same refcount for all DirectMusicTrack interfaces */
|
2015-07-02 11:49:22 +02:00
|
|
|
hr = CoCreateInstance(class[i].clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicTrack,
|
|
|
|
(void**)&dmt);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "%s create failed: %#lx, expected S_OK\n", class[i].name, hr);
|
2015-07-02 11:49:22 +02:00
|
|
|
refcount = IDirectMusicTrack_AddRef(dmt);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(refcount == 2, "refcount == %lu, expected 2\n", refcount);
|
2014-01-10 10:47:03 +01:00
|
|
|
|
2015-07-02 11:49:22 +02:00
|
|
|
hr = IDirectMusicTrack_QueryInterface(dmt, &IID_IPersistStream, (void**)&ps);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "QueryInterface for IID_IPersistStream failed: %#lx\n", hr);
|
2014-01-10 10:47:03 +01:00
|
|
|
refcount = IPersistStream_AddRef(ps);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(refcount == 4, "refcount == %lu, expected 4\n", refcount);
|
2015-01-15 12:09:15 +01:00
|
|
|
IPersistStream_Release(ps);
|
2014-01-10 10:47:03 +01:00
|
|
|
|
2015-07-02 11:49:22 +02:00
|
|
|
hr = IDirectMusicTrack_QueryInterface(dmt, &IID_IUnknown, (void**)&unk);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %#lx\n", hr);
|
2014-01-10 10:47:03 +01:00
|
|
|
refcount = IUnknown_AddRef(unk);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(refcount == 5, "refcount == %lu, expected 5\n", refcount);
|
2014-01-10 10:47:03 +01:00
|
|
|
refcount = IUnknown_Release(unk);
|
|
|
|
|
2015-07-02 11:49:22 +02:00
|
|
|
hr = IDirectMusicTrack_QueryInterface(dmt, &IID_IDirectMusicTrack8, (void**)&dmt8);
|
|
|
|
if (class[i].has_dmt8) {
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "QueryInterface for IID_IDirectMusicTrack8 failed: %#lx\n", hr);
|
2015-07-02 11:49:22 +02:00
|
|
|
refcount = IDirectMusicTrack8_AddRef(dmt8);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(refcount == 6, "refcount == %lu, expected 6\n", refcount);
|
2015-07-02 11:49:22 +02:00
|
|
|
refcount = IDirectMusicTrack8_Release(dmt8);
|
|
|
|
} else {
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOINTERFACE, "QueryInterface for IID_IDirectMusicTrack8 failed: %#lx\n", hr);
|
2015-07-02 11:49:22 +02:00
|
|
|
refcount = IDirectMusicTrack_AddRef(dmt);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(refcount == 5, "refcount == %lu, expected 5\n", refcount);
|
2015-07-02 11:49:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
while (IDirectMusicTrack_Release(dmt));
|
2014-01-10 10:47:03 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-30 23:08:01 +02:00
|
|
|
static void test_audiopathconfig(void)
|
|
|
|
{
|
|
|
|
IDirectMusicObject *dmo;
|
|
|
|
IPersistStream *ps;
|
|
|
|
CLSID class = { 0 };
|
|
|
|
ULARGE_INTEGER size;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
hr = CoCreateInstance(&CLSID_DirectMusicAudioPathConfig, NULL, CLSCTX_INPROC_SERVER,
|
|
|
|
&IID_IDirectMusicObject, (void**)&dmo);
|
2014-07-27 04:31:42 +02:00
|
|
|
if (hr == REGDB_E_CLASSNOTREG) {
|
|
|
|
win_skip("DirectMusicAudioPathConfig not registered\n");
|
|
|
|
return;
|
|
|
|
}
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "DirectMusicAudioPathConfig create failed: %#lx, expected S_OK\n", hr);
|
2014-05-30 23:08:01 +02:00
|
|
|
|
|
|
|
/* IPersistStream */
|
|
|
|
hr = IDirectMusicObject_QueryInterface(dmo, &IID_IPersistStream, (void**)&ps);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "QueryInterface for IID_IPersistStream failed: %#lx\n", hr);
|
2014-05-30 23:08:01 +02:00
|
|
|
hr = IPersistStream_GetClassID(ps, &class);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "IPersistStream_GetClassID failed: %#lx\n", hr);
|
2015-06-15 01:19:37 +02:00
|
|
|
ok(IsEqualGUID(&class, &CLSID_DirectMusicAudioPathConfig),
|
2014-05-30 23:08:01 +02:00
|
|
|
"Expected class CLSID_DirectMusicAudioPathConfig got %s\n", wine_dbgstr_guid(&class));
|
|
|
|
|
|
|
|
/* Unimplemented IPersistStream methods */
|
|
|
|
hr = IPersistStream_IsDirty(ps);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_FALSE, "IPersistStream_IsDirty failed: %#lx\n", hr);
|
2014-05-30 23:08:01 +02:00
|
|
|
hr = IPersistStream_GetSizeMax(ps, &size);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOTIMPL, "IPersistStream_GetSizeMax failed: %#lx\n", hr);
|
2014-05-30 23:08:01 +02:00
|
|
|
hr = IPersistStream_Save(ps, NULL, TRUE);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOTIMPL, "IPersistStream_Save failed: %#lx\n", hr);
|
2014-05-30 23:08:01 +02:00
|
|
|
|
|
|
|
while (IDirectMusicObject_Release(dmo));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_graph(void)
|
|
|
|
{
|
|
|
|
IDirectMusicGraph *dmg;
|
|
|
|
IPersistStream *ps;
|
|
|
|
CLSID class = { 0 };
|
|
|
|
ULARGE_INTEGER size;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
hr = CoCreateInstance(&CLSID_DirectMusicGraph, NULL, CLSCTX_INPROC_SERVER,
|
|
|
|
&IID_IDirectMusicGraph, (void**)&dmg);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "DirectMusicGraph create failed: %#lx, expected S_OK\n", hr);
|
2014-05-30 23:08:01 +02:00
|
|
|
|
|
|
|
/* IPersistStream */
|
|
|
|
hr = IDirectMusicGraph_QueryInterface(dmg, &IID_IPersistStream, (void**)&ps);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "QueryInterface for IID_IPersistStream failed: %#lx\n", hr);
|
2014-05-30 23:08:01 +02:00
|
|
|
hr = IPersistStream_GetClassID(ps, &class);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK || broken(hr == E_NOTIMPL) /* win2k */, "IPersistStream_GetClassID failed: %#lx\n", hr);
|
2015-04-26 23:45:00 +02:00
|
|
|
if (hr == S_OK)
|
|
|
|
ok(IsEqualGUID(&class, &CLSID_DirectMusicGraph),
|
|
|
|
"Expected class CLSID_DirectMusicGraph got %s\n", wine_dbgstr_guid(&class));
|
2014-05-30 23:08:01 +02:00
|
|
|
|
|
|
|
/* Unimplemented IPersistStream methods */
|
|
|
|
hr = IPersistStream_IsDirty(ps);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_FALSE, "IPersistStream_IsDirty failed: %#lx\n", hr);
|
2014-05-30 23:08:01 +02:00
|
|
|
hr = IPersistStream_GetSizeMax(ps, &size);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOTIMPL, "IPersistStream_GetSizeMax failed: %#lx\n", hr);
|
2014-05-30 23:08:01 +02:00
|
|
|
hr = IPersistStream_Save(ps, NULL, TRUE);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOTIMPL, "IPersistStream_Save failed: %#lx\n", hr);
|
2014-05-30 23:08:01 +02:00
|
|
|
|
|
|
|
while (IDirectMusicGraph_Release(dmg));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_segment(void)
|
|
|
|
{
|
|
|
|
IDirectMusicSegment *dms;
|
|
|
|
IPersistStream *ps;
|
|
|
|
CLSID class = { 0 };
|
|
|
|
ULARGE_INTEGER size;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
hr = CoCreateInstance(&CLSID_DirectMusicSegment, NULL, CLSCTX_INPROC_SERVER,
|
|
|
|
&IID_IDirectMusicSegment, (void**)&dms);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "DirectMusicSegment create failed: %#lx, expected S_OK\n", hr);
|
2014-05-30 23:08:01 +02:00
|
|
|
|
|
|
|
/* IPersistStream */
|
|
|
|
hr = IDirectMusicSegment_QueryInterface(dms, &IID_IPersistStream, (void**)&ps);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "QueryInterface for IID_IPersistStream failed: %#lx\n", hr);
|
2014-05-30 23:08:01 +02:00
|
|
|
hr = IPersistStream_GetClassID(ps, &class);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK || broken(hr == E_NOTIMPL) /* win2k */, "IPersistStream_GetClassID failed: %#lx\n", hr);
|
2015-04-26 23:45:00 +02:00
|
|
|
if (hr == S_OK)
|
|
|
|
ok(IsEqualGUID(&class, &CLSID_DirectMusicSegment),
|
|
|
|
"Expected class CLSID_DirectMusicSegment got %s\n", wine_dbgstr_guid(&class));
|
2014-05-30 23:08:01 +02:00
|
|
|
|
|
|
|
/* Unimplemented IPersistStream methods */
|
|
|
|
hr = IPersistStream_IsDirty(ps);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_FALSE, "IPersistStream_IsDirty failed: %#lx\n", hr);
|
2014-05-30 23:08:01 +02:00
|
|
|
hr = IPersistStream_GetSizeMax(ps, &size);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOTIMPL, "IPersistStream_GetSizeMax failed: %#lx\n", hr);
|
2014-05-30 23:08:01 +02:00
|
|
|
hr = IPersistStream_Save(ps, NULL, TRUE);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOTIMPL, "IPersistStream_Save failed: %#lx\n", hr);
|
2014-05-30 23:08:01 +02:00
|
|
|
|
|
|
|
while (IDirectMusicSegment_Release(dms));
|
|
|
|
}
|
|
|
|
|
2019-11-27 00:49:54 +01:00
|
|
|
static void _add_track(IDirectMusicSegment8 *seg, REFCLSID class, const char *name, DWORD group)
|
|
|
|
{
|
|
|
|
IDirectMusicTrack *track;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
hr = CoCreateInstance(class, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicTrack,
|
|
|
|
(void**)&track);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "%s create failed: %#lx, expected S_OK\n", name, hr);
|
2019-11-27 00:49:54 +01:00
|
|
|
hr = IDirectMusicSegment8_InsertTrack(seg, track, group);
|
|
|
|
if (group)
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "Inserting %s failed: %#lx, expected S_OK\n", name, hr);
|
2019-11-27 00:49:54 +01:00
|
|
|
else
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_INVALIDARG, "Inserting %s failed: %#lx, expected E_INVALIDARG\n", name, hr);
|
2019-11-27 00:49:54 +01:00
|
|
|
IDirectMusicTrack_Release(track);
|
|
|
|
}
|
|
|
|
|
|
|
|
#define add_track(seg, class, group) _add_track(seg, &CLSID_DirectMusic ## class, #class, group)
|
|
|
|
|
|
|
|
static void _expect_track(IDirectMusicSegment8 *seg, REFCLSID expect, const char *name, DWORD group,
|
2019-12-08 18:53:51 +01:00
|
|
|
DWORD index, BOOL ignore_guid)
|
2019-11-27 00:49:54 +01:00
|
|
|
{
|
|
|
|
IDirectMusicTrack *track;
|
|
|
|
IPersistStream *ps;
|
|
|
|
CLSID class;
|
|
|
|
HRESULT hr;
|
|
|
|
|
2019-12-08 18:53:51 +01:00
|
|
|
if (ignore_guid)
|
|
|
|
hr = IDirectMusicSegment8_GetTrack(seg, &GUID_NULL, group, index, &track);
|
|
|
|
else
|
|
|
|
hr = IDirectMusicSegment8_GetTrack(seg, expect, group, index, &track);
|
2019-11-27 00:49:54 +01:00
|
|
|
if (!expect) {
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == DMUS_E_NOT_FOUND, "GetTrack failed: %#lx, expected DMUS_E_NOT_FOUND\n", hr);
|
2019-11-27 00:49:54 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "GetTrack failed: %#lx, expected S_OK\n", hr);
|
2019-11-27 00:49:54 +01:00
|
|
|
hr = IDirectMusicTrack_QueryInterface(track, &IID_IPersistStream, (void**)&ps);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "QueryInterface for IID_IPersistStream failed: %#lx\n", hr);
|
2019-11-27 00:49:54 +01:00
|
|
|
hr = IPersistStream_GetClassID(ps, &class);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "IPersistStream_GetClassID failed: %#lx\n", hr);
|
|
|
|
ok(IsEqualGUID(&class, expect), "For group %#lx index %lu: Expected class %s got %s\n",
|
2019-11-27 00:49:54 +01:00
|
|
|
group, index, name, wine_dbgstr_guid(&class));
|
|
|
|
|
|
|
|
IPersistStream_Release(ps);
|
|
|
|
IDirectMusicTrack_Release(track);
|
|
|
|
}
|
|
|
|
|
2019-12-08 18:53:51 +01:00
|
|
|
#define expect_track(seg, class, group, index) \
|
|
|
|
_expect_track(seg, &CLSID_DirectMusic ## class, #class, group, index, TRUE)
|
|
|
|
#define expect_guid_track(seg, class, group, index) \
|
|
|
|
_expect_track(seg, &CLSID_DirectMusic ## class, #class, group, index, FALSE)
|
2019-11-27 00:49:54 +01:00
|
|
|
|
2019-12-08 18:53:51 +01:00
|
|
|
static void test_gettrack(void)
|
2019-11-27 00:49:54 +01:00
|
|
|
{
|
|
|
|
IDirectMusicSegment8 *seg;
|
|
|
|
IDirectMusicTrack *track;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
hr = CoCreateInstance(&CLSID_DirectMusicSegment, NULL, CLSCTX_INPROC_SERVER,
|
|
|
|
&IID_IDirectMusicSegment8, (void**)&seg);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "DirectMusicSegment create failed: %#lx, expected S_OK\n", hr);
|
2019-11-27 00:49:54 +01:00
|
|
|
|
|
|
|
add_track(seg, LyricsTrack, 0x0); /* failure */
|
|
|
|
add_track(seg, LyricsTrack, 0x1); /* idx 0 group 1 */
|
|
|
|
add_track(seg, ParamControlTrack, 0x3); /* idx 1 group 1, idx 0 group 2 */
|
|
|
|
add_track(seg, SegmentTriggerTrack, 0x2); /* idx 1 group 2 */
|
|
|
|
add_track(seg, SeqTrack, 0x1); /* idx 2 group 1 */
|
|
|
|
add_track(seg, TempoTrack, 0x7); /* idx 3 group 1, idx 2 group 2, idx 0 group 3 */
|
2019-12-08 18:53:51 +01:00
|
|
|
add_track(seg, WaveTrack, 0xffffffff); /* idx 4 group 1, idx 3 group 2, idx 1 group 3 */
|
2019-11-27 00:49:54 +01:00
|
|
|
|
2019-12-08 18:53:51 +01:00
|
|
|
/* Ignore GUID in GetTrack */
|
2019-11-27 00:49:54 +01:00
|
|
|
hr = IDirectMusicSegment8_GetTrack(seg, &GUID_NULL, 0, 0, &track);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == DMUS_E_NOT_FOUND, "GetTrack failed: %#lx, expected DMUS_E_NOT_FOUND\n", hr);
|
2019-11-27 00:49:54 +01:00
|
|
|
|
|
|
|
expect_track(seg, LyricsTrack, 0x1, 0);
|
|
|
|
expect_track(seg, ParamControlTrack, 0x1, 1);
|
|
|
|
expect_track(seg, SeqTrack, 0x1, 2);
|
|
|
|
expect_track(seg, TempoTrack, 0x1, 3);
|
2019-12-08 18:53:51 +01:00
|
|
|
expect_track(seg, WaveTrack, 0x1, 4);
|
|
|
|
_expect_track(seg, NULL, "", 0x1, 5, TRUE);
|
|
|
|
_expect_track(seg, NULL, "", 0x1, DMUS_SEG_ANYTRACK, TRUE);
|
2019-11-27 00:49:54 +01:00
|
|
|
expect_track(seg, ParamControlTrack, 0x2, 0);
|
2019-12-08 18:53:51 +01:00
|
|
|
expect_track(seg, WaveTrack, 0x80000000, 0);
|
2019-11-27 00:49:54 +01:00
|
|
|
expect_track(seg, SegmentTriggerTrack, 0x3, 2); /* groups 1+2 combined index */
|
|
|
|
expect_track(seg, SeqTrack, 0x3, 3); /* groups 1+2 combined index */
|
|
|
|
expect_track(seg, TempoTrack, 0x7, 4); /* groups 1+2+3 combined index */
|
|
|
|
expect_track(seg, TempoTrack, 0xffffffff, 4); /* all groups combined index */
|
2019-12-08 18:53:51 +01:00
|
|
|
_expect_track(seg, NULL, "", 0xffffffff, DMUS_SEG_ANYTRACK, TRUE);
|
|
|
|
|
|
|
|
/* Use the GUID in GetTrack */
|
|
|
|
hr = IDirectMusicSegment8_GetTrack(seg, &CLSID_DirectMusicLyricsTrack, 0, 0, &track);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == DMUS_E_NOT_FOUND, "GetTrack failed: %#lx, expected DMUS_E_NOT_FOUND\n", hr);
|
2019-12-08 18:53:51 +01:00
|
|
|
|
|
|
|
expect_guid_track(seg, LyricsTrack, 0x1, 0);
|
|
|
|
expect_guid_track(seg, ParamControlTrack, 0x1, 0);
|
|
|
|
expect_guid_track(seg, SeqTrack, 0x1, 0);
|
|
|
|
expect_guid_track(seg, TempoTrack, 0x1, 0);
|
|
|
|
expect_guid_track(seg, ParamControlTrack, 0x2, 0);
|
|
|
|
expect_guid_track(seg, SegmentTriggerTrack, 0x3, 0);
|
|
|
|
expect_guid_track(seg, SeqTrack, 0x3, 0);
|
|
|
|
expect_guid_track(seg, TempoTrack, 0x7, 0);
|
|
|
|
expect_guid_track(seg, TempoTrack, 0xffffffff, 0);
|
2019-11-27 00:49:54 +01:00
|
|
|
|
|
|
|
IDirectMusicSegment8_Release(seg);
|
|
|
|
}
|
|
|
|
|
2019-12-08 18:53:53 +01:00
|
|
|
static void test_segment_param(void)
|
|
|
|
{
|
|
|
|
IDirectMusicSegment8 *seg;
|
|
|
|
char buf[64];
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
hr = CoCreateInstance(&CLSID_DirectMusicSegment, NULL, CLSCTX_INPROC_SERVER,
|
|
|
|
&IID_IDirectMusicSegment8, (void **)&seg);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "DirectMusicSegment create failed: %#lx, expected S_OK\n", hr);
|
2019-12-08 18:53:53 +01:00
|
|
|
|
|
|
|
add_track(seg, LyricsTrack, 0x1); /* no params */
|
|
|
|
add_track(seg, SegmentTriggerTrack, 0x1); /* all params "supported" */
|
|
|
|
|
|
|
|
hr = IDirectMusicSegment8_GetParam(seg, NULL, 0x1, 0, 0, NULL, buf);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_POINTER, "GetParam failed: %#lx, expected E_POINTER\n", hr);
|
2019-12-08 18:53:53 +01:00
|
|
|
hr = IDirectMusicSegment8_SetParam(seg, NULL, 0x1, 0, 0, buf);
|
2022-02-08 23:14:47 +01:00
|
|
|
todo_wine ok(hr == E_POINTER, "SetParam failed: %#lx, expected E_POINTER\n", hr);
|
2019-12-08 18:53:53 +01:00
|
|
|
|
|
|
|
hr = IDirectMusicSegment8_GetParam(seg, &GUID_Valid_Start_Time, 0x1, 0, 0, NULL, buf);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == DMUS_E_GET_UNSUPPORTED, "GetParam failed: %#lx, expected DMUS_E_GET_UNSUPPORTED\n", hr);
|
2019-12-08 18:53:53 +01:00
|
|
|
hr = IDirectMusicSegment8_GetParam(seg, &GUID_Valid_Start_Time, 0x1, 1, 0, NULL, buf);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == DMUS_E_TRACK_NOT_FOUND, "GetParam failed: %#lx, expected DMUS_E_TRACK_NOT_FOUND\n", hr);
|
2019-12-08 18:53:53 +01:00
|
|
|
hr = IDirectMusicSegment8_GetParam(seg, &GUID_Valid_Start_Time, 0x1, DMUS_SEG_ANYTRACK, 0,
|
|
|
|
NULL, buf);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == DMUS_E_GET_UNSUPPORTED, "GetParam failed: %#lx, expected DMUS_E_GET_UNSUPPORTED\n", hr);
|
2019-12-08 18:53:53 +01:00
|
|
|
|
|
|
|
hr = IDirectMusicSegment8_SetParam(seg, &GUID_Valid_Start_Time, 0x1, 0, 0, buf);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "SetParam failed: %#lx, expected S_OK\n", hr);
|
2019-12-08 18:53:53 +01:00
|
|
|
hr = IDirectMusicSegment8_SetParam(seg, &GUID_Valid_Start_Time, 0x1, 1, 0, buf);
|
|
|
|
todo_wine ok(hr == DMUS_E_TRACK_NOT_FOUND,
|
2022-02-08 23:14:47 +01:00
|
|
|
"SetParam failed: %#lx, expected DMUS_E_TRACK_NOT_FOUND\n", hr);
|
2019-12-08 18:53:53 +01:00
|
|
|
hr = IDirectMusicSegment8_SetParam(seg, &GUID_Valid_Start_Time, 0x1, DMUS_SEG_ALLTRACKS,
|
|
|
|
0, buf);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "SetParam failed: %#lx, expected S_OK\n", hr);
|
2019-12-08 18:53:53 +01:00
|
|
|
|
|
|
|
IDirectMusicSegment8_Release(seg);
|
|
|
|
}
|
|
|
|
|
2019-12-03 23:51:20 +01:00
|
|
|
static void expect_getparam(IDirectMusicTrack *track, REFGUID type, const char *name,
|
|
|
|
HRESULT expect)
|
|
|
|
{
|
|
|
|
HRESULT hr;
|
|
|
|
char buf[64] = { 0 };
|
|
|
|
|
|
|
|
hr = IDirectMusicTrack8_GetParam(track, type, 0, NULL, buf);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == expect, "GetParam(%s) failed: %#lx, expected %#lx\n", name, hr, expect);
|
2019-12-03 23:51:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void expect_setparam(IDirectMusicTrack *track, REFGUID type, const char *name,
|
|
|
|
HRESULT expect)
|
|
|
|
{
|
|
|
|
HRESULT hr;
|
|
|
|
char buf[64] = { 0 };
|
|
|
|
|
|
|
|
hr = IDirectMusicTrack8_SetParam(track, type, 0, buf);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == expect, "SetParam(%s) failed: %#lx, expected %#lx\n", name, hr, expect);
|
2019-12-03 23:51:20 +01:00
|
|
|
}
|
|
|
|
|
2015-06-16 09:26:41 +02:00
|
|
|
static void test_track(void)
|
|
|
|
{
|
2015-07-02 11:49:22 +02:00
|
|
|
IDirectMusicTrack *dmt;
|
2015-07-06 00:05:56 +02:00
|
|
|
IDirectMusicTrack8 *dmt8;
|
2015-06-16 09:26:41 +02:00
|
|
|
IPersistStream *ps;
|
|
|
|
CLSID classid;
|
|
|
|
ULARGE_INTEGER size;
|
|
|
|
HRESULT hr;
|
2019-11-18 00:57:19 +01:00
|
|
|
#define X(guid) &guid, #guid
|
|
|
|
const struct {
|
|
|
|
REFGUID type;
|
|
|
|
const char *name;
|
|
|
|
} param_types[] = {
|
|
|
|
{ X(GUID_BandParam) },
|
|
|
|
{ X(GUID_ChordParam) },
|
|
|
|
{ X(GUID_Clear_All_Bands) },
|
|
|
|
{ X(GUID_CommandParam) },
|
|
|
|
{ X(GUID_CommandParam2) },
|
|
|
|
{ X(GUID_CommandParamNext) },
|
|
|
|
{ X(GUID_ConnectToDLSCollection) },
|
|
|
|
{ X(GUID_Disable_Auto_Download) },
|
|
|
|
{ X(GUID_DisableTempo) },
|
|
|
|
{ X(GUID_DisableTimeSig) },
|
|
|
|
{ X(GUID_Download) },
|
|
|
|
{ X(GUID_DownloadToAudioPath) },
|
|
|
|
{ X(GUID_Enable_Auto_Download) },
|
|
|
|
{ X(GUID_EnableTempo) },
|
|
|
|
{ X(GUID_EnableTimeSig) },
|
|
|
|
{ X(GUID_IDirectMusicBand) },
|
|
|
|
{ X(GUID_IDirectMusicChordMap) },
|
|
|
|
{ X(GUID_IDirectMusicStyle) },
|
|
|
|
{ X(GUID_MuteParam) },
|
|
|
|
{ X(GUID_Play_Marker) },
|
|
|
|
{ X(GUID_RhythmParam) },
|
|
|
|
{ X(GUID_SeedVariations) },
|
|
|
|
{ X(GUID_StandardMIDIFile) },
|
|
|
|
{ X(GUID_TempoParam) },
|
|
|
|
{ X(GUID_TimeSignature) },
|
|
|
|
{ X(GUID_Unload) },
|
|
|
|
{ X(GUID_UnloadFromAudioPath) },
|
|
|
|
{ X(GUID_Valid_Start_Time) },
|
|
|
|
{ X(GUID_Variations) },
|
|
|
|
{ X(GUID_NULL) }
|
|
|
|
};
|
|
|
|
#undef X
|
2015-06-16 09:26:41 +02:00
|
|
|
#define X(class) &CLSID_ ## class, #class
|
|
|
|
const struct {
|
|
|
|
REFCLSID clsid;
|
|
|
|
const char *name;
|
2019-11-18 00:57:19 +01:00
|
|
|
/* bitfield with supported param types */
|
|
|
|
unsigned int has_params;
|
2015-06-16 09:26:41 +02:00
|
|
|
} class[] = {
|
2019-11-18 00:57:19 +01:00
|
|
|
{ X(DirectMusicLyricsTrack), 0 },
|
|
|
|
{ X(DirectMusicMarkerTrack), 0x8080000 },
|
|
|
|
{ X(DirectMusicParamControlTrack), 0 },
|
|
|
|
{ X(DirectMusicSegmentTriggerTrack), 0x3fffffff },
|
|
|
|
{ X(DirectMusicSeqTrack), ~0 }, /* param methods not implemented */
|
|
|
|
{ X(DirectMusicSysExTrack), ~0 }, /* param methods not implemented */
|
|
|
|
{ X(DirectMusicTempoTrack), 0x802100 },
|
|
|
|
{ X(DirectMusicTimeSigTrack), 0x1004200 },
|
|
|
|
{ X(DirectMusicWaveTrack), 0x6001c80 }
|
2015-06-16 09:26:41 +02:00
|
|
|
};
|
|
|
|
#undef X
|
2019-11-18 00:57:19 +01:00
|
|
|
unsigned int i, j;
|
2015-06-16 09:26:41 +02:00
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_SIZE(class); i++) {
|
|
|
|
trace("Testing %s\n", class[i].name);
|
2015-07-02 11:49:22 +02:00
|
|
|
hr = CoCreateInstance(class[i].clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicTrack,
|
|
|
|
(void**)&dmt);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "%s create failed: %#lx, expected S_OK\n", class[i].name, hr);
|
2015-06-16 09:26:41 +02:00
|
|
|
|
2015-07-06 00:05:56 +02:00
|
|
|
/* IDirectMusicTrack */
|
2019-11-18 00:57:19 +01:00
|
|
|
if (class[i].has_params != ~0) {
|
|
|
|
for (j = 0; j < ARRAY_SIZE(param_types); j++) {
|
|
|
|
hr = IDirectMusicTrack8_IsParamSupported(dmt, param_types[j].type);
|
2019-12-03 23:51:20 +01:00
|
|
|
if (class[i].has_params & (1 << j)) {
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "IsParamSupported(%s) failed: %#lx, expected S_OK\n",
|
2019-11-18 00:57:19 +01:00
|
|
|
param_types[j].name, hr);
|
2019-12-03 23:51:20 +01:00
|
|
|
if (class[i].clsid == &CLSID_DirectMusicSegmentTriggerTrack) {
|
|
|
|
expect_getparam(dmt, param_types[j].type, param_types[j].name,
|
|
|
|
DMUS_E_GET_UNSUPPORTED);
|
|
|
|
expect_setparam(dmt, param_types[j].type, param_types[j].name, S_OK);
|
2019-12-03 23:51:21 +01:00
|
|
|
} else if (class[i].clsid == &CLSID_DirectMusicMarkerTrack)
|
|
|
|
expect_setparam(dmt, param_types[j].type, param_types[j].name,
|
|
|
|
DMUS_E_SET_UNSUPPORTED);
|
2019-12-03 23:51:22 +01:00
|
|
|
else if (class[i].clsid == &CLSID_DirectMusicWaveTrack)
|
|
|
|
expect_getparam(dmt, param_types[j].type, param_types[j].name,
|
|
|
|
DMUS_E_GET_UNSUPPORTED);
|
2019-12-03 23:51:26 +01:00
|
|
|
} else {
|
2019-11-18 00:57:19 +01:00
|
|
|
ok(hr == DMUS_E_TYPE_UNSUPPORTED,
|
2022-02-08 23:14:47 +01:00
|
|
|
"IsParamSupported(%s) failed: %#lx, expected DMUS_E_TYPE_UNSUPPORTED\n",
|
2019-11-18 00:57:19 +01:00
|
|
|
param_types[j].name, hr);
|
2019-12-03 23:51:26 +01:00
|
|
|
expect_getparam(dmt, param_types[j].type, param_types[j].name,
|
|
|
|
DMUS_E_GET_UNSUPPORTED);
|
|
|
|
if (class[i].clsid == &CLSID_DirectMusicWaveTrack)
|
|
|
|
expect_setparam(dmt, param_types[j].type, param_types[j].name,
|
|
|
|
DMUS_E_TYPE_UNSUPPORTED);
|
|
|
|
else
|
|
|
|
expect_setparam(dmt, param_types[j].type, param_types[j].name,
|
|
|
|
DMUS_E_SET_UNSUPPORTED);
|
|
|
|
}
|
|
|
|
|
2019-12-03 23:51:23 +01:00
|
|
|
/* GetParam / SetParam for IsParamSupported supported types */
|
|
|
|
if (class[i].clsid == &CLSID_DirectMusicTimeSigTrack) {
|
|
|
|
expect_getparam(dmt, &GUID_DisableTimeSig, "GUID_DisableTimeSig",
|
|
|
|
DMUS_E_GET_UNSUPPORTED);
|
|
|
|
expect_getparam(dmt, &GUID_EnableTimeSig, "GUID_EnableTimeSig",
|
|
|
|
DMUS_E_GET_UNSUPPORTED);
|
|
|
|
expect_setparam(dmt, &GUID_TimeSignature, "GUID_TimeSignature",
|
|
|
|
DMUS_E_SET_UNSUPPORTED);
|
2019-12-03 23:51:25 +01:00
|
|
|
} else if (class[i].clsid == &CLSID_DirectMusicTempoTrack) {
|
|
|
|
expect_getparam(dmt, &GUID_DisableTempo, "GUID_DisableTempo",
|
|
|
|
DMUS_E_GET_UNSUPPORTED);
|
|
|
|
expect_getparam(dmt, &GUID_EnableTempo, "GUID_EnableTempo",
|
|
|
|
DMUS_E_GET_UNSUPPORTED);
|
2019-12-03 23:51:23 +01:00
|
|
|
}
|
2019-11-18 00:57:19 +01:00
|
|
|
}
|
|
|
|
} else {
|
2015-07-06 00:05:56 +02:00
|
|
|
hr = IDirectMusicTrack_GetParam(dmt, NULL, 0, NULL, NULL);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOTIMPL, "IDirectMusicTrack_GetParam failed: %#lx\n", hr);
|
2015-07-06 00:05:56 +02:00
|
|
|
hr = IDirectMusicTrack_SetParam(dmt, NULL, 0, NULL);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOTIMPL, "IDirectMusicTrack_SetParam failed: %#lx\n", hr);
|
2015-07-06 00:05:56 +02:00
|
|
|
hr = IDirectMusicTrack_IsParamSupported(dmt, NULL);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOTIMPL, "IDirectMusicTrack_IsParamSupported failed: %#lx\n", hr);
|
2019-11-14 20:40:24 +01:00
|
|
|
|
|
|
|
hr = IDirectMusicTrack_IsParamSupported(dmt, &GUID_IDirectMusicStyle);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOTIMPL, "got: %#lx\n", hr);
|
2019-11-14 20:40:24 +01:00
|
|
|
}
|
2015-07-06 00:05:56 +02:00
|
|
|
if (class[i].clsid != &CLSID_DirectMusicMarkerTrack &&
|
|
|
|
class[i].clsid != &CLSID_DirectMusicTimeSigTrack) {
|
|
|
|
hr = IDirectMusicTrack_AddNotificationType(dmt, NULL);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOTIMPL, "IDirectMusicTrack_AddNotificationType failed: %#lx\n", hr);
|
2015-07-06 00:05:56 +02:00
|
|
|
hr = IDirectMusicTrack_RemoveNotificationType(dmt, NULL);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOTIMPL, "IDirectMusicTrack_RemoveNotificationType failed: %#lx\n", hr);
|
2015-07-06 00:05:56 +02:00
|
|
|
}
|
|
|
|
hr = IDirectMusicTrack_Clone(dmt, 0, 0, NULL);
|
2022-02-08 23:14:47 +01:00
|
|
|
todo_wine ok(hr == E_POINTER, "IDirectMusicTrack_Clone failed: %#lx\n", hr);
|
2015-07-06 00:05:56 +02:00
|
|
|
|
|
|
|
/* IDirectMusicTrack8 */
|
|
|
|
hr = IDirectMusicTrack_QueryInterface(dmt, &IID_IDirectMusicTrack8, (void**)&dmt8);
|
|
|
|
if (hr == S_OK) {
|
|
|
|
hr = IDirectMusicTrack8_PlayEx(dmt8, NULL, 0, 0, 0, 0, NULL, NULL, 0);
|
2022-02-08 23:14:47 +01:00
|
|
|
todo_wine ok(hr == E_POINTER, "IDirectMusicTrack8_PlayEx failed: %#lx\n", hr);
|
2019-11-18 00:57:19 +01:00
|
|
|
if (class[i].has_params == ~0) {
|
2015-07-06 00:05:56 +02:00
|
|
|
hr = IDirectMusicTrack8_GetParamEx(dmt8, NULL, 0, NULL, NULL, NULL, 0);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOTIMPL, "IDirectMusicTrack8_GetParamEx failed: %#lx\n", hr);
|
2015-07-06 00:05:56 +02:00
|
|
|
hr = IDirectMusicTrack8_SetParamEx(dmt8, NULL, 0, NULL, NULL, 0);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOTIMPL, "IDirectMusicTrack8_SetParamEx failed: %#lx\n", hr);
|
2015-07-06 00:05:56 +02:00
|
|
|
}
|
|
|
|
hr = IDirectMusicTrack8_Compose(dmt8, NULL, 0, NULL);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOTIMPL, "IDirectMusicTrack8_Compose failed: %#lx\n", hr);
|
2015-07-06 00:05:56 +02:00
|
|
|
hr = IDirectMusicTrack8_Join(dmt8, NULL, 0, NULL, 0, NULL);
|
|
|
|
if (class[i].clsid == &CLSID_DirectMusicTempoTrack)
|
2022-02-08 23:14:47 +01:00
|
|
|
todo_wine ok(hr == E_POINTER, "IDirectMusicTrack8_Join failed: %#lx\n", hr);
|
2015-07-06 00:05:56 +02:00
|
|
|
else
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOTIMPL, "IDirectMusicTrack8_Join failed: %#lx\n", hr);
|
2015-07-06 00:05:56 +02:00
|
|
|
IDirectMusicTrack8_Release(dmt8);
|
|
|
|
}
|
|
|
|
|
2015-06-16 09:26:41 +02:00
|
|
|
/* IPersistStream */
|
2015-07-02 11:49:22 +02:00
|
|
|
hr = IDirectMusicTrack_QueryInterface(dmt, &IID_IPersistStream, (void**)&ps);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "QueryInterface for IID_IPersistStream failed: %#lx\n", hr);
|
2015-06-16 09:26:41 +02:00
|
|
|
hr = IPersistStream_GetClassID(ps, &classid);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "IPersistStream_GetClassID failed: %#lx\n", hr);
|
2015-07-03 10:40:53 +02:00
|
|
|
ok(IsEqualGUID(&classid, class[i].clsid),
|
|
|
|
"Expected class %s got %s\n", class[i].name, wine_dbgstr_guid(&classid));
|
|
|
|
hr = IPersistStream_IsDirty(ps);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_FALSE, "IPersistStream_IsDirty failed: %#lx\n", hr);
|
2015-06-16 09:26:41 +02:00
|
|
|
|
|
|
|
/* Unimplemented IPersistStream methods */
|
|
|
|
hr = IPersistStream_GetSizeMax(ps, &size);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOTIMPL, "IPersistStream_GetSizeMax failed: %#lx\n", hr);
|
2015-06-16 09:26:41 +02:00
|
|
|
hr = IPersistStream_Save(ps, NULL, TRUE);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_NOTIMPL, "IPersistStream_Save failed: %#lx\n", hr);
|
2015-06-16 09:26:41 +02:00
|
|
|
|
2015-07-02 11:49:22 +02:00
|
|
|
while (IDirectMusicTrack_Release(dmt));
|
2015-06-16 09:26:41 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-02 01:16:08 +01:00
|
|
|
struct chunk {
|
|
|
|
FOURCC id;
|
|
|
|
DWORD size;
|
|
|
|
FOURCC type;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
|
|
|
|
|
|
|
|
/* Generate a RIFF file format stream from an array of FOURCC ids.
|
|
|
|
RIFF and LIST need to be followed by the form type respectively list type,
|
|
|
|
followed by the chunks of the list and terminated with 0. */
|
|
|
|
static IStream *gen_riff_stream(const FOURCC *ids)
|
|
|
|
{
|
|
|
|
static const LARGE_INTEGER zero;
|
|
|
|
int level = -1;
|
|
|
|
DWORD *sizes[4]; /* Stack for the sizes of RIFF and LIST chunks */
|
|
|
|
char riff[1024];
|
|
|
|
char *p = riff;
|
|
|
|
struct chunk *ck;
|
|
|
|
IStream *stream;
|
|
|
|
|
|
|
|
do {
|
|
|
|
ck = (struct chunk *)p;
|
|
|
|
ck->id = *ids++;
|
|
|
|
switch (ck->id) {
|
|
|
|
case 0:
|
|
|
|
*sizes[level] = p - (char *)sizes[level] - sizeof(DWORD);
|
|
|
|
level--;
|
|
|
|
break;
|
|
|
|
case FOURCC_LIST:
|
|
|
|
case FOURCC_RIFF:
|
|
|
|
level++;
|
|
|
|
sizes[level] = &ck->size;
|
|
|
|
ck->type = *ids++;
|
|
|
|
p += sizeof(*ck);
|
|
|
|
break;
|
|
|
|
case DMUS_FOURCC_GUID_CHUNK:
|
|
|
|
ck->size = sizeof(GUID_NULL);
|
|
|
|
p += CHUNK_HDR_SIZE;
|
|
|
|
memcpy(p, &GUID_NULL, sizeof(GUID_NULL));
|
|
|
|
p += ck->size;
|
|
|
|
break;
|
|
|
|
case DMUS_FOURCC_VERSION_CHUNK:
|
|
|
|
{
|
|
|
|
DMUS_VERSION ver = {5, 8};
|
|
|
|
|
|
|
|
ck->size = sizeof(ver);
|
|
|
|
p += CHUNK_HDR_SIZE;
|
|
|
|
memcpy(p, &ver, sizeof(ver));
|
|
|
|
p += ck->size;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
/* Just convert the FOURCC id to a WCHAR string */
|
|
|
|
WCHAR *s;
|
|
|
|
|
|
|
|
ck->size = 5 * sizeof(WCHAR);
|
|
|
|
p += CHUNK_HDR_SIZE;
|
|
|
|
s = (WCHAR *)p;
|
|
|
|
s[0] = (char)(ck->id);
|
|
|
|
s[1] = (char)(ck->id >> 8);
|
|
|
|
s[2] = (char)(ck->id >> 16);
|
|
|
|
s[3] = (char)(ck->id >> 24);
|
|
|
|
s[4] = 0;
|
|
|
|
p += ck->size;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} while (level >= 0);
|
|
|
|
|
|
|
|
ck = (struct chunk *)riff;
|
|
|
|
CreateStreamOnHGlobal(NULL, TRUE, &stream);
|
|
|
|
IStream_Write(stream, riff, ck->size + CHUNK_HDR_SIZE, NULL);
|
|
|
|
IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL);
|
|
|
|
|
|
|
|
return stream;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_parsedescriptor(void)
|
|
|
|
{
|
|
|
|
IDirectMusicObject *dmo;
|
|
|
|
IStream *stream;
|
|
|
|
DMUS_OBJECTDESC desc;
|
|
|
|
HRESULT hr;
|
|
|
|
DWORD valid;
|
|
|
|
unsigned int i;
|
|
|
|
/* fourcc ~0 will be replaced later on */
|
|
|
|
FOURCC alldesc[] =
|
|
|
|
{
|
|
|
|
FOURCC_RIFF, ~0, DMUS_FOURCC_CATEGORY_CHUNK, FOURCC_LIST, DMUS_FOURCC_UNFO_LIST,
|
|
|
|
DMUS_FOURCC_UNAM_CHUNK, DMUS_FOURCC_UCOP_CHUNK, DMUS_FOURCC_UCMT_CHUNK,
|
|
|
|
DMUS_FOURCC_USBJ_CHUNK, 0, DMUS_FOURCC_VERSION_CHUNK, DMUS_FOURCC_GUID_CHUNK, 0
|
|
|
|
};
|
|
|
|
FOURCC dupes[] =
|
|
|
|
{
|
|
|
|
FOURCC_RIFF, ~0, DMUS_FOURCC_CATEGORY_CHUNK, DMUS_FOURCC_CATEGORY_CHUNK,
|
|
|
|
DMUS_FOURCC_VERSION_CHUNK, DMUS_FOURCC_VERSION_CHUNK, DMUS_FOURCC_GUID_CHUNK,
|
|
|
|
DMUS_FOURCC_GUID_CHUNK, FOURCC_LIST, DMUS_FOURCC_UNFO_LIST, DMUS_FOURCC_UNAM_CHUNK, 0,
|
|
|
|
FOURCC_LIST, DMUS_FOURCC_UNFO_LIST, mmioFOURCC('I','N','A','M'), 0, 0
|
|
|
|
};
|
|
|
|
FOURCC empty[] = {FOURCC_RIFF, ~0, 0};
|
|
|
|
FOURCC inam[] = {FOURCC_RIFF, ~0, FOURCC_LIST, ~0, mmioFOURCC('I','N','A','M'), 0, 0};
|
2018-03-15 00:09:33 +01:00
|
|
|
FOURCC noriff[] = {mmioFOURCC('J','U','N','K'), 0};
|
2018-03-06 01:07:25 +01:00
|
|
|
#define X(class) &CLSID_ ## class, #class
|
|
|
|
#define Y(form) form, #form
|
2018-03-02 01:16:08 +01:00
|
|
|
const struct {
|
2018-03-06 01:07:25 +01:00
|
|
|
REFCLSID clsid;
|
|
|
|
const char *class;
|
2018-03-02 01:16:08 +01:00
|
|
|
FOURCC form;
|
|
|
|
const char *name;
|
2018-03-06 01:07:25 +01:00
|
|
|
BOOL needs_size;
|
2018-03-02 01:16:08 +01:00
|
|
|
} forms[] = {
|
2018-03-06 01:07:25 +01:00
|
|
|
{ X(DirectMusicSegment), Y(DMUS_FOURCC_SEGMENT_FORM), FALSE },
|
|
|
|
{ X(DirectMusicSegment), Y(mmioFOURCC('W','A','V','E')), FALSE },
|
|
|
|
{ X(DirectMusicAudioPathConfig), Y(DMUS_FOURCC_AUDIOPATH_FORM), TRUE },
|
|
|
|
{ X(DirectMusicGraph), Y(DMUS_FOURCC_TOOLGRAPH_FORM), TRUE },
|
2018-03-02 01:16:08 +01:00
|
|
|
};
|
|
|
|
#undef X
|
2018-03-06 01:07:25 +01:00
|
|
|
#undef Y
|
2018-03-02 01:16:08 +01:00
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_SIZE(forms); i++) {
|
2018-03-06 01:07:25 +01:00
|
|
|
trace("Testing %s / %s\n", forms[i].class, forms[i].name);
|
|
|
|
hr = CoCreateInstance(forms[i].clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicObject,
|
|
|
|
(void **)&dmo);
|
|
|
|
if (hr != S_OK) {
|
2022-02-08 23:14:47 +01:00
|
|
|
win_skip("Could not create %s object: %#lx\n", forms[i].class, hr);
|
2018-03-06 01:07:25 +01:00
|
|
|
return;
|
|
|
|
}
|
2018-03-02 01:16:08 +01:00
|
|
|
|
|
|
|
/* Nothing loaded */
|
|
|
|
memset(&desc, 0, sizeof(desc));
|
|
|
|
hr = IDirectMusicObject_GetDescriptor(dmo, &desc);
|
2018-03-06 01:07:25 +01:00
|
|
|
if (forms[i].needs_size) {
|
2022-02-08 23:14:47 +01:00
|
|
|
todo_wine ok(hr == E_INVALIDARG, "GetDescriptor failed: %#lx, expected E_INVALIDARG\n", hr);
|
2018-03-06 01:07:25 +01:00
|
|
|
desc.dwSize = sizeof(desc);
|
|
|
|
hr = IDirectMusicObject_GetDescriptor(dmo, &desc);
|
|
|
|
}
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "GetDescriptor failed: %#lx, expected S_OK\n", hr);
|
|
|
|
ok(desc.dwValidData == DMUS_OBJ_CLASS, "Got valid data %#lx, expected DMUS_OBJ_CLASS\n",
|
2018-03-02 01:16:08 +01:00
|
|
|
desc.dwValidData);
|
2018-03-06 01:07:25 +01:00
|
|
|
ok(IsEqualGUID(&desc.guidClass, forms[i].clsid), "Got class guid %s, expected CLSID_%s\n",
|
|
|
|
wine_dbgstr_guid(&desc.guidClass), forms[i].class);
|
2018-03-02 01:16:08 +01:00
|
|
|
|
|
|
|
/* Empty RIFF stream */
|
|
|
|
empty[1] = forms[i].form;
|
|
|
|
stream = gen_riff_stream(empty);
|
|
|
|
memset(&desc, 0, sizeof(desc));
|
|
|
|
hr = IDirectMusicObject_ParseDescriptor(dmo, stream, &desc);
|
2018-03-06 01:07:25 +01:00
|
|
|
if (forms[i].needs_size) {
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_INVALIDARG, "ParseDescriptor failed: %#lx, expected E_INVALIDARG\n", hr);
|
2018-03-06 01:07:25 +01:00
|
|
|
desc.dwSize = sizeof(desc);
|
|
|
|
hr = IDirectMusicObject_ParseDescriptor(dmo, stream, &desc);
|
|
|
|
}
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "ParseDescriptor failed: %#lx, expected S_OK\n", hr);
|
|
|
|
ok(desc.dwValidData == DMUS_OBJ_CLASS, "Got valid data %#lx, expected DMUS_OBJ_CLASS\n",
|
2018-03-02 01:16:08 +01:00
|
|
|
desc.dwValidData);
|
2018-03-06 01:07:25 +01:00
|
|
|
ok(IsEqualGUID(&desc.guidClass, forms[i].clsid), "Got class guid %s, expected CLSID_%s\n",
|
|
|
|
wine_dbgstr_guid(&desc.guidClass), forms[i].class);
|
2018-03-02 01:16:08 +01:00
|
|
|
|
2018-03-11 22:20:43 +01:00
|
|
|
/* NULL pointers */
|
|
|
|
memset(&desc, 0, sizeof(desc));
|
|
|
|
desc.dwSize = sizeof(desc);
|
|
|
|
hr = IDirectMusicObject_ParseDescriptor(dmo, NULL, &desc);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_POINTER, "ParseDescriptor failed: %#lx, expected E_POINTER\n", hr);
|
2018-03-11 22:20:43 +01:00
|
|
|
hr = IDirectMusicObject_ParseDescriptor(dmo, stream, NULL);
|
|
|
|
if (forms[i].needs_size)
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_INVALIDARG, "ParseDescriptor failed: %#lx, expected E_INVALIDARG\n", hr);
|
2018-03-11 22:20:43 +01:00
|
|
|
else
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_POINTER, "ParseDescriptor failed: %#lx, expected E_POINTER\n", hr);
|
2018-03-11 22:20:43 +01:00
|
|
|
hr = IDirectMusicObject_ParseDescriptor(dmo, NULL, NULL);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_POINTER, "ParseDescriptor failed: %#lx, expected E_POINTER\n", hr);
|
2018-03-15 00:09:32 +01:00
|
|
|
IStream_Release(stream);
|
2018-03-11 22:20:43 +01:00
|
|
|
|
2018-03-02 01:16:08 +01:00
|
|
|
/* Wrong form */
|
|
|
|
empty[1] = DMUS_FOURCC_CONTAINER_FORM;
|
|
|
|
stream = gen_riff_stream(empty);
|
|
|
|
memset(&desc, 0, sizeof(desc));
|
2018-03-06 01:07:25 +01:00
|
|
|
desc.dwSize = sizeof(desc);
|
2018-03-02 01:16:08 +01:00
|
|
|
hr = IDirectMusicObject_ParseDescriptor(dmo, stream, &desc);
|
2018-03-15 00:09:33 +01:00
|
|
|
if (forms[i].needs_size)
|
|
|
|
ok(hr == DMUS_E_CHUNKNOTFOUND,
|
2022-02-08 23:14:47 +01:00
|
|
|
"ParseDescriptor failed: %#lx, expected DMUS_E_CHUNKNOTFOUND\n", hr);
|
2018-03-15 00:09:33 +01:00
|
|
|
else
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_FAIL, "ParseDescriptor failed: %#lx, expected E_FAIL\n", hr);
|
|
|
|
ok(!desc.dwValidData, "Got valid data %#lx, expected 0\n", desc.dwValidData);
|
2018-03-15 00:09:33 +01:00
|
|
|
IStream_Release(stream);
|
|
|
|
|
|
|
|
/* Not a RIFF stream */
|
|
|
|
stream = gen_riff_stream(noriff);
|
|
|
|
memset(&desc, 0, sizeof(desc));
|
|
|
|
desc.dwSize = sizeof(desc);
|
|
|
|
hr = IDirectMusicObject_ParseDescriptor(dmo, stream, &desc);
|
2018-03-06 01:07:25 +01:00
|
|
|
if (forms[i].needs_size)
|
2018-03-11 22:20:42 +01:00
|
|
|
ok(hr == DMUS_E_CHUNKNOTFOUND,
|
2022-02-08 23:14:47 +01:00
|
|
|
"ParseDescriptor failed: %#lx, expected DMUS_E_CHUNKNOTFOUND\n", hr);
|
2018-03-06 01:07:25 +01:00
|
|
|
else
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == E_FAIL, "ParseDescriptor failed: %#lx, expected E_FAIL\n", hr);
|
|
|
|
ok(!desc.dwValidData, "Got valid data %#lx, expected 0\n", desc.dwValidData);
|
2018-03-15 00:09:32 +01:00
|
|
|
IStream_Release(stream);
|
2018-03-02 01:16:08 +01:00
|
|
|
|
|
|
|
/* All desc chunks */
|
|
|
|
alldesc[1] = forms[i].form;
|
|
|
|
stream = gen_riff_stream(alldesc);
|
|
|
|
memset(&desc, 0, sizeof(desc));
|
2018-03-06 01:07:25 +01:00
|
|
|
desc.dwSize = sizeof(desc);
|
2018-03-02 01:16:08 +01:00
|
|
|
hr = IDirectMusicObject_ParseDescriptor(dmo, stream, &desc);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "ParseDescriptor failed: %#lx, expected S_OK\n", hr);
|
2018-03-02 01:16:08 +01:00
|
|
|
valid = DMUS_OBJ_OBJECT | DMUS_OBJ_CLASS | DMUS_OBJ_VERSION;
|
2018-03-06 01:07:25 +01:00
|
|
|
if (forms[i].form != mmioFOURCC('W','A','V','E'))
|
2018-03-02 01:16:08 +01:00
|
|
|
valid |= DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY;
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(desc.dwValidData == valid, "Got valid data %#lx, expected %#lx\n", desc.dwValidData, valid);
|
2018-03-06 01:07:25 +01:00
|
|
|
ok(IsEqualGUID(&desc.guidClass, forms[i].clsid), "Got class guid %s, expected CLSID_%s\n",
|
|
|
|
wine_dbgstr_guid(&desc.guidClass), forms[i].class);
|
2018-03-02 01:16:08 +01:00
|
|
|
ok(IsEqualGUID(&desc.guidObject, &GUID_NULL), "Got object guid %s, expected GUID_NULL\n",
|
|
|
|
wine_dbgstr_guid(&desc.guidClass));
|
2018-03-11 22:20:40 +01:00
|
|
|
ok(desc.vVersion.dwVersionMS == 5 && desc.vVersion.dwVersionLS == 8,
|
2022-02-08 23:14:47 +01:00
|
|
|
"Got version %lu.%lu, expected 5.8\n", desc.vVersion.dwVersionMS,
|
2018-03-11 22:20:40 +01:00
|
|
|
desc.vVersion.dwVersionLS);
|
|
|
|
if (forms[i].form != mmioFOURCC('W','A','V','E'))
|
2019-12-16 20:49:39 +01:00
|
|
|
ok(!lstrcmpW(desc.wszName, L"UNAM"), "Got name '%s', expected 'UNAM'\n",
|
2018-03-02 01:16:08 +01:00
|
|
|
wine_dbgstr_w(desc.wszName));
|
|
|
|
IStream_Release(stream);
|
|
|
|
|
|
|
|
/* Duplicated chunks */
|
|
|
|
dupes[1] = forms[i].form;
|
|
|
|
stream = gen_riff_stream(dupes);
|
|
|
|
memset(&desc, 0, sizeof(desc));
|
2018-03-06 01:07:25 +01:00
|
|
|
desc.dwSize = sizeof(desc);
|
2018-03-02 01:16:08 +01:00
|
|
|
hr = IDirectMusicObject_ParseDescriptor(dmo, stream, &desc);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "ParseDescriptor failed: %#lx, expected S_OK\n", hr);
|
|
|
|
ok(desc.dwValidData == valid, "Got valid data %#lx, expected %#lx\n", desc.dwValidData, valid);
|
2018-03-02 01:16:08 +01:00
|
|
|
IStream_Release(stream);
|
|
|
|
|
|
|
|
/* UNFO list with INAM */
|
|
|
|
inam[1] = forms[i].form;
|
|
|
|
inam[3] = DMUS_FOURCC_UNFO_LIST;
|
|
|
|
stream = gen_riff_stream(inam);
|
|
|
|
memset(&desc, 0, sizeof(desc));
|
2018-03-06 01:07:25 +01:00
|
|
|
desc.dwSize = sizeof(desc);
|
2018-03-02 01:16:08 +01:00
|
|
|
hr = IDirectMusicObject_ParseDescriptor(dmo, stream, &desc);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "ParseDescriptor failed: %#lx, expected S_OK\n", hr);
|
|
|
|
ok(desc.dwValidData == DMUS_OBJ_CLASS, "Got valid data %#lx, expected DMUS_OBJ_CLASS\n",
|
2018-03-11 22:20:42 +01:00
|
|
|
desc.dwValidData);
|
2018-03-02 01:16:08 +01:00
|
|
|
IStream_Release(stream);
|
|
|
|
|
|
|
|
/* INFO list with INAM */
|
|
|
|
inam[3] = DMUS_FOURCC_INFO_LIST;
|
|
|
|
stream = gen_riff_stream(inam);
|
|
|
|
memset(&desc, 0, sizeof(desc));
|
2018-03-06 01:07:25 +01:00
|
|
|
desc.dwSize = sizeof(desc);
|
2018-03-02 01:16:08 +01:00
|
|
|
hr = IDirectMusicObject_ParseDescriptor(dmo, stream, &desc);
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(hr == S_OK, "ParseDescriptor failed: %#lx, expected S_OK\n", hr);
|
2018-03-02 01:16:08 +01:00
|
|
|
valid = DMUS_OBJ_CLASS;
|
|
|
|
if (forms[i].form == mmioFOURCC('W','A','V','E'))
|
|
|
|
valid |= DMUS_OBJ_NAME;
|
2022-02-08 23:14:47 +01:00
|
|
|
ok(desc.dwValidData == valid, "Got valid data %#lx, expected %#lx\n", desc.dwValidData, valid);
|
2018-03-02 01:16:08 +01:00
|
|
|
if (forms[i].form == mmioFOURCC('W','A','V','E'))
|
2019-12-16 20:49:39 +01:00
|
|
|
ok(!lstrcmpW(desc.wszName, L"I"), "Got name '%s', expected 'I'\n",
|
2018-03-11 22:20:40 +01:00
|
|
|
wine_dbgstr_w(desc.wszName));
|
2018-03-02 01:16:08 +01:00
|
|
|
IStream_Release(stream);
|
2018-03-06 01:07:25 +01:00
|
|
|
|
|
|
|
IDirectMusicObject_Release(dmo);
|
2018-03-02 01:16:08 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-01-10 10:42:57 +01:00
|
|
|
START_TEST(dmime)
|
|
|
|
{
|
|
|
|
CoInitialize(NULL);
|
|
|
|
|
|
|
|
if (missing_dmime())
|
|
|
|
{
|
|
|
|
skip("dmime not available\n");
|
|
|
|
CoUninitialize();
|
|
|
|
return;
|
|
|
|
}
|
2014-01-10 10:54:48 +01:00
|
|
|
test_COM_audiopath();
|
|
|
|
test_COM_audiopathconfig();
|
2014-01-10 10:48:05 +01:00
|
|
|
test_COM_graph();
|
2014-01-10 10:42:57 +01:00
|
|
|
test_COM_segment();
|
2014-01-10 10:44:34 +01:00
|
|
|
test_COM_segmentstate();
|
2014-01-10 10:47:03 +01:00
|
|
|
test_COM_track();
|
2014-05-30 23:08:01 +02:00
|
|
|
test_audiopathconfig();
|
|
|
|
test_graph();
|
|
|
|
test_segment();
|
2019-12-08 18:53:51 +01:00
|
|
|
test_gettrack();
|
2019-12-08 18:53:53 +01:00
|
|
|
test_segment_param();
|
2015-06-16 09:26:41 +02:00
|
|
|
test_track();
|
2018-03-02 01:16:08 +01:00
|
|
|
test_parsedescriptor();
|
2014-01-10 10:42:57 +01:00
|
|
|
|
|
|
|
CoUninitialize();
|
|
|
|
}
|