blob: a9bbe9437b0b6a0dc57f11cfea7d3250c621da86 [file] [log] [blame]
Rok Mandeljcdf167d12003-08-22 23:53:27 +00001/* IDirectMusicSeqTrack Implementation
2 *
Rok Mandeljc0382ea12004-01-20 00:21:40 +00003 * Copyright (C) 2003-2004 Rok Mandeljc
Rok Mandeljcdf167d12003-08-22 23:53:27 +00004 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */
19
Rok Mandeljcdf167d12003-08-22 23:53:27 +000020#include "dmime_private.h"
21
22WINE_DEFAULT_DEBUG_CHANNEL(dmime);
23WINE_DECLARE_DEBUG_CHANNEL(dmfile);
24
25/*****************************************************************************
26 * IDirectMusicSeqTrack implementation
27 */
28/* IDirectMusicSeqTrack IUnknown part: */
Rok Mandeljc0382ea12004-01-20 00:21:40 +000029HRESULT WINAPI IDirectMusicSeqTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
30 ICOM_THIS_MULTI(IDirectMusicSeqTrack, UnknownVtbl, iface);
Rok Mandeljcdf167d12003-08-22 23:53:27 +000031
Rok Mandeljc0382ea12004-01-20 00:21:40 +000032 if (IsEqualIID (riid, &IID_IUnknown)) {
33 *ppobj = (LPUNKNOWN)&This->UnknownVtbl;
34 IDirectMusicSeqTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
35 return S_OK;
36 } else if (IsEqualIID (riid, &IID_IDirectMusicTrack)
37 || IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
38 *ppobj = (LPDIRECTMUSICTRACK8)&This->TrackVtbl;
39 IDirectMusicSeqTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl);
Rok Mandeljcdf167d12003-08-22 23:53:27 +000040 return S_OK;
41 } else if (IsEqualIID (riid, &IID_IPersistStream)) {
Rok Mandeljc0382ea12004-01-20 00:21:40 +000042 *ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl;
43 IDirectMusicSeqTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
Rok Mandeljcdf167d12003-08-22 23:53:27 +000044 return S_OK;
45 }
46
47 WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
48 return E_NOINTERFACE;
49}
50
Rok Mandeljc0382ea12004-01-20 00:21:40 +000051ULONG WINAPI IDirectMusicSeqTrack_IUnknown_AddRef (LPUNKNOWN iface) {
52 ICOM_THIS_MULTI(IDirectMusicSeqTrack, UnknownVtbl, iface);
Rok Mandeljcdf167d12003-08-22 23:53:27 +000053 TRACE("(%p) : AddRef from %ld\n", This, This->ref);
54 return ++(This->ref);
55}
56
Rok Mandeljc0382ea12004-01-20 00:21:40 +000057ULONG WINAPI IDirectMusicSeqTrack_IUnknown_Release (LPUNKNOWN iface) {
58 ICOM_THIS_MULTI(IDirectMusicSeqTrack, UnknownVtbl, iface);
Rok Mandeljcdf167d12003-08-22 23:53:27 +000059 ULONG ref = --This->ref;
60 TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
61 if (ref == 0) {
62 HeapFree(GetProcessHeap(), 0, This);
63 }
64 return ref;
65}
66
Rok Mandeljc0382ea12004-01-20 00:21:40 +000067ICOM_VTABLE(IUnknown) DirectMusicSeqTrack_Unknown_Vtbl = {
68 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
69 IDirectMusicSeqTrack_IUnknown_QueryInterface,
70 IDirectMusicSeqTrack_IUnknown_AddRef,
71 IDirectMusicSeqTrack_IUnknown_Release
72};
Rok Mandeljcdf167d12003-08-22 23:53:27 +000073
Rok Mandeljc0382ea12004-01-20 00:21:40 +000074/* IDirectMusicSeqTrack IDirectMusicTrack8 part: */
75HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) {
76 ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
77 return IDirectMusicSeqTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
78}
79
80ULONG WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) {
81 ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
82 return IDirectMusicSeqTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
83}
84
85ULONG WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface) {
86 ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
87 return IDirectMusicSeqTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
88}
89
90HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
91{
92 ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
Rok Mandeljcdf167d12003-08-22 23:53:27 +000093 FIXME("(%p, %p): stub\n", This, pSegment);
Rok Mandeljcdf167d12003-08-22 23:53:27 +000094 return S_OK;
95}
96
Rok Mandeljc0382ea12004-01-20 00:21:40 +000097HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
Rok Mandeljcdf167d12003-08-22 23:53:27 +000098{
Rok Mandeljc0382ea12004-01-20 00:21:40 +000099 ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000100 FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000101 return S_OK;
102}
103
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000104HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000105{
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000106 ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000107 FIXME("(%p, %p): stub\n", This, pStateData);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000108 return S_OK;
109}
110
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000111HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000112{
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000113 ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000114 FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000115 return S_OK;
116}
117
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000118HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
119 ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000120 FIXME("(%p, %s, %ld, %p, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pmtNext, pParam);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000121 return S_OK;
122}
123
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000124HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) {
125 ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000126 FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_guid(rguidType), mtTime, pParam);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000127 return S_OK;
128}
129
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000130HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) {
131 ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000132
133 TRACE("(%p, %s): ", This, debugstr_guid(rguidType));
134 /* didn't find any params */
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000135 TRACE("param unsupported\n");
136 return DMUS_E_TYPE_UNSUPPORTED;
137}
138
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000139HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
140 ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000141 FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000142 return S_OK;
143}
144
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000145HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
146 ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000147 FIXME("(%p, %s): stub\n", This, debugstr_guid(rguidNotificationType));
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000148 return S_OK;
149}
150
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000151HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) {
152 ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000153 FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppTrack);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000154 return S_OK;
155}
156
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000157HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
158 ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000159 FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This, pStateData, rtStart, rtEnd, rtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000160 return S_OK;
161}
162
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000163HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags) {
164 ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000165 FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, prtNext, pParam, pStateData, dwFlags);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000166 return S_OK;
167}
168
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000169HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags) {
170 ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000171 FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This, debugstr_guid(rguidType), rtTime, pParam, pStateData, dwFlags);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000172 return S_OK;
173}
174
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000175HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
176 ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000177 FIXME("(%p, %p, %ld, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000178 return S_OK;
179}
180
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000181HRESULT WINAPI IDirectMusicSeqTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
182 ICOM_THIS_MULTI(IDirectMusicSeqTrack, TrackVtbl, iface);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000183 FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000184 return S_OK;
185}
186
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000187ICOM_VTABLE(IDirectMusicTrack8) DirectMusicSeqTrack_Track_Vtbl = {
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000188 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000189 IDirectMusicSeqTrack_IDirectMusicTrack_QueryInterface,
190 IDirectMusicSeqTrack_IDirectMusicTrack_AddRef,
191 IDirectMusicSeqTrack_IDirectMusicTrack_Release,
192 IDirectMusicSeqTrack_IDirectMusicTrack_Init,
193 IDirectMusicSeqTrack_IDirectMusicTrack_InitPlay,
194 IDirectMusicSeqTrack_IDirectMusicTrack_EndPlay,
195 IDirectMusicSeqTrack_IDirectMusicTrack_Play,
196 IDirectMusicSeqTrack_IDirectMusicTrack_GetParam,
197 IDirectMusicSeqTrack_IDirectMusicTrack_SetParam,
198 IDirectMusicSeqTrack_IDirectMusicTrack_IsParamSupported,
199 IDirectMusicSeqTrack_IDirectMusicTrack_AddNotificationType,
200 IDirectMusicSeqTrack_IDirectMusicTrack_RemoveNotificationType,
201 IDirectMusicSeqTrack_IDirectMusicTrack_Clone,
202 IDirectMusicSeqTrack_IDirectMusicTrack_PlayEx,
203 IDirectMusicSeqTrack_IDirectMusicTrack_GetParamEx,
204 IDirectMusicSeqTrack_IDirectMusicTrack_SetParamEx,
205 IDirectMusicSeqTrack_IDirectMusicTrack_Compose,
206 IDirectMusicSeqTrack_IDirectMusicTrack_Join
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000207};
208
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000209/* IDirectMusicSeqTrack IPersistStream part: */
210HRESULT WINAPI IDirectMusicSeqTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
211 ICOM_THIS_MULTI(IDirectMusicSeqTrack, PersistStreamVtbl, iface);
212 return IDirectMusicSeqTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000213}
214
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000215ULONG WINAPI IDirectMusicSeqTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
216 ICOM_THIS_MULTI(IDirectMusicSeqTrack, PersistStreamVtbl, iface);
217 return IDirectMusicSeqTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000218}
219
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000220ULONG WINAPI IDirectMusicSeqTrack_IPersistStream_Release (LPPERSISTSTREAM iface) {
221 ICOM_THIS_MULTI(IDirectMusicSeqTrack, PersistStreamVtbl, iface);
222 return IDirectMusicSeqTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000223}
224
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000225HRESULT WINAPI IDirectMusicSeqTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000226 return E_NOTIMPL;
227}
228
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000229HRESULT WINAPI IDirectMusicSeqTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000230 return E_NOTIMPL;
231}
232
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000233HRESULT WINAPI IDirectMusicSeqTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000234 FIXME(": Loading not implemented yet\n");
235 return S_OK;
236}
237
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000238HRESULT WINAPI IDirectMusicSeqTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000239 return E_NOTIMPL;
240}
241
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000242HRESULT WINAPI IDirectMusicSeqTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000243 return E_NOTIMPL;
244}
245
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000246ICOM_VTABLE(IPersistStream) DirectMusicSeqTrack_PersistStream_Vtbl = {
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000247 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000248 IDirectMusicSeqTrack_IPersistStream_QueryInterface,
249 IDirectMusicSeqTrack_IPersistStream_AddRef,
250 IDirectMusicSeqTrack_IPersistStream_Release,
251 IDirectMusicSeqTrack_IPersistStream_GetClassID,
252 IDirectMusicSeqTrack_IPersistStream_IsDirty,
253 IDirectMusicSeqTrack_IPersistStream_Load,
254 IDirectMusicSeqTrack_IPersistStream_Save,
255 IDirectMusicSeqTrack_IPersistStream_GetSizeMax
Rok Mandeljcdf167d12003-08-22 23:53:27 +0000256};
Rok Mandeljc0382ea12004-01-20 00:21:40 +0000257
258/* for ClassFactory */
259HRESULT WINAPI DMUSIC_CreateDirectMusicSeqTrack (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
260 IDirectMusicSeqTrack* track;
261
262 track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSeqTrack));
263 if (NULL == track) {
264 *ppobj = (LPVOID) NULL;
265 return E_OUTOFMEMORY;
266 }
267 track->UnknownVtbl = &DirectMusicSeqTrack_Unknown_Vtbl;
268 track->TrackVtbl = &DirectMusicSeqTrack_Track_Vtbl;
269 track->PersistStreamVtbl = &DirectMusicSeqTrack_PersistStream_Vtbl;
270 track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
271 DM_STRUCT_INIT(track->pDesc);
272 track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
273 memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicSeqTrack, sizeof (CLSID));
274 track->ref = 0; /* will be inited by QueryInterface */
275
276 return IDirectMusicSeqTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);
277}