~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/dlls/dmstyle/dmstyle_main.c

Version: ~ [ wine-1.5.31 ] ~ [ wine-1.5.30 ] ~ [ wine-1.5.29 ] ~ [ wine-1.5.28 ] ~ [ wine-1.5.27 ] ~ [ wine-1.5.26 ] ~ [ wine-1.5.25 ] ~ [ wine-1.5.24 ] ~ [ wine-1.5.23 ] ~ [ wine-1.5.22 ] ~ [ wine-1.5.21 ] ~ [ wine-1.5.20 ] ~ [ wine-1.5.19 ] ~ [ wine-1.5.18 ] ~ [ wine-1.5.17 ] ~ [ wine-1.5.16 ] ~ [ wine-1.5.15 ] ~ [ wine-1.5.14 ] ~ [ wine-1.5.13 ] ~ [ wine-1.5.12 ] ~ [ wine-1.5.11 ] ~ [ wine-1.5.10 ] ~ [ wine-1.5.9 ] ~ [ wine-1.5.8 ] ~ [ wine-1.5.7 ] ~ [ wine-1.4.1 ] ~ [ wine-1.5.6 ] ~ [ wine-1.5.5 ] ~ [ wine-1.5.4 ] ~ [ wine-1.5.3 ] ~ [ wine-1.5.2 ] ~ [ wine-1.5.1 ] ~ [ wine-1.5.0 ] ~ [ wine-1.4 ] ~ [ wine-1.4-rc6 ] ~ [ wine-1.4-rc5 ] ~ [ wine-1.4-rc4 ] ~ [ wine-1.4-rc3 ] ~ [ wine-1.4-rc2 ] ~ [ wine-1.4-rc1 ] ~ [ wine-1.3.37 ] ~ [ wine-1.3.36 ] ~ [ wine-1.3.35 ] ~ [ wine-1.3.34 ] ~ [ wine-1.3.33 ] ~ [ wine-1.3.32 ] ~ [ wine-1.3.31 ] ~ [ wine-1.3.30 ] ~ [ wine-1.3.29 ] ~ [ wine-1.3.28 ] ~ [ wine-1.3.27 ] ~ [ wine-1.3.26 ] ~ [ wine-1.3.25 ] ~ [ wine-1.3.24 ] ~ [ wine-1.3.23 ] ~ [ wine-1.3.22 ] ~ [ wine-1.3.21 ] ~ [ wine-1.3.20 ] ~ [ wine-1.3.19 ] ~ [ wine-1.3.18 ] ~ [ wine-1.2.3 ] ~ [ wine-1.3.17 ] ~ [ wine-1.3.16 ] ~ [ wine-1.3.15 ] ~ [ wine-1.3.14 ] ~ [ wine-1.3.13 ] ~ [ wine-1.3.12 ] ~ [ wine-1.3.11 ] ~ [ wine-1.3.10 ] ~ [ wine-1.3.9 ] ~ [ wine-1.2.2 ] ~ [ wine-1.3.8 ] ~ [ wine-1.3.7 ] ~ [ wine-1.3.6 ] ~ [ wine-1.3.5 ] ~ [ wine-1.2.1 ] ~ [ wine-1.3.4 ] ~ [ wine-1.3.3 ] ~ [ wine-1.3.2 ] ~ [ wine-1.3.1 ] ~ [ wine-1.3.0 ] ~ [ wine-1.2 ] ~ [ wine-1.2-rc7 ] ~ [ wine-1.2-rc6 ] ~ [ wine-1.2-rc5 ] ~ [ wine-1.2-rc4 ] ~ [ wine-1.2-rc3 ] ~ [ wine-1.2-rc2 ] ~ [ wine-1.2-rc1 ] ~ [ wine-1.1.44 ] ~ [ wine-1.1.43 ] ~ [ wine-1.1.42 ] ~ [ wine-1.1.41 ] ~ [ wine-1.1.40 ] ~ [ wine-1.1.39 ] ~ [ wine-1.1.38 ] ~ [ wine-1.1.37 ] ~ [ wine-1.1.36 ] ~ [ wine-1.1.35 ] ~ [ wine-1.1.34 ] ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  1 /* DirectMusicStyle Main
  2  *
  3  * Copyright (C) 2003-2004 Rok Mandeljc
  4  *
  5  * This program is free software; you can redistribute it and/or
  6  * modify it under the terms of the GNU Lesser General Public
  7  * License as published by the Free Software Foundation; either
  8  * version 2.1 of the License, or (at your option) any later version.
  9  *
 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 GNU
 13  * Lesser General Public License for more details.
 14  *
 15  * You should have received a copy of the GNU Lesser General Public
 16  * License along with this program; if not, write to the Free Software
 17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 18  */
 19 
 20 #include "dmstyle_private.h"
 21 #include "rpcproxy.h"
 22 
 23 WINE_DEFAULT_DEBUG_CHANNEL(dmstyle);
 24 
 25 static HINSTANCE instance;
 26 LONG DMSTYLE_refCount = 0;
 27 
 28 typedef struct {
 29         IClassFactory IClassFactory_iface;
 30         HRESULT WINAPI (*fnCreateInstance)(REFIID riid, void **ppv, IUnknown *pUnkOuter);
 31 } IClassFactoryImpl;
 32 
 33 static HRESULT WINAPI create_direct_music_section(REFIID riid, void **ppv, IUnknown *pUnkOuter)
 34 {
 35         FIXME("(%p, %s, %p) stub\n", pUnkOuter, debugstr_dmguid(riid), ppv);
 36 
 37         return E_NOINTERFACE;
 38 }
 39 
 40 /******************************************************************
 41  *      IClassFactory implementation
 42  */
 43 static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface)
 44 {
 45         return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
 46 }
 47 
 48 static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
 49 {
 50         if (ppv == NULL)
 51                 return E_POINTER;
 52 
 53         if (IsEqualGUID(&IID_IUnknown, riid))
 54                 TRACE("(%p)->(IID_IUnknown %p)\n", iface, ppv);
 55         else if (IsEqualGUID(&IID_IClassFactory, riid))
 56                 TRACE("(%p)->(IID_IClassFactory %p)\n", iface, ppv);
 57         else {
 58                 FIXME("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
 59                 *ppv = NULL;
 60                 return E_NOINTERFACE;
 61         }
 62 
 63         *ppv = iface;
 64         IUnknown_AddRef((IUnknown*)*ppv);
 65         return S_OK;
 66 }
 67 
 68 static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
 69 {
 70         DMSTYLE_LockModule();
 71 
 72         return 2; /* non-heap based object */
 73 }
 74 
 75 static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
 76 {
 77         DMSTYLE_UnlockModule();
 78 
 79         return 1; /* non-heap based object */
 80 }
 81 
 82 static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter,
 83         REFIID riid, void **ppv)
 84 {
 85         IClassFactoryImpl *This = impl_from_IClassFactory(iface);
 86 
 87         TRACE ("(%p, %s, %p)\n", pUnkOuter, debugstr_dmguid(riid), ppv);
 88 
 89         return This->fnCreateInstance(riid, ppv, pUnkOuter);
 90 }
 91 
 92 static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
 93 {
 94         TRACE("(%d)\n", dolock);
 95 
 96         if (dolock)
 97                 DMSTYLE_LockModule();
 98         else
 99                 DMSTYLE_UnlockModule();
100 
101         return S_OK;
102 }
103 
104 static const IClassFactoryVtbl classfactory_vtbl = {
105         ClassFactory_QueryInterface,
106         ClassFactory_AddRef,
107         ClassFactory_Release,
108         ClassFactory_CreateInstance,
109         ClassFactory_LockServer
110 };
111 
112 static IClassFactoryImpl Section_CF = {{&classfactory_vtbl}, create_direct_music_section};
113 static IClassFactoryImpl Style_CF = {{&classfactory_vtbl}, DMUSIC_CreateDirectMusicStyleImpl};
114 static IClassFactoryImpl ChordTrack_CF = {{&classfactory_vtbl}, DMUSIC_CreateDirectMusicChordTrack};
115 static IClassFactoryImpl CommandTrack_CF = {{&classfactory_vtbl},
116                                             DMUSIC_CreateDirectMusicCommandTrack};
117 static IClassFactoryImpl StyleTrack_CF = {{&classfactory_vtbl}, DMUSIC_CreateDirectMusicStyleTrack};
118 static IClassFactoryImpl MotifTrack_CF = {{&classfactory_vtbl}, DMUSIC_CreateDirectMusicMotifTrack};
119 static IClassFactoryImpl AuditionTrack_CF = {{&classfactory_vtbl},
120                                              DMUSIC_CreateDirectMusicAuditionTrack};
121 static IClassFactoryImpl MuteTrack_CF = {{&classfactory_vtbl}, DMUSIC_CreateDirectMusicMuteTrack};
122 
123 /******************************************************************
124  *              DllMain
125  *
126  *
127  */
128 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
129         if (fdwReason == DLL_PROCESS_ATTACH) {
130             instance = hinstDLL;
131             DisableThreadLibraryCalls(hinstDLL);
132                 /* FIXME: Initialisation */
133         } else if (fdwReason == DLL_PROCESS_DETACH) {
134                 /* FIXME: Cleanup */
135         }
136 
137         return TRUE;
138 }
139 
140 
141 /******************************************************************
142  *              DllCanUnloadNow (DMSTYLE.1)
143  *
144  *
145  */
146 HRESULT WINAPI DllCanUnloadNow(void) {
147         return DMSTYLE_refCount != 0 ? S_FALSE : S_OK;
148 }
149 
150 
151 /******************************************************************
152  *              DllGetClassObject (DMSTYLE.@)
153  *
154  *
155  */
156 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) {
157     TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
158     
159         if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSection) && IsEqualIID (riid, &IID_IClassFactory)) {
160                 *ppv = &Section_CF;
161                 IClassFactory_AddRef((IClassFactory*)*ppv);
162                 return S_OK;
163         } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicStyle) && IsEqualIID (riid, &IID_IClassFactory)) {
164                 *ppv = &Style_CF;
165                 IClassFactory_AddRef((IClassFactory*)*ppv);
166                 return S_OK;            
167         } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicChordTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
168                 *ppv = &ChordTrack_CF;
169                 IClassFactory_AddRef((IClassFactory*)*ppv);
170                 return S_OK;    
171         } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicCommandTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
172                 *ppv = &CommandTrack_CF;
173                 IClassFactory_AddRef((IClassFactory*)*ppv);
174                 return S_OK;            
175         } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicStyleTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
176                 *ppv = &StyleTrack_CF;
177                 IClassFactory_AddRef((IClassFactory*)*ppv);
178                 return S_OK;            
179         } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicMotifTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
180                 *ppv = &MotifTrack_CF;
181                 IClassFactory_AddRef((IClassFactory*)*ppv);
182                 return S_OK;            
183         } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicAuditionTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
184                 *ppv = &AuditionTrack_CF;
185                 IClassFactory_AddRef((IClassFactory*)*ppv);
186                 return S_OK;            
187         } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicMuteTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
188                 *ppv = &MuteTrack_CF;
189                 IClassFactory_AddRef((IClassFactory*)*ppv);
190                 return S_OK;            
191         }
192 
193     WARN("(%s, %s, %p): no interface found.\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
194     return CLASS_E_CLASSNOTAVAILABLE;
195 }
196 
197 /***********************************************************************
198  *              DllRegisterServer (DMSTYLE.@)
199  */
200 HRESULT WINAPI DllRegisterServer(void)
201 {
202     return __wine_register_resources( instance );
203 }
204 
205 /***********************************************************************
206  *              DllUnregisterServer (DMSTYLE.@)
207  */
208 HRESULT WINAPI DllUnregisterServer(void)
209 {
210     return __wine_unregister_resources( instance );
211 }
212 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.