1 /* DirectMusicBand 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 "dmband_private.h"
22 WINE_DEFAULT_DEBUG_CHANNEL(dmband);
26 ICOM_VFIELD(IClassFactory);
30 /******************************************************************
31 * DirectMusicBand ClassFactory
34 static HRESULT WINAPI BandCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
35 ICOM_THIS(IClassFactoryImpl,iface);
36 FIXME("(%p, %s, %p): stub\n",This, debugstr_dmguid(riid), ppobj);
40 static ULONG WINAPI BandCF_AddRef(LPCLASSFACTORY iface) {
41 ICOM_THIS(IClassFactoryImpl,iface);
45 static ULONG WINAPI BandCF_Release(LPCLASSFACTORY iface) {
46 ICOM_THIS(IClassFactoryImpl,iface);
47 /* static class, won't be freed */
51 static HRESULT WINAPI BandCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
52 ICOM_THIS(IClassFactoryImpl,iface);
53 TRACE ("(%p, %p, %s, %p)\n", This, pOuter, debugstr_dmguid(riid), ppobj);
54 return DMUSIC_CreateDirectMusicBandImpl (riid, ppobj, pOuter);
57 static HRESULT WINAPI BandCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
58 ICOM_THIS(IClassFactoryImpl,iface);
59 FIXME("(%p, %d): stub\n", This, dolock);
63 static ICOM_VTABLE(IClassFactory) BandCF_Vtbl = {
64 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
65 BandCF_QueryInterface,
68 BandCF_CreateInstance,
72 static IClassFactoryImpl Band_CF = {&BandCF_Vtbl, 1 };
75 /******************************************************************
76 * DirectMusicBandTrack ClassFactory
79 static HRESULT WINAPI BandTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
80 ICOM_THIS(IClassFactoryImpl,iface);
82 FIXME("(%p, %s, %p): stub\n", This, debugstr_dmguid(riid), ppobj);
86 static ULONG WINAPI BandTrackCF_AddRef(LPCLASSFACTORY iface) {
87 ICOM_THIS(IClassFactoryImpl,iface);
91 static ULONG WINAPI BandTrackCF_Release(LPCLASSFACTORY iface) {
92 ICOM_THIS(IClassFactoryImpl,iface);
93 /* static class, won't be freed */
97 static HRESULT WINAPI BandTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
98 ICOM_THIS(IClassFactoryImpl,iface);
99 TRACE ("(%p, %p, %s, %p)\n", This, pOuter, debugstr_dmguid(riid), ppobj);
100 return DMUSIC_CreateDirectMusicBandTrack (riid, ppobj, pOuter);
103 static HRESULT WINAPI BandTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
104 ICOM_THIS(IClassFactoryImpl,iface);
105 FIXME("(%p, %d): stub\n", This, dolock);
109 static ICOM_VTABLE(IClassFactory) BandTrackCF_Vtbl = {
110 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
111 BandTrackCF_QueryInterface,
114 BandTrackCF_CreateInstance,
115 BandTrackCF_LockServer
118 static IClassFactoryImpl BandTrack_CF = {&BandTrackCF_Vtbl, 1 };
120 /******************************************************************
125 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
126 if (fdwReason == DLL_PROCESS_ATTACH) {
127 DisableThreadLibraryCalls(hinstDLL);
128 /* FIXME: Initialisation */
129 } else if (fdwReason == DLL_PROCESS_DETACH) {
137 /******************************************************************
138 * DllCanUnloadNow (DMBAND.1)
142 HRESULT WINAPI DMBAND_DllCanUnloadNow(void) {
143 FIXME("(void): stub\n");
148 /******************************************************************
149 * DllGetClassObject (DMBAND.2)
153 HRESULT WINAPI DMBAND_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) {
154 TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
156 if (IsEqualCLSID (rclsid, &CLSID_DirectMusicBand) && IsEqualIID (riid, &IID_IClassFactory)) {
157 *ppv = (LPVOID) &Band_CF;
158 IClassFactory_AddRef((IClassFactory*)*ppv);
160 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicBandTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
161 *ppv = (LPVOID) &BandTrack_CF;
162 IClassFactory_AddRef((IClassFactory*)*ppv);
166 WARN("(%s, %s, %p): no interface found.\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
167 return CLASS_E_CLASSNOTAVAILABLE;