1 /* IDirectMusicBand Implementation
3 * Copyright (C) 2003-2004 Rok Mandeljc
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.
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.
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.
20 #include "dmband_private.h"
22 WINE_DEFAULT_DEBUG_CHANNEL(dmband
);
23 WINE_DECLARE_DEBUG_CHANNEL(dmfile
);
25 const GUID IID_IDirectMusicBandPRIVATE
= {0xda54db81,0x837d,0x11d1,{0x86,0xbc,0x00,0xc0,0x4f,0xbf,0x8f,0xef}};
27 /*****************************************************************************
28 * IDirectMusicBandImpl implementation
30 /* IDirectMusicBandImpl IUnknown part: */
31 HRESULT WINAPI
IDirectMusicBandImpl_IUnknown_QueryInterface (LPUNKNOWN iface
, REFIID riid
, LPVOID
*ppobj
) {
32 ICOM_THIS_MULTI(IDirectMusicBandImpl
, UnknownVtbl
, iface
);
34 TRACE("(%p, %s, %p)\n", This
, debugstr_dmguid(riid
), ppobj
);
35 if (IsEqualIID (riid
, &IID_IUnknown
)) {
36 *ppobj
= (LPVOID
)&This
->UnknownVtbl
;
37 IDirectMusicBandImpl_IUnknown_AddRef ((LPUNKNOWN
)&This
->UnknownVtbl
);
39 } else if (IsEqualIID (riid
, &IID_IDirectMusicBand
)) {
40 *ppobj
= (LPVOID
)&This
->BandVtbl
;
41 IDirectMusicBandImpl_IDirectMusicBand_AddRef ((LPDIRECTMUSICBAND
)&This
->BandVtbl
);
43 } else if (IsEqualIID (riid
, &IID_IDirectMusicObject
)) {
44 *ppobj
= (LPVOID
)&This
->ObjectVtbl
;
45 IDirectMusicBandImpl_IDirectMusicObject_AddRef ((LPDIRECTMUSICOBJECT
)&This
->ObjectVtbl
);
47 } else if (IsEqualIID (riid
, &IID_IPersistStream
)) {
48 *ppobj
= (LPVOID
)&This
->PersistStreamVtbl
;
49 IDirectMusicBandImpl_IPersistStream_AddRef ((LPPERSISTSTREAM
)&This
->PersistStreamVtbl
);
53 WARN("(%p, %s, %p): not found\n", This
, debugstr_dmguid(riid
), ppobj
);
57 ULONG WINAPI
IDirectMusicBandImpl_IUnknown_AddRef (LPUNKNOWN iface
) {
58 ICOM_THIS_MULTI(IDirectMusicBandImpl
, UnknownVtbl
, iface
);
59 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
63 ULONG WINAPI
IDirectMusicBandImpl_IUnknown_Release (LPUNKNOWN iface
) {
64 ICOM_THIS_MULTI(IDirectMusicBandImpl
, UnknownVtbl
, iface
);
65 ULONG ref
= --This
->ref
;
66 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
68 HeapFree(GetProcessHeap(), 0, This
);
73 ICOM_VTABLE(IUnknown
) DirectMusicBand_Unknown_Vtbl
= {
74 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
75 IDirectMusicBandImpl_IUnknown_QueryInterface
,
76 IDirectMusicBandImpl_IUnknown_AddRef
,
77 IDirectMusicBandImpl_IUnknown_Release
80 /* IDirectMusicBandImpl IDirectMusicBand part: */
81 HRESULT WINAPI
IDirectMusicBandImpl_IDirectMusicBand_QueryInterface (LPDIRECTMUSICBAND iface
, REFIID riid
, LPVOID
*ppobj
) {
82 ICOM_THIS_MULTI(IDirectMusicBandImpl
, BandVtbl
, iface
);
83 return IDirectMusicBandImpl_IUnknown_QueryInterface ((LPUNKNOWN
)&This
->UnknownVtbl
, riid
, ppobj
);
86 ULONG WINAPI
IDirectMusicBandImpl_IDirectMusicBand_AddRef (LPDIRECTMUSICBAND iface
) {
87 ICOM_THIS_MULTI(IDirectMusicBandImpl
, BandVtbl
, iface
);
88 return IDirectMusicBandImpl_IUnknown_AddRef ((LPUNKNOWN
)&This
->UnknownVtbl
);
91 ULONG WINAPI
IDirectMusicBandImpl_IDirectMusicBand_Release (LPDIRECTMUSICBAND iface
) {
92 ICOM_THIS_MULTI(IDirectMusicBandImpl
, BandVtbl
, iface
);
93 return IDirectMusicBandImpl_IUnknown_Release ((LPUNKNOWN
)&This
->UnknownVtbl
);
96 HRESULT WINAPI
IDirectMusicBandImpl_IDirectMusicBand_CreateSegment (LPDIRECTMUSICBAND iface
, IDirectMusicSegment
** ppSegment
) {
97 ICOM_THIS_MULTI(IDirectMusicBandImpl
, BandVtbl
, iface
);
98 FIXME("(%p, %p): stub\n", This
, ppSegment
);
102 HRESULT WINAPI
IDirectMusicBandImpl_IDirectMusicBand_Download (LPDIRECTMUSICBAND iface
, IDirectMusicPerformance
* pPerformance
) {
103 ICOM_THIS_MULTI(IDirectMusicBandImpl
, BandVtbl
, iface
);
104 FIXME("(%p, %p): stub\n", This
, pPerformance
);
108 HRESULT WINAPI
IDirectMusicBandImpl_IDirectMusicBand_Unload (LPDIRECTMUSICBAND iface
, IDirectMusicPerformance
* pPerformance
) {
109 ICOM_THIS_MULTI(IDirectMusicBandImpl
, BandVtbl
, iface
);
110 FIXME("(%p, %p): stub\n", This
, pPerformance
);
114 ICOM_VTABLE(IDirectMusicBand
) DirectMusicBand_Band_Vtbl
= {
115 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
116 IDirectMusicBandImpl_IDirectMusicBand_QueryInterface
,
117 IDirectMusicBandImpl_IDirectMusicBand_AddRef
,
118 IDirectMusicBandImpl_IDirectMusicBand_Release
,
119 IDirectMusicBandImpl_IDirectMusicBand_CreateSegment
,
120 IDirectMusicBandImpl_IDirectMusicBand_Download
,
121 IDirectMusicBandImpl_IDirectMusicBand_Unload
124 /* IDirectMusicBandImpl IDirectMusicObject part: */
125 HRESULT WINAPI
IDirectMusicBandImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface
, REFIID riid
, LPVOID
*ppobj
) {
126 ICOM_THIS_MULTI(IDirectMusicBandImpl
, ObjectVtbl
, iface
);
127 return IDirectMusicBandImpl_IUnknown_QueryInterface ((LPUNKNOWN
)&This
->UnknownVtbl
, riid
, ppobj
);
130 ULONG WINAPI
IDirectMusicBandImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface
) {
131 ICOM_THIS_MULTI(IDirectMusicBandImpl
, ObjectVtbl
, iface
);
132 return IDirectMusicBandImpl_IUnknown_AddRef ((LPUNKNOWN
)&This
->UnknownVtbl
);
135 ULONG WINAPI
IDirectMusicBandImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface
) {
136 ICOM_THIS_MULTI(IDirectMusicBandImpl
, ObjectVtbl
, iface
);
137 return IDirectMusicBandImpl_IUnknown_Release ((LPUNKNOWN
)&This
->UnknownVtbl
);
140 HRESULT WINAPI
IDirectMusicBandImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface
, LPDMUS_OBJECTDESC pDesc
) {
141 ICOM_THIS_MULTI(IDirectMusicBandImpl
, ObjectVtbl
, iface
);
142 TRACE("(%p, %p)\n", This
, pDesc
);
143 /* I think we shouldn't return pointer here since then values can be changed; it'd be a mess */
144 memcpy (pDesc
, This
->pDesc
, This
->pDesc
->dwSize
);
148 HRESULT WINAPI
IDirectMusicBandImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface
, LPDMUS_OBJECTDESC pDesc
) {
149 ICOM_THIS_MULTI(IDirectMusicBandImpl
, ObjectVtbl
, iface
);
150 TRACE("(%p, %p): setting descriptor:\n%s\n", This
, pDesc
, debugstr_DMUS_OBJECTDESC (pDesc
));
152 /* According to MSDN, we should copy only given values, not whole struct */
153 if (pDesc
->dwValidData
& DMUS_OBJ_OBJECT
)
154 memcpy (&This
->pDesc
->guidObject
, &pDesc
->guidObject
, sizeof (pDesc
->guidObject
));
155 if (pDesc
->dwValidData
& DMUS_OBJ_CLASS
)
156 memcpy (&This
->pDesc
->guidClass
, &pDesc
->guidClass
, sizeof (pDesc
->guidClass
));
157 if (pDesc
->dwValidData
& DMUS_OBJ_NAME
)
158 strncpyW (This
->pDesc
->wszName
, pDesc
->wszName
, DMUS_MAX_NAME
);
159 if (pDesc
->dwValidData
& DMUS_OBJ_CATEGORY
)
160 strncpyW (This
->pDesc
->wszCategory
, pDesc
->wszCategory
, DMUS_MAX_CATEGORY
);
161 if (pDesc
->dwValidData
& DMUS_OBJ_FILENAME
)
162 strncpyW (This
->pDesc
->wszFileName
, pDesc
->wszFileName
, DMUS_MAX_FILENAME
);
163 if (pDesc
->dwValidData
& DMUS_OBJ_VERSION
)
164 memcpy (&This
->pDesc
->vVersion
, &pDesc
->vVersion
, sizeof (pDesc
->vVersion
));
165 if (pDesc
->dwValidData
& DMUS_OBJ_DATE
)
166 memcpy (&This
->pDesc
->ftDate
, &pDesc
->ftDate
, sizeof (pDesc
->ftDate
));
167 if (pDesc
->dwValidData
& DMUS_OBJ_MEMORY
) {
168 memcpy (&This
->pDesc
->llMemLength
, &pDesc
->llMemLength
, sizeof (pDesc
->llMemLength
));
169 memcpy (This
->pDesc
->pbMemData
, pDesc
->pbMemData
, sizeof (pDesc
->pbMemData
));
171 if (pDesc
->dwValidData
& DMUS_OBJ_STREAM
) {
172 /* according to MSDN, we copy the stream */
173 IStream_Clone (pDesc
->pStream
, &This
->pDesc
->pStream
);
177 This
->pDesc
->dwValidData
|= pDesc
->dwValidData
;
182 HRESULT WINAPI
IDirectMusicBandImpl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface
, LPSTREAM pStream
, LPDMUS_OBJECTDESC pDesc
) {
183 DMUS_PRIVATE_CHUNK Chunk
;
184 DWORD StreamSize
, StreamCount
, ListSize
[1], ListCount
[1];
185 LARGE_INTEGER liMove
; /* used when skipping chunks */
187 TRACE("(%p, %p)\n", pStream
, pDesc
);
189 /* FIXME: should this be determined from stream? */
190 pDesc
->dwValidData
|= DMUS_OBJ_CLASS
;
191 memcpy (&pDesc
->guidClass
, &CLSID_DirectMusicBand
, sizeof(CLSID
));
193 IStream_Read (pStream
, &Chunk
, sizeof(FOURCC
)+sizeof(DWORD
), NULL
);
194 TRACE_(dmfile
)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk
.fccID
), Chunk
.dwSize
);
195 switch (Chunk
.fccID
) {
197 IStream_Read (pStream
, &Chunk
.fccID
, sizeof(FOURCC
), NULL
);
198 TRACE_(dmfile
)(": RIFF chunk of type %s", debugstr_fourcc(Chunk
.fccID
));
199 StreamSize
= Chunk
.dwSize
- sizeof(FOURCC
);
201 if (Chunk
.fccID
== DMUS_FOURCC_BAND_FORM
) {
202 TRACE_(dmfile
)(": band form\n");
204 IStream_Read (pStream
, &Chunk
, sizeof(FOURCC
)+sizeof(DWORD
), NULL
);
205 StreamCount
+= sizeof(FOURCC
) + sizeof(DWORD
) + Chunk
.dwSize
;
206 TRACE_(dmfile
)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk
.fccID
), Chunk
.dwSize
);
207 switch (Chunk
.fccID
) {
208 case DMUS_FOURCC_GUID_CHUNK
: {
209 TRACE_(dmfile
)(": GUID chunk\n");
210 pDesc
->dwValidData
|= DMUS_OBJ_OBJECT
;
211 IStream_Read (pStream
, &pDesc
->guidObject
, Chunk
.dwSize
, NULL
);
214 case DMUS_FOURCC_VERSION_CHUNK
: {
215 TRACE_(dmfile
)(": version chunk\n");
216 pDesc
->dwValidData
|= DMUS_OBJ_VERSION
;
217 IStream_Read (pStream
, &pDesc
->vVersion
, Chunk
.dwSize
, NULL
);
220 case DMUS_FOURCC_CATEGORY_CHUNK
: {
221 TRACE_(dmfile
)(": category chunk\n");
222 pDesc
->dwValidData
|= DMUS_OBJ_CATEGORY
;
223 IStream_Read (pStream
, pDesc
->wszCategory
, Chunk
.dwSize
, NULL
);
227 IStream_Read (pStream
, &Chunk
.fccID
, sizeof(FOURCC
), NULL
);
228 TRACE_(dmfile
)(": LIST chunk of type %s", debugstr_fourcc(Chunk
.fccID
));
229 ListSize
[0] = Chunk
.dwSize
- sizeof(FOURCC
);
231 switch (Chunk
.fccID
) {
232 /* evil M$ UNFO list, which can (!?) contain INFO elements */
233 case DMUS_FOURCC_UNFO_LIST
: {
234 TRACE_(dmfile
)(": UNFO list\n");
236 IStream_Read (pStream
, &Chunk
, sizeof(FOURCC
)+sizeof(DWORD
), NULL
);
237 ListCount
[0] += sizeof(FOURCC
) + sizeof(DWORD
) + Chunk
.dwSize
;
238 TRACE_(dmfile
)(": %s chunk (size = 0x%04lx)", debugstr_fourcc (Chunk
.fccID
), Chunk
.dwSize
);
239 switch (Chunk
.fccID
) {
240 /* don't ask me why, but M$ puts INFO elements in UNFO list sometimes
241 (though strings seem to be valid unicode) */
242 case mmioFOURCC('I','N','A','M'):
243 case DMUS_FOURCC_UNAM_CHUNK
: {
244 TRACE_(dmfile
)(": name chunk\n");
245 pDesc
->dwValidData
|= DMUS_OBJ_NAME
;
246 IStream_Read (pStream
, pDesc
->wszName
, Chunk
.dwSize
, NULL
);
249 case mmioFOURCC('I','A','R','T'):
250 case DMUS_FOURCC_UART_CHUNK
: {
251 TRACE_(dmfile
)(": artist chunk (ignored)\n");
252 liMove
.QuadPart
= Chunk
.dwSize
;
253 IStream_Seek (pStream
, liMove
, STREAM_SEEK_CUR
, NULL
);
256 case mmioFOURCC('I','C','O','P'):
257 case DMUS_FOURCC_UCOP_CHUNK
: {
258 TRACE_(dmfile
)(": copyright chunk (ignored)\n");
259 liMove
.QuadPart
= Chunk
.dwSize
;
260 IStream_Seek (pStream
, liMove
, STREAM_SEEK_CUR
, NULL
);
263 case mmioFOURCC('I','S','B','J'):
264 case DMUS_FOURCC_USBJ_CHUNK
: {
265 TRACE_(dmfile
)(": subject chunk (ignored)\n");
266 liMove
.QuadPart
= Chunk
.dwSize
;
267 IStream_Seek (pStream
, liMove
, STREAM_SEEK_CUR
, NULL
);
270 case mmioFOURCC('I','C','M','T'):
271 case DMUS_FOURCC_UCMT_CHUNK
: {
272 TRACE_(dmfile
)(": comment chunk (ignored)\n");
273 liMove
.QuadPart
= Chunk
.dwSize
;
274 IStream_Seek (pStream
, liMove
, STREAM_SEEK_CUR
, NULL
);
278 TRACE_(dmfile
)(": unknown chunk (irrevelant & skipping)\n");
279 liMove
.QuadPart
= Chunk
.dwSize
;
280 IStream_Seek (pStream
, liMove
, STREAM_SEEK_CUR
, NULL
);
284 TRACE_(dmfile
)(": ListCount[0] = %ld < ListSize[0] = %ld\n", ListCount
[0], ListSize
[0]);
285 } while (ListCount
[0] < ListSize
[0]);
289 TRACE_(dmfile
)(": unknown (skipping)\n");
290 liMove
.QuadPart
= Chunk
.dwSize
- sizeof(FOURCC
);
291 IStream_Seek (pStream
, liMove
, STREAM_SEEK_CUR
, NULL
);
298 TRACE_(dmfile
)(": unknown chunk (irrevelant & skipping)\n");
299 liMove
.QuadPart
= Chunk
.dwSize
;
300 IStream_Seek (pStream
, liMove
, STREAM_SEEK_CUR
, NULL
);
304 TRACE_(dmfile
)(": StreamCount[0] = %ld < StreamSize[0] = %ld\n", StreamCount
, StreamSize
);
305 } while (StreamCount
< StreamSize
);
308 TRACE_(dmfile
)(": unexpected chunk; loading failed)\n");
309 liMove
.QuadPart
= StreamSize
;
310 IStream_Seek (pStream
, liMove
, STREAM_SEEK_CUR
, NULL
); /* skip the rest of the chunk */
314 TRACE_(dmfile
)(": reading finished\n");
318 TRACE_(dmfile
)(": unexpected chunk; loading failed)\n");
319 liMove
.QuadPart
= Chunk
.dwSize
;
320 IStream_Seek (pStream
, liMove
, STREAM_SEEK_CUR
, NULL
); /* skip the rest of the chunk */
321 return DMUS_E_INVALIDFILE
;
325 TRACE(": returning descriptor:\n%s\n", debugstr_DMUS_OBJECTDESC (pDesc
));
330 ICOM_VTABLE(IDirectMusicObject
) DirectMusicBand_Object_Vtbl
= {
331 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
332 IDirectMusicBandImpl_IDirectMusicObject_QueryInterface
,
333 IDirectMusicBandImpl_IDirectMusicObject_AddRef
,
334 IDirectMusicBandImpl_IDirectMusicObject_Release
,
335 IDirectMusicBandImpl_IDirectMusicObject_GetDescriptor
,
336 IDirectMusicBandImpl_IDirectMusicObject_SetDescriptor
,
337 IDirectMusicBandImpl_IDirectMusicObject_ParseDescriptor
340 /* IDirectMusicBandImpl IPersistStream part: */
341 HRESULT WINAPI
IDirectMusicBandImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface
, REFIID riid
, LPVOID
*ppobj
) {
342 ICOM_THIS_MULTI(IDirectMusicBandImpl
, PersistStreamVtbl
, iface
);
343 return IDirectMusicBandImpl_IUnknown_QueryInterface ((LPUNKNOWN
)&This
->UnknownVtbl
, riid
, ppobj
);
346 ULONG WINAPI
IDirectMusicBandImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface
) {
347 ICOM_THIS_MULTI(IDirectMusicBandImpl
, PersistStreamVtbl
, iface
);
348 return IDirectMusicBandImpl_IUnknown_AddRef ((LPUNKNOWN
)&This
->UnknownVtbl
);
351 ULONG WINAPI
IDirectMusicBandImpl_IPersistStream_Release (LPPERSISTSTREAM iface
) {
352 ICOM_THIS_MULTI(IDirectMusicBandImpl
, PersistStreamVtbl
, iface
);
353 return IDirectMusicBandImpl_IUnknown_Release ((LPUNKNOWN
)&This
->UnknownVtbl
);
356 HRESULT WINAPI
IDirectMusicBandImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface
, CLSID
* pClassID
) {
360 HRESULT WINAPI
IDirectMusicBandImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface
) {
364 HRESULT WINAPI
IDirectMusicBandImpl_IPersistStream_Load (LPPERSISTSTREAM iface
, IStream
* pStm
) {
365 ICOM_THIS_MULTI(IDirectMusicBandImpl
, PersistStreamVtbl
, iface
);
366 FIXME("(%p,%p): loading not implemented yet\n", This
, pStm
);
370 HRESULT WINAPI
IDirectMusicBandImpl_IPersistStream_Save (LPPERSISTSTREAM iface
, IStream
* pStm
, BOOL fClearDirty
) {
374 HRESULT WINAPI
IDirectMusicBandImpl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface
, ULARGE_INTEGER
* pcbSize
) {
378 ICOM_VTABLE(IPersistStream
) DirectMusicBand_PersistStream_Vtbl
= {
379 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
380 IDirectMusicBandImpl_IPersistStream_QueryInterface
,
381 IDirectMusicBandImpl_IPersistStream_AddRef
,
382 IDirectMusicBandImpl_IPersistStream_Release
,
383 IDirectMusicBandImpl_IPersistStream_GetClassID
,
384 IDirectMusicBandImpl_IPersistStream_IsDirty
,
385 IDirectMusicBandImpl_IPersistStream_Load
,
386 IDirectMusicBandImpl_IPersistStream_Save
,
387 IDirectMusicBandImpl_IPersistStream_GetSizeMax
390 /* for ClassFactory */
391 HRESULT WINAPI
DMUSIC_CreateDirectMusicBandImpl (LPCGUID lpcGUID
, LPVOID
* ppobj
, LPUNKNOWN pUnkOuter
) {
392 IDirectMusicBandImpl
* obj
;
394 obj
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectMusicBandImpl
));
396 *ppobj
= (LPVOID
) NULL
;
397 return E_OUTOFMEMORY
;
399 obj
->UnknownVtbl
= &DirectMusicBand_Unknown_Vtbl
;
400 obj
->BandVtbl
= &DirectMusicBand_Band_Vtbl
;
401 obj
->ObjectVtbl
= &DirectMusicBand_Object_Vtbl
;
402 obj
->PersistStreamVtbl
= &DirectMusicBand_PersistStream_Vtbl
;
403 obj
->pDesc
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(DMUS_OBJECTDESC
));
404 DM_STRUCT_INIT(obj
->pDesc
);
405 obj
->pDesc
->dwValidData
|= DMUS_OBJ_CLASS
;
406 memcpy (&obj
->pDesc
->guidClass
, &CLSID_DirectMusicBand
, sizeof (CLSID
));
407 obj
->ref
= 0; /* will be inited by QueryInterface */
408 list_init (&obj
->Instruments
);
410 return IDirectMusicBandImpl_IUnknown_QueryInterface ((LPUNKNOWN
)&obj
->UnknownVtbl
, lpcGUID
, ppobj
);