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 IClassFactoryVtbl
*lpVtbl
;
30 /******************************************************************
31 * DirectMusicBand ClassFactory
34 static HRESULT WINAPI
BandCF_QueryInterface(LPCLASSFACTORY iface
,REFIID riid
,LPVOID
*ppobj
) {
35 IClassFactoryImpl
*This
= (IClassFactoryImpl
*)iface
;
36 FIXME("(%p, %s, %p): stub\n",This
, debugstr_dmguid(riid
), ppobj
);
40 static ULONG WINAPI
BandCF_AddRef(LPCLASSFACTORY iface
) {
41 IClassFactoryImpl
*This
= (IClassFactoryImpl
*)iface
;
45 static ULONG WINAPI
BandCF_Release(LPCLASSFACTORY iface
) {
46 IClassFactoryImpl
*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 IClassFactoryImpl
*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 IClassFactoryImpl
*This
= (IClassFactoryImpl
*)iface
;
59 FIXME("(%p, %d): stub\n", This
, dolock
);
63 static IClassFactoryVtbl BandCF_Vtbl
= {
64 BandCF_QueryInterface
,
67 BandCF_CreateInstance
,
71 static IClassFactoryImpl Band_CF
= {&BandCF_Vtbl
, 1 };
74 /******************************************************************
75 * DirectMusicBandTrack ClassFactory
78 static HRESULT WINAPI
BandTrackCF_QueryInterface(LPCLASSFACTORY iface
,REFIID riid
,LPVOID
*ppobj
) {
79 IClassFactoryImpl
*This
= (IClassFactoryImpl
*)iface
;
81 FIXME("(%p, %s, %p): stub\n", This
, debugstr_dmguid(riid
), ppobj
);
85 static ULONG WINAPI
BandTrackCF_AddRef(LPCLASSFACTORY iface
) {
86 IClassFactoryImpl
*This
= (IClassFactoryImpl
*)iface
;
90 static ULONG WINAPI
BandTrackCF_Release(LPCLASSFACTORY iface
) {
91 IClassFactoryImpl
*This
= (IClassFactoryImpl
*)iface
;
92 /* static class, won't be freed */
96 static HRESULT WINAPI
BandTrackCF_CreateInstance(LPCLASSFACTORY iface
, LPUNKNOWN pOuter
, REFIID riid
, LPVOID
*ppobj
) {
97 IClassFactoryImpl
*This
= (IClassFactoryImpl
*)iface
;
98 TRACE ("(%p, %p, %s, %p)\n", This
, pOuter
, debugstr_dmguid(riid
), ppobj
);
99 return DMUSIC_CreateDirectMusicBandTrack (riid
, ppobj
, pOuter
);
102 static HRESULT WINAPI
BandTrackCF_LockServer(LPCLASSFACTORY iface
,BOOL dolock
) {
103 IClassFactoryImpl
*This
= (IClassFactoryImpl
*)iface
;
104 FIXME("(%p, %d): stub\n", This
, dolock
);
108 static IClassFactoryVtbl BandTrackCF_Vtbl
= {
109 BandTrackCF_QueryInterface
,
112 BandTrackCF_CreateInstance
,
113 BandTrackCF_LockServer
116 static IClassFactoryImpl BandTrack_CF
= {&BandTrackCF_Vtbl
, 1 };
118 /******************************************************************
123 BOOL WINAPI
DllMain(HINSTANCE hinstDLL
, DWORD fdwReason
, LPVOID lpvReserved
) {
124 if (fdwReason
== DLL_PROCESS_ATTACH
) {
125 DisableThreadLibraryCalls(hinstDLL
);
126 /* FIXME: Initialisation */
127 } else if (fdwReason
== DLL_PROCESS_DETACH
) {
135 /******************************************************************
136 * DllCanUnloadNow (DMBAND.1)
140 HRESULT WINAPI
DMBAND_DllCanUnloadNow(void) {
141 FIXME("(void): stub\n");
146 /******************************************************************
147 * DllGetClassObject (DMBAND.2)
151 HRESULT WINAPI
DMBAND_DllGetClassObject(REFCLSID rclsid
, REFIID riid
, LPVOID
*ppv
) {
152 TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid
), debugstr_dmguid(riid
), ppv
);
154 if (IsEqualCLSID (rclsid
, &CLSID_DirectMusicBand
) && IsEqualIID (riid
, &IID_IClassFactory
)) {
155 *ppv
= (LPVOID
) &Band_CF
;
156 IClassFactory_AddRef((IClassFactory
*)*ppv
);
158 } else if (IsEqualCLSID (rclsid
, &CLSID_DirectMusicBandTrack
) && IsEqualIID (riid
, &IID_IClassFactory
)) {
159 *ppv
= (LPVOID
) &BandTrack_CF
;
160 IClassFactory_AddRef((IClassFactory
*)*ppv
);
164 WARN("(%s, %s, %p): no interface found.\n", debugstr_dmguid(rclsid
), debugstr_dmguid(riid
), ppv
);
165 return CLASS_E_CLASSNOTAVAILABLE
;