Remove obsolete code from DOSVM_Wait.
[wine] / dlls / dmusic / dmusic_instrument.c
1 /* IDirectMusicInstrument Implementation
2  * IDirectMusicDownloadedInstrument Implementation
3  * IDirectMusicCollection Implementation
4  *
5  * Copyright (C) 2003 Rok Mandeljc
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20  */
21
22 #include "windef.h"
23 #include "winbase.h"
24 #include "winuser.h"
25 #include "wingdi.h"
26 #include "wine/debug.h"
27
28 #include "dmusic_private.h"
29
30 WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
31
32 /* IDirectMusicInstrument IUnknown parts follow: */
33 HRESULT WINAPI IDirectMusicInstrumentImpl_QueryInterface (LPDIRECTMUSICINSTRUMENT iface, REFIID riid, LPVOID *ppobj)
34 {
35         ICOM_THIS(IDirectMusicInstrumentImpl,iface);
36
37         if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicInstrument))
38         {
39                 IDirectMusicInstrumentImpl_AddRef(iface);
40                 *ppobj = This;
41                 return DS_OK;
42         }
43         WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
44         return E_NOINTERFACE;
45 }
46
47 ULONG WINAPI IDirectMusicInstrumentImpl_AddRef (LPDIRECTMUSICINSTRUMENT iface)
48 {
49         ICOM_THIS(IDirectMusicInstrumentImpl,iface);
50         TRACE("(%p) : AddRef from %ld\n", This, This->ref);
51         return ++(This->ref);
52 }
53
54 ULONG WINAPI IDirectMusicInstrumentImpl_Release (LPDIRECTMUSICINSTRUMENT iface)
55 {
56         ICOM_THIS(IDirectMusicInstrumentImpl,iface);
57         ULONG ref = --This->ref;
58         TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
59         if (ref == 0)
60         {
61                 HeapFree(GetProcessHeap(), 0, This);
62         }
63         return ref;
64 }
65
66 /* IDirectMusicInstrument Interface follow: */
67 HRESULT WINAPI IDirectMusicInstrumentImpl_GetPatch (LPDIRECTMUSICINSTRUMENT iface, DWORD* pdwPatch)
68 {
69         FIXME("stub\n");
70         return DS_OK;
71 }
72
73 HRESULT WINAPI IDirectMusicInstrumentImpl_SetPatch (LPDIRECTMUSICINSTRUMENT iface, DWORD dwPatch)
74 {
75         FIXME("stub\n");
76         return DS_OK;
77 }
78
79 ICOM_VTABLE(IDirectMusicInstrument) DirectMusicInstrument_Vtbl =
80 {
81     ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
82         IDirectMusicInstrumentImpl_QueryInterface,
83         IDirectMusicInstrumentImpl_AddRef,
84         IDirectMusicInstrumentImpl_Release,
85         IDirectMusicInstrumentImpl_GetPatch,
86         IDirectMusicInstrumentImpl_SetPatch
87 };
88
89
90 /* IDirectMusicDownloadedInstrument IUnknown parts follow: */
91 HRESULT WINAPI IDirectMusicDownloadedInstrumentImpl_QueryInterface (LPDIRECTMUSICDOWNLOADEDINSTRUMENT iface, REFIID riid, LPVOID *ppobj)
92 {
93         ICOM_THIS(IDirectMusicDownloadedInstrumentImpl,iface);
94
95         if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicDownloadedInstrument))
96         {
97                 IDirectMusicDownloadedInstrumentImpl_AddRef(iface);
98                 *ppobj = This;
99                 return DS_OK;
100         }
101         WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
102         return E_NOINTERFACE;
103 }
104
105 ULONG WINAPI IDirectMusicDownloadedInstrumentImpl_AddRef (LPDIRECTMUSICDOWNLOADEDINSTRUMENT iface)
106 {
107         ICOM_THIS(IDirectMusicDownloadedInstrumentImpl,iface);
108         TRACE("(%p) : AddRef from %ld\n", This, This->ref);
109         return ++(This->ref);
110 }
111
112 ULONG WINAPI IDirectMusicDownloadedInstrumentImpl_Release (LPDIRECTMUSICDOWNLOADEDINSTRUMENT iface)
113 {
114         ICOM_THIS(IDirectMusicDownloadedInstrumentImpl,iface);
115         ULONG ref = --This->ref;
116         TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
117         if (ref == 0)
118         {
119                 HeapFree(GetProcessHeap(), 0, This);
120         }
121         return ref;
122 }
123
124 /* IDirectMusicDownloadedInstrument Interface follow: */
125 /* none at this time */
126
127 ICOM_VTABLE(IDirectMusicDownloadedInstrument) DirectMusicDownloadedInstrument_Vtbl =
128 {
129     ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
130         IDirectMusicDownloadedInstrumentImpl_QueryInterface,
131         IDirectMusicDownloadedInstrumentImpl_AddRef,
132         IDirectMusicDownloadedInstrumentImpl_Release
133 };
134
135
136 /* IDirectMusicCollection IUnknown parts follow: */
137 HRESULT WINAPI IDirectMusicCollectionImpl_QueryInterface (LPDIRECTMUSICCOLLECTION iface, REFIID riid, LPVOID *ppobj)
138 {
139         ICOM_THIS(IDirectMusicCollectionImpl,iface);
140
141         if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicCollection))
142         {
143                 IDirectMusicCollectionImpl_AddRef(iface);
144                 *ppobj = This;
145                 return DS_OK;
146         }
147         WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
148         return E_NOINTERFACE;
149 }
150
151 ULONG WINAPI IDirectMusicCollectionImpl_AddRef (LPDIRECTMUSICCOLLECTION iface)
152 {
153         ICOM_THIS(IDirectMusicCollectionImpl,iface);
154         TRACE("(%p) : AddRef from %ld\n", This, This->ref);
155         return ++(This->ref);
156 }
157
158 ULONG WINAPI IDirectMusicCollectionImpl_Release (LPDIRECTMUSICCOLLECTION iface)
159 {
160         ICOM_THIS(IDirectMusicCollectionImpl,iface);
161         ULONG ref = --This->ref;
162         TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
163         if (ref == 0)
164         {
165                 HeapFree(GetProcessHeap(), 0, This);
166         }
167         return ref;
168 }
169
170 /* IDirectMusicCollection Interface follow: */
171 HRESULT WINAPI IDirectMusicCollectionImpl_GetInstrument (LPDIRECTMUSICCOLLECTION iface, DWORD dwPatch, IDirectMusicInstrument** ppInstrument)
172 {
173         FIXME("stub\n");
174         return DS_OK;
175 }
176
177 HRESULT WINAPI IDirectMusicCollectionImpl_EnumInstrument (LPDIRECTMUSICCOLLECTION iface, DWORD dwIndex, DWORD* pdwPatch, LPWSTR pwszName, DWORD dwNameLen)
178 {
179         FIXME("stub\n");
180         return DS_OK;
181 }
182
183 ICOM_VTABLE(IDirectMusicCollection) DirectMusicCollection_Vtbl =
184 {
185     ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
186         IDirectMusicCollectionImpl_QueryInterface,
187         IDirectMusicCollectionImpl_AddRef,
188         IDirectMusicCollectionImpl_Release,
189         IDirectMusicCollectionImpl_GetInstrument,
190         IDirectMusicCollectionImpl_EnumInstrument
191 };