- Map winsock sockopts to the POSIX equivalents for IP multicast.
[wine/multimedia.git] / dlls / dmusic / dmusic_main.c
blob07508b248ee2353f43c397142a44f53308961f03
1 /* DirectMusic Main
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);
33 typedef struct
35 /* IUnknown fields */
36 ICOM_VFIELD(IClassFactory);
37 DWORD ref;
38 } IClassFactoryImpl;
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);
45 return E_NOINTERFACE;
48 static ULONG WINAPI DMCF_AddRef(LPCLASSFACTORY iface)
50 ICOM_THIS(IClassFactoryImpl,iface);
51 return ++(This->ref);
54 static ULONG WINAPI DMCF_Release(LPCLASSFACTORY iface)
56 ICOM_THIS(IClassFactoryImpl,iface);
57 /* static class, won't be freed */
58 return --(This->ref);
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);
72 return E_NOINTERFACE;
75 static HRESULT WINAPI DMCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
77 ICOM_THIS(IClassFactoryImpl,iface);
78 FIXME("(%p)->(%d),stub!\n",This,dolock);
79 return S_OK;
82 static ICOM_VTABLE(IClassFactory) DMCF_Vtbl = {
83 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
84 DMCF_QueryInterface,
85 DMCF_AddRef,
86 DMCF_Release,
87 DMCF_CreateInstance,
88 DMCF_LockServer
91 static IClassFactoryImpl DMUSIC_CF = {&DMCF_Vtbl, 1 };
93 /******************************************************************
94 * DllMain
98 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
100 if (fdwReason == DLL_PROCESS_ATTACH)
102 /* FIXME: Initialisation */
103 FIXME("stub\n");
105 else if (fdwReason == DLL_PROCESS_DETACH)
107 /* FIXME: Cleanup */
108 FIXME("stub\n");
111 return TRUE;
115 /******************************************************************
116 * DllCanUnloadNow (DMUSIC.1)
120 HRESULT WINAPI DMUSIC_DllCanUnloadNow(void)
122 FIXME("(void): stub\n");
124 return S_FALSE;
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);
140 return S_OK;
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");
157 return S_OK;
161 /******************************************************************
162 * DllUnregisterServer (DMUSIC.4)
166 HRESULT WINAPI DMUSIC_DllUnregisterServer(void)
168 FIXME("(void): stub\n");
170 return S_OK;