wow64: In wow64_NtSetInformationToken forward TokenIntegrityLevel.
[wine.git] / dlls / dmscript / dmscript_main.c
blobdb5f163b8290720a24334e9e8f8cab1022a197eb
1 /* DirectMusicScript Main
3 * Copyright (C) 2003-2004 Rok Mandeljc
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.
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.
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
21 #include <stdarg.h>
23 #define COBJMACROS
25 #include "windef.h"
26 #include "winbase.h"
27 #include "winnt.h"
28 #include "wingdi.h"
29 #include "winuser.h"
30 #include "winreg.h"
31 #include "objbase.h"
32 #include "rpcproxy.h"
33 #include "initguid.h"
34 #include "dmusici.h"
36 #include "dmscript_private.h"
37 #include "dmobject.h"
39 WINE_DEFAULT_DEBUG_CHANNEL(dmscript);
41 typedef struct {
42 IClassFactory IClassFactory_iface;
43 HRESULT (*fnCreateInstance)(REFIID riid, void **ppv, IUnknown *pUnkOuter);
44 } IClassFactoryImpl;
46 static HRESULT create_unimpl_instance(REFIID riid, void **ppv, IUnknown *pUnkOuter)
48 FIXME("(%p, %s, %p) stub\n", pUnkOuter, debugstr_dmguid(riid), ppv);
50 return CLASS_E_CLASSNOTAVAILABLE;
53 /******************************************************************
54 * IClassFactory implementation
56 static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface)
58 return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
61 static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
63 if (ppv == NULL)
64 return E_POINTER;
66 if (IsEqualGUID(&IID_IUnknown, riid))
67 TRACE("(%p)->(IID_IUnknown %p)\n", iface, ppv);
68 else if (IsEqualGUID(&IID_IClassFactory, riid))
69 TRACE("(%p)->(IID_IClassFactory %p)\n", iface, ppv);
70 else {
71 FIXME("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
72 *ppv = NULL;
73 return E_NOINTERFACE;
76 *ppv = iface;
77 IUnknown_AddRef((IUnknown*)*ppv);
78 return S_OK;
81 static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
83 return 2; /* non-heap based object */
86 static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
88 return 1; /* non-heap based object */
91 static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter,
92 REFIID riid, void **ppv)
94 IClassFactoryImpl *This = impl_from_IClassFactory(iface);
96 TRACE ("(%p, %s, %p)\n", pUnkOuter, debugstr_dmguid(riid), ppv);
98 return This->fnCreateInstance(riid, ppv, pUnkOuter);
101 static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
103 TRACE("(%d)\n", dolock);
104 return S_OK;
107 static const IClassFactoryVtbl classfactory_vtbl = {
108 ClassFactory_QueryInterface,
109 ClassFactory_AddRef,
110 ClassFactory_Release,
111 ClassFactory_CreateInstance,
112 ClassFactory_LockServer
115 static IClassFactoryImpl ScriptAutoImplSegment_CF = {{&classfactory_vtbl}, create_unimpl_instance};
116 static IClassFactoryImpl ScriptTrack_CF = {{&classfactory_vtbl},
117 DMUSIC_CreateDirectMusicScriptTrack};
118 static IClassFactoryImpl AudioVBScript_CF = {{&classfactory_vtbl}, create_unimpl_instance};
119 static IClassFactoryImpl Script_CF = {{&classfactory_vtbl}, DMUSIC_CreateDirectMusicScriptImpl};
120 static IClassFactoryImpl ScriptAutoImplPerformance_CF = {{&classfactory_vtbl},
121 create_unimpl_instance};
122 static IClassFactoryImpl ScriptSourceCodeLoader_CF = {{&classfactory_vtbl}, create_unimpl_instance};
123 static IClassFactoryImpl ScriptAutoImplSegmentState_CF = {{&classfactory_vtbl},
124 create_unimpl_instance};
125 static IClassFactoryImpl ScriptAutoImplAudioPathConfig_CF = {{&classfactory_vtbl},
126 create_unimpl_instance};
127 static IClassFactoryImpl ScriptAutoImplAudioPath_CF = {{&classfactory_vtbl},
128 create_unimpl_instance};
129 static IClassFactoryImpl ScriptAutoImplSong_CF = {{&classfactory_vtbl}, create_unimpl_instance};
132 /******************************************************************
133 * DllGetClassObject (DMSCRIPT.@)
137 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
139 TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
140 if (IsEqualCLSID (rclsid, &CLSID_DirectMusicScriptAutoImpSegment) && IsEqualIID (riid, &IID_IClassFactory)) {
141 *ppv = &ScriptAutoImplSegment_CF;
142 IClassFactory_AddRef((IClassFactory*)*ppv);
143 return S_OK;
144 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicScriptTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
145 *ppv = &ScriptTrack_CF;
146 IClassFactory_AddRef((IClassFactory*)*ppv);
147 return S_OK;
148 } else if (IsEqualCLSID (rclsid, &CLSID_AudioVBScript) && IsEqualIID (riid, &IID_IClassFactory)) {
149 *ppv = &AudioVBScript_CF;
150 IClassFactory_AddRef((IClassFactory*)*ppv);
151 return S_OK;
152 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicScript) && IsEqualIID (riid, &IID_IClassFactory)) {
153 *ppv = &Script_CF;
154 IClassFactory_AddRef((IClassFactory*)*ppv);
155 return S_OK;
156 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicScriptAutoImpPerformance) && IsEqualIID (riid, &IID_IClassFactory)) {
157 *ppv = &ScriptAutoImplPerformance_CF;
158 IClassFactory_AddRef((IClassFactory*)*ppv);
159 return S_OK;
160 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicScriptSourceCodeLoader) && IsEqualIID (riid, &IID_IClassFactory)) {
161 *ppv = &ScriptSourceCodeLoader_CF;
162 IClassFactory_AddRef((IClassFactory*)*ppv);
163 return S_OK;
164 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicScriptAutoImpSegmentState) && IsEqualIID (riid, &IID_IClassFactory)) {
165 *ppv = &ScriptAutoImplSegmentState_CF;
166 IClassFactory_AddRef((IClassFactory*)*ppv);
167 return S_OK;
168 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicScriptAutoImpAudioPathConfig) && IsEqualIID (riid, &IID_IClassFactory)) {
169 *ppv = &ScriptAutoImplAudioPathConfig_CF;
170 IClassFactory_AddRef((IClassFactory*)*ppv);
171 return S_OK;
172 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicScriptAutoImpAudioPath) && IsEqualIID (riid, &IID_IClassFactory)) {
173 *ppv = &ScriptAutoImplAudioPath_CF;
174 IClassFactory_AddRef((IClassFactory*)*ppv);
175 return S_OK;
176 } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicScriptAutoImpSong) && IsEqualIID (riid, &IID_IClassFactory)) {
177 *ppv = &ScriptAutoImplSong_CF;
178 IClassFactory_AddRef((IClassFactory*)*ppv);
179 return S_OK;
182 WARN("(%s, %s, %p): no interface found.\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
183 return CLASS_E_CLASSNOTAVAILABLE;