3 * Copyright (C) 2003 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 "dmusic_private.h"
22 WINE_DEFAULT_DEBUG_CHANNEL(dmusic
);
25 /******************************************************************
26 * DirectMusic ClassFactory
34 ICOM_VFIELD(IClassFactory
);
38 static HRESULT WINAPI
DMCF_QueryInterface(LPCLASSFACTORY iface
,REFIID riid
,LPVOID
*ppobj
)
40 ICOM_THIS(IClassFactoryImpl
,iface
);
42 FIXME("(%p)->(%s,%p),stub!\n",This
,debugstr_guid(riid
),ppobj
);
46 static ULONG WINAPI
DMCF_AddRef(LPCLASSFACTORY iface
)
48 ICOM_THIS(IClassFactoryImpl
,iface
);
52 static ULONG WINAPI
DMCF_Release(LPCLASSFACTORY iface
)
54 ICOM_THIS(IClassFactoryImpl
,iface
);
55 /* static class, won't be freed */
59 static HRESULT WINAPI
DMCF_CreateInstance(LPCLASSFACTORY iface
, LPUNKNOWN pOuter
, REFIID riid
, LPVOID
*ppobj
)
61 ICOM_THIS(IClassFactoryImpl
,iface
);
63 TRACE ("(%p)->(%p,%s,%p)\n",This
,pOuter
,debugstr_guid(riid
),ppobj
);
64 if (IsEqualGUID (&IID_IDirectMusic
, riid
))
66 return DMUSIC_CreateDirectMusic (riid
, (LPDIRECTMUSIC
*)ppobj
, pOuter
);
68 if (IsEqualGUID (&IID_IDirectMusicPerformance
, riid
))
70 return DMUSIC_CreateDirectMusicPerformance (riid
, (LPDIRECTMUSICPERFORMANCE
*)ppobj
, pOuter
);
72 if (IsEqualGUID (&IID_IDirectMusicPerformance8
, riid
))
74 return DMUSIC_CreateDirectMusicPerformance8 (riid
, (LPDIRECTMUSICPERFORMANCE8
*)ppobj
, pOuter
);
76 /*if (IsEqualGUID (&IID_IDirectMusicLoader8, riid))
78 return DMUSIC_CreateDirectMusicLoader8 (riid, (LPDIRECTMUSICLOADER8*)ppobj, pOuter);
81 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppobj
);
85 static HRESULT WINAPI
DMCF_LockServer(LPCLASSFACTORY iface
,BOOL dolock
)
87 ICOM_THIS(IClassFactoryImpl
,iface
);
88 FIXME("(%p)->(%d),stub!\n",This
,dolock
);
92 static ICOM_VTABLE(IClassFactory
) DMCF_Vtbl
= {
93 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
101 static IClassFactoryImpl DMUSIC_CF
= {&DMCF_Vtbl
, 1 };
103 /******************************************************************
108 BOOL WINAPI
DllMain(HINSTANCE hinstDLL
, DWORD fdwReason
, LPVOID lpvReserved
)
110 if (fdwReason
== DLL_PROCESS_ATTACH
)
112 /* FIXME: Initialisation */
114 else if (fdwReason
== DLL_PROCESS_DETACH
)
123 /******************************************************************
124 * DllCanUnloadNow (DMUSIC.1)
128 HRESULT WINAPI
DMUSIC_DllCanUnloadNow(void)
130 FIXME("(void): stub\n");
136 /******************************************************************
137 * DllGetClassObject (DMUSIC.2)
141 HRESULT WINAPI
DMUSIC_DllGetClassObject(REFCLSID rclsid
, REFIID riid
, LPVOID
*ppv
)
143 TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid
), debugstr_guid(riid
), ppv
);
144 if (IsEqualCLSID (&IID_IClassFactory
, riid
))
146 *ppv
= (LPVOID
)&DMUSIC_CF
;
147 IClassFactory_AddRef((IClassFactory
*)*ppv
);
151 WARN("(%p,%p,%p): no interface found.\n", debugstr_guid(rclsid
), debugstr_guid(riid
), ppv
);
152 return CLASS_E_CLASSNOTAVAILABLE
;
156 /******************************************************************
157 * DllRegisterServer (DMUSIC.3)
161 HRESULT WINAPI
DMUSIC_DllRegisterServer(void)
163 FIXME("(void): stub\n");
169 /******************************************************************
170 * DllUnregisterServer (DMUSIC.4)
174 HRESULT WINAPI
DMUSIC_DllUnregisterServer(void)
176 FIXME("(void): stub\n");