dmscript: Implement GetClassID() for IDirectMusicTrack.

This commit is contained in:
Nikolay Sivov 2015-04-04 14:07:00 +03:00 committed by Alexandre Julliard
parent b16432f2c2
commit 52251ac6da
2 changed files with 16 additions and 4 deletions

View File

@ -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;

View File

@ -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 */