Removed some uses of the non-standard ICOM_THIS macro.
[wine/multimedia.git] / dlls / dmstyle / dmstyle_main.c
blob7bb9c81152094ddefaca8c79e50d564422fb684a
1 /* DirectMusicStyle Main
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 "dmstyle_private.h"
22 WINE_DEFAULT_DEBUG_CHANNEL(dmstyle);
24 typedef struct {
25 /* IUnknown fields */
26 IClassFactoryVtbl *lpVtbl;
27 DWORD ref;
28 } IClassFactoryImpl;
30 /******************************************************************
31 * DirectMusicSection ClassFactory
33 static HRESULT WINAPI SectionCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
34 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
35 FIXME("(%p, %s, %p): stub\n", This, debugstr_dmguid(riid), ppobj);
36 return E_NOINTERFACE;
39 static ULONG WINAPI SectionCF_AddRef(LPCLASSFACTORY iface) {
40 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
41 return ++(This->ref);
44 static ULONG WINAPI SectionCF_Release(LPCLASSFACTORY iface) {
45 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
46 /* static class, won't be freed */
47 return --(This->ref);
50 static HRESULT WINAPI SectionCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
51 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
52 TRACE ("(%p, %p, %s, %p)\n", This, pOuter, debugstr_dmguid(riid), ppobj);
53 /* nothing here yet */
54 WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ppobj);
55 return E_NOINTERFACE;
58 static HRESULT WINAPI SectionCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
59 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
60 FIXME("(%p, %d): stub\n", This, dolock);
61 return S_OK;
64 static IClassFactoryVtbl SectionCF_Vtbl = {
65 SectionCF_QueryInterface,
66 SectionCF_AddRef,
67 SectionCF_Release,
68 SectionCF_CreateInstance,
69 SectionCF_LockServer
72 static IClassFactoryImpl Section_CF = {&SectionCF_Vtbl, 1 };
74 /******************************************************************
75 * DirectMusicStyle ClassFactory
77 static HRESULT WINAPI StyleCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
78 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
79 FIXME("(%p, %s, %p): stub\n", This, debugstr_dmguid(riid), ppobj);
80 return E_NOINTERFACE;
83 static ULONG WINAPI StyleCF_AddRef(LPCLASSFACTORY iface) {
84 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
85 return ++(This->ref);
88 static ULONG WINAPI StyleCF_Release(LPCLASSFACTORY iface) {
89 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
90 /* static class, won't be freed */
91 return --(This->ref);
94 static HRESULT WINAPI StyleCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
95 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
96 TRACE ("(%p, %p, %s, %p)\n", This, pOuter, debugstr_dmguid(riid), ppobj);
97 return DMUSIC_CreateDirectMusicStyleImpl (riid, ppobj, pOuter);
100 static HRESULT WINAPI StyleCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
101 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
102 FIXME("(%p, %d): stub\n", This, dolock);
103 return S_OK;
106 static IClassFactoryVtbl StyleCF_Vtbl = {
107 StyleCF_QueryInterface,
108 StyleCF_AddRef,
109 StyleCF_Release,
110 StyleCF_CreateInstance,
111 StyleCF_LockServer
114 static IClassFactoryImpl Style_CF = {&StyleCF_Vtbl, 1 };
116 /******************************************************************
117 * DirectMusicChordTrack ClassFactory
119 static HRESULT WINAPI ChordTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
120 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
121 FIXME("(%p, %s, %p): stub\n", This, debugstr_dmguid(riid), ppobj);
122 return E_NOINTERFACE;
125 static ULONG WINAPI ChordTrackCF_AddRef(LPCLASSFACTORY iface) {
126 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
127 return ++(This->ref);
130 static ULONG WINAPI ChordTrackCF_Release(LPCLASSFACTORY iface) {
131 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
132 /* static class, won't be freed */
133 return --(This->ref);
136 static HRESULT WINAPI ChordTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
137 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
138 TRACE ("(%p, %p, %s, %p)\n", This, pOuter, debugstr_dmguid(riid), ppobj);
139 return DMUSIC_CreateDirectMusicChordTrack (riid, ppobj, pOuter);
142 static HRESULT WINAPI ChordTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
143 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
144 FIXME("(%p, %d): stub\n", This, dolock);
145 return S_OK;
148 static IClassFactoryVtbl ChordTrackCF_Vtbl = {
149 ChordTrackCF_QueryInterface,
150 ChordTrackCF_AddRef,
151 ChordTrackCF_Release,
152 ChordTrackCF_CreateInstance,
153 ChordTrackCF_LockServer
156 static IClassFactoryImpl ChordTrack_CF = {&ChordTrackCF_Vtbl, 1 };
158 /******************************************************************
159 * DirectMusicCommandTrack ClassFactory
161 static HRESULT WINAPI CommandTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
162 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
163 FIXME("(%p, %s, %p): stub\n", This, debugstr_dmguid(riid), ppobj);
164 return E_NOINTERFACE;
167 static ULONG WINAPI CommandTrackCF_AddRef(LPCLASSFACTORY iface) {
168 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
169 return ++(This->ref);
172 static ULONG WINAPI CommandTrackCF_Release(LPCLASSFACTORY iface) {
173 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
174 /* static class, won't be freed */
175 return --(This->ref);
178 static HRESULT WINAPI CommandTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
179 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
180 TRACE ("(%p, %p, %s, %p)\n", This, pOuter, debugstr_dmguid(riid), ppobj);
181 return DMUSIC_CreateDirectMusicCommandTrack (riid, ppobj, pOuter);
184 static HRESULT WINAPI CommandTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
185 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
186 FIXME("(%p, %d): stub\n", This, dolock);
187 return S_OK;
190 static IClassFactoryVtbl CommandTrackCF_Vtbl = {
191 CommandTrackCF_QueryInterface,
192 CommandTrackCF_AddRef,
193 CommandTrackCF_Release,
194 CommandTrackCF_CreateInstance,
195 CommandTrackCF_LockServer
198 static IClassFactoryImpl CommandTrack_CF = {&CommandTrackCF_Vtbl, 1 };
200 /******************************************************************
201 * DirectMusicStyleTrack ClassFactory
203 static HRESULT WINAPI StyleTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
204 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
205 FIXME("(%p, %s, %p): stub\n", This, debugstr_dmguid(riid), ppobj);
206 return E_NOINTERFACE;
209 static ULONG WINAPI StyleTrackCF_AddRef(LPCLASSFACTORY iface) {
210 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
211 return ++(This->ref);
214 static ULONG WINAPI StyleTrackCF_Release(LPCLASSFACTORY iface) {
215 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
216 /* static class, won't be freed */
217 return --(This->ref);
220 static HRESULT WINAPI StyleTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
221 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
222 TRACE ("(%p, %p, %s, %p)\n", This, pOuter, debugstr_dmguid(riid), ppobj);
223 return DMUSIC_CreateDirectMusicStyleTrack (riid, ppobj, pOuter);
226 static HRESULT WINAPI StyleTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
227 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
228 FIXME("(%p, %d): stub\n", This, dolock);
229 return S_OK;
232 static IClassFactoryVtbl StyleTrackCF_Vtbl = {
233 StyleTrackCF_QueryInterface,
234 StyleTrackCF_AddRef,
235 StyleTrackCF_Release,
236 StyleTrackCF_CreateInstance,
237 StyleTrackCF_LockServer
240 static IClassFactoryImpl StyleTrack_CF = {&StyleTrackCF_Vtbl, 1 };
242 /******************************************************************
243 * DirectMusicMotifTrack ClassFactory
245 static HRESULT WINAPI MotifTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
246 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
247 FIXME("(%p, %s, %p): stub\n", This, debugstr_dmguid(riid), ppobj);
248 return E_NOINTERFACE;
251 static ULONG WINAPI MotifTrackCF_AddRef(LPCLASSFACTORY iface) {
252 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
253 return ++(This->ref);
256 static ULONG WINAPI MotifTrackCF_Release(LPCLASSFACTORY iface) {
257 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
258 /* static class, won't be freed */
259 return --(This->ref);
262 static HRESULT WINAPI MotifTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
263 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
264 TRACE ("(%p, %p, %s, %p)\n", This, pOuter, debugstr_dmguid(riid), ppobj);
265 return DMUSIC_CreateDirectMusicMotifTrack (riid, ppobj, pOuter);
268 static HRESULT WINAPI MotifTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
269 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
270 FIXME("(%p, %d): stub\n", This, dolock);
271 return S_OK;
274 static IClassFactoryVtbl MotifTrackCF_Vtbl = {
275 MotifTrackCF_QueryInterface,
276 MotifTrackCF_AddRef,
277 MotifTrackCF_Release,
278 MotifTrackCF_CreateInstance,
279 MotifTrackCF_LockServer
282 static IClassFactoryImpl MotifTrack_CF = {&MotifTrackCF_Vtbl, 1 };
284 /******************************************************************
285 * DirectMusicAuditionTrack ClassFactory
287 static HRESULT WINAPI AuditionTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
288 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
289 FIXME("(%p, %s, %p): stub\n", This, debugstr_dmguid(riid), ppobj);
290 return E_NOINTERFACE;
293 static ULONG WINAPI AuditionTrackCF_AddRef(LPCLASSFACTORY iface) {
294 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
295 return ++(This->ref);
298 static ULONG WINAPI AuditionTrackCF_Release(LPCLASSFACTORY iface) {
299 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
300 /* static class, won't be freed */
301 return --(This->ref);
304 static HRESULT WINAPI AuditionTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
305 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
306 TRACE ("(%p, %p, %s, %p)\n", This, pOuter, debugstr_dmguid(riid), ppobj);
307 return DMUSIC_CreateDirectMusicAuditionTrack (riid, ppobj, pOuter);
310 static HRESULT WINAPI AuditionTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
311 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
312 FIXME("(%p, %d): stub\n", This, dolock);
313 return S_OK;
316 static IClassFactoryVtbl AuditionTrackCF_Vtbl = {
317 AuditionTrackCF_QueryInterface,
318 AuditionTrackCF_AddRef,
319 AuditionTrackCF_Release,
320 AuditionTrackCF_CreateInstance,
321 AuditionTrackCF_LockServer
324 static IClassFactoryImpl AuditionTrack_CF = {&AuditionTrackCF_Vtbl, 1 };
326 /******************************************************************
327 * DirectMusicMuteTrack ClassFactory
329 static HRESULT WINAPI MuteTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
330 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
331 FIXME("(%p, %s, %p): stub\n", This, debugstr_dmguid(riid), ppobj);
332 return E_NOINTERFACE;
335 static ULONG WINAPI MuteTrackCF_AddRef(LPCLASSFACTORY iface) {
336 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
337 return ++(This->ref);
340 static ULONG WINAPI MuteTrackCF_Release(LPCLASSFACTORY iface) {
341 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
342 /* static class, won't be freed */
343 return --(This->ref);
346 static HRESULT WINAPI MuteTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
347 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
348 TRACE ("(%p, %p, %s, %p)\n", This, pOuter, debugstr_dmguid(riid), ppobj);
349 return DMUSIC_CreateDirectMusicMuteTrack (riid, ppobj, pOuter);
352 static HRESULT WINAPI MuteTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
353 IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
354 FIXME("(%p, %d): stub\n", This, dolock);
355 return S_OK;
358 static IClassFactoryVtbl MuteTrackCF_Vtbl = {
359 MuteTrackCF_QueryInterface,
360 MuteTrackCF_AddRef,
361 MuteTrackCF_Release,
362 MuteTrackCF_CreateInstance,
363 MuteTrackCF_LockServer
366 static IClassFactoryImpl MuteTrack_CF = {&MuteTrackCF_Vtbl, 1 };
368 /******************************************************************
369 * DllMain
373 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
374 if (fdwReason == DLL_PROCESS_ATTACH) {
375 DisableThreadLibraryCalls(hinstDLL);
376 /* FIXME: Initialisation */
377 } else if (fdwReason == DLL_PROCESS_DETACH) {
378 /* FIXME: Cleanup */
381 return TRUE;
385 /******************************************************************
386 * DllCanUnloadNow (DMSTYLE.1)
390 HRESULT WINAPI DMSTYLE_DllCanUnloadNow(void) {
391 FIXME("(void): stub\n");
392 return S_FALSE;
396 /******************************************************************
397 * DllGetClassObject (DMSTYLE.2)
401 HRESULT WINAPI DMSTYLE_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) {
402 TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
404 if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSection) && IsEqualIID (riid, &IID_IClassFactory)) {
405 *ppv = (LPVOID) &Section_CF;
406 IClassFactory_AddRef((IClassFactory*)*ppv);
407 return S_OK;
408 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicStyle) && IsEqualIID (riid, &IID_IClassFactory)) {
409 *ppv = (LPVOID) &Style_CF;
410 IClassFactory_AddRef((IClassFactory*)*ppv);
411 return S_OK;
412 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicChordTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
413 *ppv = (LPVOID) &ChordTrack_CF;
414 IClassFactory_AddRef((IClassFactory*)*ppv);
415 return S_OK;
416 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicCommandTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
417 *ppv = (LPVOID) &CommandTrack_CF;
418 IClassFactory_AddRef((IClassFactory*)*ppv);
419 return S_OK;
420 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicStyleTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
421 *ppv = (LPVOID) &StyleTrack_CF;
422 IClassFactory_AddRef((IClassFactory*)*ppv);
423 return S_OK;
424 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicMotifTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
425 *ppv = (LPVOID) &MotifTrack_CF;
426 IClassFactory_AddRef((IClassFactory*)*ppv);
427 return S_OK;
428 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicAuditionTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
429 *ppv = (LPVOID) &AuditionTrack_CF;
430 IClassFactory_AddRef((IClassFactory*)*ppv);
431 return S_OK;
432 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicMuteTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
433 *ppv = (LPVOID) &MuteTrack_CF;
434 IClassFactory_AddRef((IClassFactory*)*ppv);
435 return S_OK;
438 WARN("(%s, %s, %p): no interface found.\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
439 return CLASS_E_CLASSNOTAVAILABLE;