1 /* IDirectMusicObject Implementation
3 * Copyright (C) 2003 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.
32 #include "wine/windef16.h"
33 #include "wine/winbase16.h"
34 #include "wine/debug.h"
37 #include "dmusic_private.h"
39 WINE_DEFAULT_DEBUG_CHANNEL(dmusic
);
41 /* IDirectMusicObject IUnknown parts follow: */
42 HRESULT WINAPI
IDirectMusicObjectImpl_QueryInterface (LPDIRECTMUSICOBJECT iface
, REFIID riid
, LPVOID
*ppobj
)
44 ICOM_THIS(IDirectMusicObjectImpl
,iface
);
46 if (IsEqualGUID(riid
, &IID_IUnknown
) || IsEqualGUID(riid
, &IID_IDirectMusicObject
))
48 IDirectMusicObjectImpl_AddRef(iface
);
52 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppobj
);
56 ULONG WINAPI
IDirectMusicObjectImpl_AddRef (LPDIRECTMUSICOBJECT iface
)
58 ICOM_THIS(IDirectMusicObjectImpl
,iface
);
59 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
63 ULONG WINAPI
IDirectMusicObjectImpl_Release (LPDIRECTMUSICOBJECT iface
)
65 ICOM_THIS(IDirectMusicObjectImpl
,iface
);
66 ULONG ref
= --This
->ref
;
67 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
70 HeapFree(GetProcessHeap(), 0, This
);
75 /* IDirectMusicObject Interface follow: */
76 HRESULT WINAPI
IDirectMusicObjectImpl_GetDescriptor (LPDIRECTMUSICOBJECT iface
, LPDMUS_OBJECTDESC pDesc
)
78 ICOM_THIS(IDirectMusicObjectImpl
,iface
);
80 TRACE("(%p, %p)\n", This
, pDesc
);
86 HRESULT WINAPI
IDirectMusicObjectImpl_SetDescriptor (LPDIRECTMUSICOBJECT iface
, LPDMUS_OBJECTDESC pDesc
)
88 ICOM_THIS(IDirectMusicObjectImpl
,iface
);
90 TRACE("(%p, %p)\n", This
, pDesc
);
96 HRESULT WINAPI
IDirectMusicObjectImpl_ParseDescriptor (LPDIRECTMUSICOBJECT iface
, LPSTREAM pStream
, LPDMUS_OBJECTDESC pDesc
)
98 ICOM_THIS(IDirectMusicObjectImpl
,iface
);
100 FIXME("(%p, %p, %p): stub\n", This
, pStream
, pDesc
);
105 ICOM_VTABLE(IDirectMusicObject
) DirectMusicObject_Vtbl
=
107 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
108 IDirectMusicObjectImpl_QueryInterface
,
109 IDirectMusicObjectImpl_AddRef
,
110 IDirectMusicObjectImpl_Release
,
111 IDirectMusicObjectImpl_GetDescriptor
,
112 IDirectMusicObjectImpl_SetDescriptor
,
113 IDirectMusicObjectImpl_ParseDescriptor
116 /* for ClassFactory */
117 HRESULT WINAPI
DMUSIC_CreateDirectMusicObject (LPCGUID lpcGUID
, LPDIRECTMUSICOBJECT
* ppDMObj
, LPUNKNOWN pUnkOuter
)
119 if (IsEqualGUID (lpcGUID
, &IID_IDirectMusicObject
))
122 return E_NOINTERFACE
;
124 WARN("No interface found\n");
126 return E_NOINTERFACE
;