mshtml: Check for null pointers in IHTMLLocation_get*.
[wine/hramrach.git] / dlls / dmime / dmime_main.c
blobf4abddd6b5ec0f90ef54f93a55a1c93c0ee56d4b
1 /* DirectMusicInteractiveEngine Main
3 * Copyright (C) 2003-2004 Rok Mandeljc
4 * Copyright (C) 2003-2004 Raphael Junqueira
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "dmime_private.h"
23 WINE_DEFAULT_DEBUG_CHANNEL(dmime);
25 LONG DMIME_refCount = 0;
27 typedef struct {
28 const IClassFactoryVtbl *lpVtbl;
29 } IClassFactoryImpl;
31 /******************************************************************
32 * DirectMusicPerformance ClassFactory
34 static HRESULT WINAPI PerformanceCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
35 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
37 if (ppobj == NULL) return E_POINTER;
39 return E_NOINTERFACE;
42 static ULONG WINAPI PerformanceCF_AddRef(LPCLASSFACTORY iface) {
43 DMIME_LockModule();
45 return 2; /* non-heap based object */
48 static ULONG WINAPI PerformanceCF_Release(LPCLASSFACTORY iface) {
49 DMIME_UnlockModule();
51 return 1; /* non-heap based object */
54 static HRESULT WINAPI PerformanceCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
55 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
57 return DMUSIC_CreateDirectMusicPerformanceImpl (riid, ppobj, pOuter);
60 static HRESULT WINAPI PerformanceCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
61 TRACE("(%d)\n", dolock);
63 if (dolock)
64 DMIME_LockModule();
65 else
66 DMIME_UnlockModule();
68 return S_OK;
71 static const IClassFactoryVtbl PerformanceCF_Vtbl = {
72 PerformanceCF_QueryInterface,
73 PerformanceCF_AddRef,
74 PerformanceCF_Release,
75 PerformanceCF_CreateInstance,
76 PerformanceCF_LockServer
79 static IClassFactoryImpl Performance_CF = {&PerformanceCF_Vtbl};
81 /******************************************************************
82 * DirectMusicSegment ClassFactory
84 static HRESULT WINAPI SegmentCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
85 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
87 if (ppobj == NULL) return E_POINTER;
89 return E_NOINTERFACE;
92 static ULONG WINAPI SegmentCF_AddRef(LPCLASSFACTORY iface) {
93 DMIME_LockModule();
95 return 2; /* non-heap based object */
98 static ULONG WINAPI SegmentCF_Release(LPCLASSFACTORY iface) {
99 DMIME_UnlockModule();
101 return 1; /* non-heap based object */
104 static HRESULT WINAPI SegmentCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
105 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
107 return DMUSIC_CreateDirectMusicSegmentImpl (riid, ppobj, pOuter);
110 static HRESULT WINAPI SegmentCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
111 TRACE("(%d)\n", dolock);
113 if (dolock)
114 DMIME_LockModule();
115 else
116 DMIME_UnlockModule();
118 return S_OK;
121 static const IClassFactoryVtbl SegmentCF_Vtbl = {
122 SegmentCF_QueryInterface,
123 SegmentCF_AddRef,
124 SegmentCF_Release,
125 SegmentCF_CreateInstance,
126 SegmentCF_LockServer
129 static IClassFactoryImpl Segment_CF = {&SegmentCF_Vtbl};
131 /******************************************************************
132 * DirectMusicSegmentState ClassFactory
134 static HRESULT WINAPI SegmentStateCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
135 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
137 if (ppobj == NULL) return E_POINTER;
139 return E_NOINTERFACE;
142 static ULONG WINAPI SegmentStateCF_AddRef(LPCLASSFACTORY iface) {
143 DMIME_LockModule();
145 return 2; /* non-heap based objects */
148 static ULONG WINAPI SegmentStateCF_Release(LPCLASSFACTORY iface) {
149 DMIME_UnlockModule();
151 return 1; /* non-heap based object */
154 static HRESULT WINAPI SegmentStateCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
155 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
157 return DMUSIC_CreateDirectMusicSegmentStateImpl (riid, ppobj, pOuter);
160 static HRESULT WINAPI SegmentStateCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
161 TRACE("(%d)\n", dolock);
163 if (dolock)
164 DMIME_LockModule();
165 else
166 DMIME_UnlockModule();
168 return S_OK;
171 static const IClassFactoryVtbl SegmentStateCF_Vtbl = {
172 SegmentStateCF_QueryInterface,
173 SegmentStateCF_AddRef,
174 SegmentStateCF_Release,
175 SegmentStateCF_CreateInstance,
176 SegmentStateCF_LockServer
179 static IClassFactoryImpl SegmentState_CF = {&SegmentStateCF_Vtbl};
181 /******************************************************************
182 * DirectMusicGraph ClassFactory
184 static HRESULT WINAPI GraphCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
185 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
187 if (ppobj == NULL) return E_POINTER;
189 return E_NOINTERFACE;
192 static ULONG WINAPI GraphCF_AddRef(LPCLASSFACTORY iface) {
193 DMIME_LockModule();
195 return 2; /* non-heap based object */
198 static ULONG WINAPI GraphCF_Release(LPCLASSFACTORY iface) {
199 DMIME_UnlockModule();
201 return 1; /* non-heap based object */
204 static HRESULT WINAPI GraphCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
205 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
207 return DMUSIC_CreateDirectMusicGraphImpl (riid, ppobj, pOuter);
210 static HRESULT WINAPI GraphCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
211 TRACE("(%d)\n", dolock);
213 if (dolock)
214 DMIME_LockModule();
215 else
216 DMIME_UnlockModule();
218 return S_OK;
221 static const IClassFactoryVtbl GraphCF_Vtbl = {
222 GraphCF_QueryInterface,
223 GraphCF_AddRef,
224 GraphCF_Release,
225 GraphCF_CreateInstance,
226 GraphCF_LockServer
229 static IClassFactoryImpl Graph_CF = {&GraphCF_Vtbl};
231 /******************************************************************
232 * DirectMusicTempoTrack ClassFactory
234 static HRESULT WINAPI TempoTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
235 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
237 if (ppobj == NULL) return E_POINTER;
239 return E_NOINTERFACE;
242 static ULONG WINAPI TempoTrackCF_AddRef(LPCLASSFACTORY iface) {
243 DMIME_LockModule();
245 return 2; /* non-heap based object */
248 static ULONG WINAPI TempoTrackCF_Release(LPCLASSFACTORY iface) {
249 DMIME_UnlockModule();
251 return 1; /* non-heap based object */
254 static HRESULT WINAPI TempoTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
255 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
257 return DMUSIC_CreateDirectMusicTempoTrack (riid, ppobj, pOuter);
260 static HRESULT WINAPI TempoTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
261 TRACE("(%d)\n", dolock);
263 if (dolock)
264 DMIME_LockModule();
265 else
266 DMIME_UnlockModule();
268 return S_OK;
271 static const IClassFactoryVtbl TempoTrackCF_Vtbl = {
272 TempoTrackCF_QueryInterface,
273 TempoTrackCF_AddRef,
274 TempoTrackCF_Release,
275 TempoTrackCF_CreateInstance,
276 TempoTrackCF_LockServer
279 static IClassFactoryImpl TempoTrack_CF = {&TempoTrackCF_Vtbl};
281 /******************************************************************
282 * DirectMusicSeqTrack ClassFactory
284 static HRESULT WINAPI SeqTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
285 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
287 if (ppobj == NULL) return E_POINTER;
289 return E_NOINTERFACE;
292 static ULONG WINAPI SeqTrackCF_AddRef(LPCLASSFACTORY iface) {
293 DMIME_LockModule();
295 return 2; /* non-heap based object */
298 static ULONG WINAPI SeqTrackCF_Release(LPCLASSFACTORY iface) {
299 DMIME_UnlockModule();
301 return 1; /* non-heap based object */
304 static HRESULT WINAPI SeqTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
305 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
307 return DMUSIC_CreateDirectMusicSeqTrack (riid, ppobj, pOuter);
310 static HRESULT WINAPI SeqTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
311 TRACE("(%d)\n", dolock);
313 if (dolock)
314 DMIME_LockModule();
315 else
316 DMIME_UnlockModule();
318 return S_OK;
321 static const IClassFactoryVtbl SeqTrackCF_Vtbl = {
322 SeqTrackCF_QueryInterface,
323 SeqTrackCF_AddRef,
324 SeqTrackCF_Release,
325 SeqTrackCF_CreateInstance,
326 SeqTrackCF_LockServer
329 static IClassFactoryImpl SeqTrack_CF = {&SeqTrackCF_Vtbl};
331 /******************************************************************
332 * DirectMusicSysExTrack ClassFactory
334 static HRESULT WINAPI SysExTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
335 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
337 if (ppobj == NULL) return E_POINTER;
339 return E_NOINTERFACE;
342 static ULONG WINAPI SysExTrackCF_AddRef(LPCLASSFACTORY iface) {
343 DMIME_LockModule();
345 return 2; /* non-heap based object */
348 static ULONG WINAPI SysExTrackCF_Release(LPCLASSFACTORY iface) {
349 DMIME_UnlockModule();
351 return 1; /* non-heap based object */
354 static HRESULT WINAPI SysExTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
355 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
356 return DMUSIC_CreateDirectMusicSysExTrack (riid, ppobj, pOuter);
359 static HRESULT WINAPI SysExTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
360 TRACE("(%d)\n", dolock);
362 if (dolock)
363 DMIME_LockModule();
364 else
365 DMIME_UnlockModule();
367 return S_OK;
370 static const IClassFactoryVtbl SysExTrackCF_Vtbl = {
371 SysExTrackCF_QueryInterface,
372 SysExTrackCF_AddRef,
373 SysExTrackCF_Release,
374 SysExTrackCF_CreateInstance,
375 SysExTrackCF_LockServer
378 static IClassFactoryImpl SysExTrack_CF = {&SysExTrackCF_Vtbl};
380 /******************************************************************
381 * DirectMusicTimeSigTrack ClassFactory
383 static HRESULT WINAPI TimeSigTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
384 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
386 if (ppobj == NULL) return E_POINTER;
388 return E_NOINTERFACE;
391 static ULONG WINAPI TimeSigTrackCF_AddRef(LPCLASSFACTORY iface) {
392 DMIME_LockModule();
394 return 2; /* non-heap based object */
397 static ULONG WINAPI TimeSigTrackCF_Release(LPCLASSFACTORY iface) {
398 DMIME_UnlockModule();
400 return 1; /* non-heap based object */
403 static HRESULT WINAPI TimeSigTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
404 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
406 return DMUSIC_CreateDirectMusicTimeSigTrack (riid, ppobj, pOuter);
409 static HRESULT WINAPI TimeSigTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
410 TRACE("(%d)\n", dolock);
412 if (dolock)
413 DMIME_LockModule();
414 else
415 DMIME_UnlockModule();
417 return S_OK;
420 static const IClassFactoryVtbl TimeSigTrackCF_Vtbl = {
421 TimeSigTrackCF_QueryInterface,
422 TimeSigTrackCF_AddRef,
423 TimeSigTrackCF_Release,
424 TimeSigTrackCF_CreateInstance,
425 TimeSigTrackCF_LockServer
428 static IClassFactoryImpl TimeSigTrack_CF = {&TimeSigTrackCF_Vtbl};
430 /******************************************************************
431 * DirectMusicParamControlTrack ClassFactory
433 static HRESULT WINAPI ParamControlTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
434 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
436 if (ppobj == NULL) return E_POINTER;
438 return E_NOINTERFACE;
441 static ULONG WINAPI ParamControlTrackCF_AddRef(LPCLASSFACTORY iface) {
442 DMIME_LockModule();
444 return 2; /* non-heap based object */
447 static ULONG WINAPI ParamControlTrackCF_Release(LPCLASSFACTORY iface) {
448 DMIME_UnlockModule();
450 return 1; /* non-heap based object */
453 static HRESULT WINAPI ParamControlTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
454 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
456 return DMUSIC_CreateDirectMusicParamControlTrack (riid, ppobj, pOuter);
459 static HRESULT WINAPI ParamControlTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
460 TRACE("(%d)\n", dolock);
462 if (dolock)
463 DMIME_LockModule();
464 else
465 DMIME_UnlockModule();
467 return S_OK;
470 static const IClassFactoryVtbl ParamControlTrackCF_Vtbl = {
471 ParamControlTrackCF_QueryInterface,
472 ParamControlTrackCF_AddRef,
473 ParamControlTrackCF_Release,
474 ParamControlTrackCF_CreateInstance,
475 ParamControlTrackCF_LockServer
478 static IClassFactoryImpl ParamControlTrack_CF = {&ParamControlTrackCF_Vtbl};
480 /******************************************************************
481 * DirectMusicMarkerTrack ClassFactory
483 static HRESULT WINAPI MarkerTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
484 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
486 if (ppobj == NULL) return E_POINTER;
488 return E_NOINTERFACE;
491 static ULONG WINAPI MarkerTrackCF_AddRef(LPCLASSFACTORY iface) {
492 DMIME_LockModule();
494 return 2; /* non-heap based object */
497 static ULONG WINAPI MarkerTrackCF_Release(LPCLASSFACTORY iface) {
498 DMIME_UnlockModule();
500 return 1; /* non-heap based object */
503 static HRESULT WINAPI MarkerTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
504 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
506 return DMUSIC_CreateDirectMusicMarkerTrack (riid, ppobj, pOuter);
509 static HRESULT WINAPI MarkerTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
510 TRACE("(%d)\n", dolock);
512 if (dolock)
513 DMIME_LockModule();
514 else
515 DMIME_UnlockModule();
517 return S_OK;
520 static const IClassFactoryVtbl MarkerTrackCF_Vtbl = {
521 MarkerTrackCF_QueryInterface,
522 MarkerTrackCF_AddRef,
523 MarkerTrackCF_Release,
524 MarkerTrackCF_CreateInstance,
525 MarkerTrackCF_LockServer
528 static IClassFactoryImpl MarkerTrack_CF = {&MarkerTrackCF_Vtbl};
530 /******************************************************************
531 * DirectMusicLyricsTrack ClassFactory
533 static HRESULT WINAPI LyricsTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
534 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
536 if (ppobj == NULL) return E_POINTER;
538 return E_NOINTERFACE;
541 static ULONG WINAPI LyricsTrackCF_AddRef(LPCLASSFACTORY iface) {
542 DMIME_LockModule();
544 return 2; /* non-heap based object */
547 static ULONG WINAPI LyricsTrackCF_Release(LPCLASSFACTORY iface) {
548 DMIME_UnlockModule();
550 return 1; /* non-heap based object */
553 static HRESULT WINAPI LyricsTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
554 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
556 return DMUSIC_CreateDirectMusicLyricsTrack (riid, ppobj, pOuter);
559 static HRESULT WINAPI LyricsTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
560 TRACE("(%d)\n", dolock);
562 if (dolock)
563 DMIME_LockModule();
564 else
565 DMIME_UnlockModule();
567 return S_OK;
570 static const IClassFactoryVtbl LyricsTrackCF_Vtbl = {
571 LyricsTrackCF_QueryInterface,
572 LyricsTrackCF_AddRef,
573 LyricsTrackCF_Release,
574 LyricsTrackCF_CreateInstance,
575 LyricsTrackCF_LockServer
578 static IClassFactoryImpl LyricsTrack_CF = {&LyricsTrackCF_Vtbl};
581 /******************************************************************
582 * DirectMusicSegTriggerTrack ClassFactory
584 static HRESULT WINAPI SegTriggerTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
585 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
587 if (ppobj == NULL) return E_POINTER;
589 return E_NOINTERFACE;
592 static ULONG WINAPI SegTriggerTrackCF_AddRef(LPCLASSFACTORY iface) {
593 DMIME_LockModule();
595 return 2; /* non-heap based object */
598 static ULONG WINAPI SegTriggerTrackCF_Release(LPCLASSFACTORY iface) {
599 DMIME_UnlockModule();
601 return 1; /* non-heap based object */
604 static HRESULT WINAPI SegTriggerTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
605 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
607 return DMUSIC_CreateDirectMusicSegTriggerTrack (riid, ppobj, pOuter);
610 static HRESULT WINAPI SegTriggerTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
611 TRACE("(%d)\n", dolock);
613 if (dolock)
614 DMIME_LockModule();
615 else
616 DMIME_UnlockModule();
618 return S_OK;
621 static const IClassFactoryVtbl SegTriggerTrackCF_Vtbl = {
622 SegTriggerTrackCF_QueryInterface,
623 SegTriggerTrackCF_AddRef,
624 SegTriggerTrackCF_Release,
625 SegTriggerTrackCF_CreateInstance,
626 SegTriggerTrackCF_LockServer
629 static IClassFactoryImpl SegTriggerTrack_CF = {&SegTriggerTrackCF_Vtbl};
631 /******************************************************************
632 * DirectMusicAudioPath ClassFactory
634 static HRESULT WINAPI AudioPathCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
635 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
637 if (ppobj == NULL) return E_POINTER;
639 return E_NOINTERFACE;
642 static ULONG WINAPI AudioPathCF_AddRef(LPCLASSFACTORY iface) {
643 DMIME_LockModule();
645 return 2; /* non-heap based object */
648 static ULONG WINAPI AudioPathCF_Release(LPCLASSFACTORY iface) {
649 DMIME_UnlockModule();
651 return 1; /* non-heap based object */
654 static HRESULT WINAPI AudioPathCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
655 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
657 return DMUSIC_CreateDirectMusicAudioPathImpl (riid, ppobj, pOuter);
660 static HRESULT WINAPI AudioPathCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
661 TRACE("(%d)\n", dolock);
663 if (dolock)
664 DMIME_LockModule();
665 else
666 DMIME_UnlockModule();
668 return S_OK;
671 static const IClassFactoryVtbl AudioPathCF_Vtbl = {
672 AudioPathCF_QueryInterface,
673 AudioPathCF_AddRef,
674 AudioPathCF_Release,
675 AudioPathCF_CreateInstance,
676 AudioPathCF_LockServer
679 static IClassFactoryImpl AudioPath_CF = {&AudioPathCF_Vtbl};
681 /******************************************************************
682 * DirectMusicWaveTrack ClassFactory
684 static HRESULT WINAPI WaveTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
685 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
687 if (ppobj == NULL) return E_POINTER;
689 return E_NOINTERFACE;
692 static ULONG WINAPI WaveTrackCF_AddRef(LPCLASSFACTORY iface) {
693 DMIME_LockModule();
695 return 2; /* non-heap based object */
698 static ULONG WINAPI WaveTrackCF_Release(LPCLASSFACTORY iface) {
699 DMIME_UnlockModule();
701 return 1; /* non-heap based object */
704 static HRESULT WINAPI WaveTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
705 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
707 return DMUSIC_CreateDirectMusicWaveTrack (riid, ppobj, pOuter);
710 static HRESULT WINAPI WaveTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
711 TRACE("(%d)\n", dolock);
713 if (dolock)
714 DMIME_LockModule();
715 else
716 DMIME_UnlockModule();
718 return S_OK;
721 static const IClassFactoryVtbl WaveTrackCF_Vtbl = {
722 WaveTrackCF_QueryInterface,
723 WaveTrackCF_AddRef,
724 WaveTrackCF_Release,
725 WaveTrackCF_CreateInstance,
726 WaveTrackCF_LockServer
729 static IClassFactoryImpl WaveTrack_CF = {&WaveTrackCF_Vtbl};
731 /******************************************************************
732 * DllMain
736 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
737 if (fdwReason == DLL_PROCESS_ATTACH) {
738 DisableThreadLibraryCalls(hinstDLL);
739 /* FIXME: Initialisation */
741 else if (fdwReason == DLL_PROCESS_DETACH) {
742 /* FIXME: Cleanup */
745 return TRUE;
749 /******************************************************************
750 * DllCanUnloadNow (DMIME.1)
754 HRESULT WINAPI DllCanUnloadNow(void)
756 return DMIME_refCount != 0 ? S_FALSE : S_OK;
760 /******************************************************************
761 * DllGetClassObject (DMIME.@)
765 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
767 TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
768 if (IsEqualCLSID (rclsid, &CLSID_DirectMusicPerformance) && IsEqualIID (riid, &IID_IClassFactory)) {
769 *ppv = &Performance_CF;
770 IClassFactory_AddRef((IClassFactory*)*ppv);
771 return S_OK;
772 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSegment) && IsEqualIID (riid, &IID_IClassFactory)) {
773 *ppv = &Segment_CF;
774 IClassFactory_AddRef((IClassFactory*)*ppv);
775 return S_OK;
776 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSegmentState) && IsEqualIID (riid, &IID_IClassFactory)) {
777 *ppv = &SegmentState_CF;
778 IClassFactory_AddRef((IClassFactory*)*ppv);
779 return S_OK;
780 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicGraph) && IsEqualIID (riid, &IID_IClassFactory)) {
781 *ppv = &Graph_CF;
782 IClassFactory_AddRef((IClassFactory*)*ppv);
783 return S_OK;
784 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicTempoTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
785 *ppv = &TempoTrack_CF;
786 IClassFactory_AddRef((IClassFactory*)*ppv);
787 return S_OK;
788 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSeqTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
789 *ppv = &SeqTrack_CF;
790 IClassFactory_AddRef((IClassFactory*)*ppv);
791 return S_OK;
792 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSysExTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
793 *ppv = &SysExTrack_CF;
794 IClassFactory_AddRef((IClassFactory*)*ppv);
795 return S_OK;
796 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicTimeSigTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
797 *ppv = &TimeSigTrack_CF;
798 IClassFactory_AddRef((IClassFactory*)*ppv);
799 return S_OK;
800 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicParamControlTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
801 *ppv = &ParamControlTrack_CF;
802 IClassFactory_AddRef((IClassFactory*)*ppv);
803 return S_OK;
804 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicMarkerTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
805 *ppv = &MarkerTrack_CF;
806 IClassFactory_AddRef((IClassFactory*)*ppv);
807 return S_OK;
808 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicLyricsTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
809 *ppv = &LyricsTrack_CF;
810 IClassFactory_AddRef((IClassFactory*)*ppv);
811 return S_OK;
812 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSegTriggerTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
813 *ppv = &SegTriggerTrack_CF;
814 IClassFactory_AddRef((IClassFactory*)*ppv);
815 return S_OK;
816 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicAudioPath) && IsEqualIID (riid, &IID_IClassFactory)) {
817 *ppv = &AudioPath_CF;
818 IClassFactory_AddRef((IClassFactory*)*ppv);
819 return S_OK;
820 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicWaveTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
821 *ppv = &WaveTrack_CF;
822 IClassFactory_AddRef((IClassFactory*)*ppv);
823 return S_OK;
826 WARN("(%s, %s, %p): no interface found.\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
827 return CLASS_E_CLASSNOTAVAILABLE;