Fixed typo.
[wine.git] / dlls / dswave / dswave_main.c
blob5146ae713d35adaa3361a5b92795f11749a171ab
1 /* DirectMusic Wave 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 "dswave_private.h"
22 WINE_DEFAULT_DEBUG_CHANNEL(dswave);
24 typedef struct {
25 /* IUnknown fields */
26 ICOM_VFIELD(IClassFactory);
27 DWORD ref;
28 } IClassFactoryImpl;
30 /******************************************************************
31 * DirectMusicWave ClassFactory
33 static HRESULT WINAPI WaveCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
34 ICOM_THIS(IClassFactoryImpl,iface);
35 FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
36 return E_NOINTERFACE;
39 static ULONG WINAPI WaveCF_AddRef(LPCLASSFACTORY iface) {
40 ICOM_THIS(IClassFactoryImpl,iface);
41 return ++(This->ref);
44 static ULONG WINAPI WaveCF_Release(LPCLASSFACTORY iface) {
45 ICOM_THIS(IClassFactoryImpl,iface);
46 /* static class, won't be freed */
47 return --(This->ref);
50 static HRESULT WINAPI WaveCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
51 ICOM_THIS(IClassFactoryImpl,iface);
52 TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
53 return DMUSIC_CreateDirectMusicWaveImpl (riid, ppobj, pOuter);
56 static HRESULT WINAPI WaveCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
57 ICOM_THIS(IClassFactoryImpl,iface);
58 FIXME("(%p)->(%d),stub!\n", This, dolock);
59 return S_OK;
62 static ICOM_VTABLE(IClassFactory) WaveCF_Vtbl = {
63 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
64 WaveCF_QueryInterface,
65 WaveCF_AddRef,
66 WaveCF_Release,
67 WaveCF_CreateInstance,
68 WaveCF_LockServer
71 static IClassFactoryImpl Wave_CF = {&WaveCF_Vtbl, 1 };
73 /******************************************************************
74 * DllMain
78 BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
79 if (fdwReason == DLL_PROCESS_ATTACH) {
80 DisableThreadLibraryCalls(hinstDLL);
81 /* FIXME: Initialisation */
82 } else if (fdwReason == DLL_PROCESS_DETACH) {
83 /* FIXME: Cleanup */
86 return TRUE;
90 /******************************************************************
91 * DllCanUnloadNow (DSWAVE.1)
95 HRESULT WINAPI DSWAVE_DllCanUnloadNow(void) {
96 FIXME("(void): stub\n");
97 return S_FALSE;
101 /******************************************************************
102 * DllGetClassObject (DSWAVE.2)
106 HRESULT WINAPI DSWAVE_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) {
107 TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
108 if (IsEqualCLSID (rclsid, &CLSID_DirectSoundWave) && IsEqualIID (riid, &IID_IClassFactory)) {
109 *ppv = (LPVOID) &Wave_CF;
110 IClassFactory_AddRef((IClassFactory*)*ppv);
111 return S_OK;
114 WARN("(%p,%p,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
115 return CLASS_E_CLASSNOTAVAILABLE;