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);
37 FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
41 static ULONG WINAPI BandCF_AddRef(LPCLASSFACTORY iface) {
42 ICOM_THIS(IClassFactoryImpl,iface);
46 static ULONG WINAPI BandCF_Release(LPCLASSFACTORY iface) {
47 ICOM_THIS(IClassFactoryImpl,iface);
48 /* static class, won't be freed */
52 static HRESULT WINAPI BandCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
53 ICOM_THIS(IClassFactoryImpl,iface);
54 TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
55 return DMUSIC_CreateDirectMusicBandImpl (riid, ppobj, pOuter);
58 static HRESULT WINAPI BandCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
59 ICOM_THIS(IClassFactoryImpl,iface);
60 FIXME("(%p)->(%d),stub!\n", This, dolock);
64 static ICOM_VTABLE(IClassFactory) BandCF_Vtbl = {
65 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
66 BandCF_QueryInterface,
69 BandCF_CreateInstance,
73 static IClassFactoryImpl Band_CF = {&BandCF_Vtbl, 1 };
76 /******************************************************************
77 * DirectMusicBandTrack ClassFactory
80 static HRESULT WINAPI BandTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
81 ICOM_THIS(IClassFactoryImpl,iface);
83 FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
87 static ULONG WINAPI BandTrackCF_AddRef(LPCLASSFACTORY iface) {
88 ICOM_THIS(IClassFactoryImpl,iface);
92 static ULONG WINAPI BandTrackCF_Release(LPCLASSFACTORY iface) {
93 ICOM_THIS(IClassFactoryImpl,iface);
94 /* static class, won't be freed */
98 static HRESULT WINAPI BandTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
99 ICOM_THIS(IClassFactoryImpl,iface);
100 TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
101 return DMUSIC_CreateDirectMusicBandTrack (riid, ppobj, pOuter);
104 static HRESULT WINAPI BandTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
105 ICOM_THIS(IClassFactoryImpl,iface);
106 FIXME("(%p)->(%d),stub!\n", This, dolock);
110 static ICOM_VTABLE(IClassFactory) BandTrackCF_Vtbl = {
111 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
112 BandTrackCF_QueryInterface,
115 BandTrackCF_CreateInstance,
116 BandTrackCF_LockServer
119 static IClassFactoryImpl BandTrack_CF = {&BandTrackCF_Vtbl, 1 };
121 /******************************************************************
126 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
127 if (fdwReason == DLL_PROCESS_ATTACH) {
128 DisableThreadLibraryCalls(hinstDLL);
129 /* FIXME: Initialisation */
130 } else if (fdwReason == DLL_PROCESS_DETACH) {
138 /******************************************************************
139 * DllCanUnloadNow (DMBAND.1)
143 HRESULT WINAPI DMBAND_DllCanUnloadNow(void) {
144 FIXME("(void): stub\n");
149 /******************************************************************
150 * DllGetClassObject (DMBAND.2)
154 HRESULT WINAPI DMBAND_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) {
155 TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
157 if (IsEqualCLSID (rclsid, &CLSID_DirectMusicBand) && IsEqualIID (riid, &IID_IClassFactory)) {
158 *ppv = (LPVOID) &Band_CF;
159 IClassFactory_AddRef((IClassFactory*)*ppv);
161 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicBandTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
162 *ppv = (LPVOID) &BandTrack_CF;
163 IClassFactory_AddRef((IClassFactory*)*ppv);
167 WARN("(%p,%p,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
168 return CLASS_E_CLASSNOTAVAILABLE;