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
31 extern HRESULT WINAPI
DMUSIC_CreateDirectMusic (LPCGUID lpcGUID
, LPDIRECTMUSIC
*ppDM
, LPUNKNOWN pUnkOuter
);
36 ICOM_VFIELD(IClassFactory
);
40 static HRESULT WINAPI
DMCF_QueryInterface(LPCLASSFACTORY iface
,REFIID riid
,LPVOID
*ppobj
)
42 ICOM_THIS(IClassFactoryImpl
,iface
);
44 FIXME("(%p)->(%s,%p),stub!\n",This
,debugstr_guid(riid
),ppobj
);
48 static ULONG WINAPI
DMCF_AddRef(LPCLASSFACTORY iface
)
50 ICOM_THIS(IClassFactoryImpl
,iface
);
54 static ULONG WINAPI
DMCF_Release(LPCLASSFACTORY iface
)
56 ICOM_THIS(IClassFactoryImpl
,iface
);
57 /* static class, won't be freed */
61 static HRESULT WINAPI
DMCF_CreateInstance(LPCLASSFACTORY iface
, LPUNKNOWN pOuter
, REFIID riid
, LPVOID
*ppobj
)
63 ICOM_THIS(IClassFactoryImpl
,iface
);
65 TRACE ("(%p)->(%p,%s,%p)\n",This
,pOuter
,debugstr_guid(riid
),ppobj
);
66 if (IsEqualGUID (&IID_IDirectMusic
, riid
))
68 return DMUSIC_CreateDirectMusic (riid
, (LPDIRECTMUSIC
*)ppobj
, pOuter
);
71 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppobj
);
75 static HRESULT WINAPI
DMCF_LockServer(LPCLASSFACTORY iface
,BOOL dolock
)
77 ICOM_THIS(IClassFactoryImpl
,iface
);
78 FIXME("(%p)->(%d),stub!\n",This
,dolock
);
82 static ICOM_VTABLE(IClassFactory
) DMCF_Vtbl
= {
83 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
91 static IClassFactoryImpl DMUSIC_CF
= {&DMCF_Vtbl
, 1 };
93 /******************************************************************
98 BOOL WINAPI
DllMain(HINSTANCE hinstDLL
, DWORD fdwReason
, LPVOID lpvReserved
)
100 if (fdwReason
== DLL_PROCESS_ATTACH
)
102 /* FIXME: Initialisation */
105 else if (fdwReason
== DLL_PROCESS_DETACH
)
115 /******************************************************************
116 * DllCanUnloadNow (DMUSIC.1)
120 HRESULT WINAPI
DMUSIC_DllCanUnloadNow(void)
122 FIXME("(void): stub\n");
128 /******************************************************************
129 * DllGetClassObject (DMUSIC.2)
133 HRESULT WINAPI
DMUSIC_DllGetClassObject(REFCLSID rclsid
, REFIID riid
, LPVOID
*ppv
)
135 TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid
), debugstr_guid(riid
), ppv
);
136 if (IsEqualCLSID (&IID_IClassFactory
, riid
))
138 *ppv
= (LPVOID
)&DMUSIC_CF
;
139 IClassFactory_AddRef((IClassFactory
*)*ppv
);
143 WARN("(%p,%p,%p): no interface found.\n", debugstr_guid(rclsid
), debugstr_guid(riid
), ppv
);
144 return CLASS_E_CLASSNOTAVAILABLE
;
148 /******************************************************************
149 * DllRegisterServer (DMUSIC.3)
153 HRESULT WINAPI
DMUSIC_DllRegisterServer(void)
155 FIXME("(void): stub\n");
161 /******************************************************************
162 * DllUnregisterServer (DMUSIC.4)
166 HRESULT WINAPI
DMUSIC_DllUnregisterServer(void)
168 FIXME("(void): stub\n");