Commit 52251ac6 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dmscript: Implement GetClassID() for IDirectMusicTrack.

parent b16432f2
......@@ -264,7 +264,15 @@ static ULONG WINAPI IPersistStreamImpl_Release(IPersistStream *iface)
static HRESULT WINAPI IPersistStreamImpl_GetClassID(IPersistStream *iface, CLSID *pClassID)
{
return E_NOTIMPL;
DirectMusicScriptTrack *This = impl_from_IPersistStream(iface);
TRACE("(%p, %p)\n", This, pClassID);
if (!pClassID)
return E_POINTER;
*pClassID = This->desc.guidClass;
return S_OK;
}
static HRESULT WINAPI IPersistStreamImpl_IsDirty(IPersistStream *iface)
......@@ -319,7 +327,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicScriptTrack(REFIID riid, void **ret_iface
track->IDirectMusicTrack8_iface.lpVtbl = &dmtrack8_vtbl;
track->IPersistStream_iface.lpVtbl = &persist_vtbl;
track->desc.dwSize = sizeof(track->desc);
track->desc.dwValidData |= DMUS_OBJ_CLASS;
track->desc.dwValidData = DMUS_OBJ_CLASS;
track->desc.guidClass = CLSID_DirectMusicScriptTrack;
track->ref = 1;
......
......@@ -217,9 +217,13 @@ static void test_scripttrack(void)
/* IPersistStream */
hr = IDirectMusicTrack_QueryInterface(dmt, &IID_IPersistStream, (void**)&ps);
ok(hr == S_OK, "QueryInterface for IID_IPersistStream failed: %08x\n", hr);
hr = IPersistStream_GetClassID(ps, NULL);
ok(hr == E_POINTER, "got 0x%08x\n", hr);
hr = IPersistStream_GetClassID(ps, &class);
todo_wine ok(hr == S_OK, "IPersistStream_GetClassID failed: %08x\n", hr);
todo_wine ok(IsEqualGUID(&class, &CLSID_DirectMusicScriptTrack),
ok(hr == S_OK, "IPersistStream_GetClassID failed: %08x\n", hr);
ok(IsEqualGUID(&class, &CLSID_DirectMusicScriptTrack),
"Expected class CLSID_DirectMusicScriptTrack got %s\n", wine_dbgstr_guid(&class));
/* Unimplemented IPersistStream methods */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment