Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 1 | /* DirectMusicScript Main |
| 2 | * |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 3 | * Copyright (C) 2003-2004 Rok Mandeljc |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 4 | * |
| 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. |
| 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 |
| 13 | * GNU Library General Public License for more details. |
| 14 | * |
| 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 |
Jonathan Ernst | 360a3f9 | 2006-05-18 14:49:52 +0200 | [diff] [blame] | 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 18 | */ |
| 19 | |
| 20 | #include "dmscript_private.h" |
| 21 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 22 | WINE_DEFAULT_DEBUG_CHANNEL(dmscript); |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 23 | |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 24 | LONG DMSCRIPT_refCount = 0; |
| 25 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 26 | typedef struct { |
Dmitry Timoshkov | 247246e | 2005-05-30 10:01:08 +0000 | [diff] [blame] | 27 | const IClassFactoryVtbl *lpVtbl; |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 28 | } IClassFactoryImpl; |
| 29 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 30 | /****************************************************************** |
| 31 | * DirectMusicScriptAutoImplSegment ClassFactory |
| 32 | */ |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 33 | static HRESULT WINAPI ScriptAutoImplSegmentCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 34 | FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid)); |
| 35 | |
| 36 | if (ppobj == NULL) return E_POINTER; |
| 37 | |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 38 | return E_NOINTERFACE; |
| 39 | } |
| 40 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 41 | static ULONG WINAPI ScriptAutoImplSegmentCF_AddRef(LPCLASSFACTORY iface) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 42 | DMSCRIPT_LockModule(); |
| 43 | |
| 44 | return 2; /* non-heap based object */ |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 45 | } |
| 46 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 47 | static ULONG WINAPI ScriptAutoImplSegmentCF_Release(LPCLASSFACTORY iface) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 48 | DMSCRIPT_UnlockModule(); |
| 49 | |
| 50 | return 1; /* non-heap based object */ |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 51 | } |
| 52 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 53 | static HRESULT WINAPI ScriptAutoImplSegmentCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 54 | FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid)); |
| 55 | |
| 56 | if (ppobj == NULL) return E_POINTER; |
| 57 | |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 58 | return E_NOINTERFACE; |
| 59 | } |
| 60 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 61 | static HRESULT WINAPI ScriptAutoImplSegmentCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 62 | TRACE("(%d)\n", dolock); |
| 63 | |
| 64 | if (dolock) |
| 65 | DMSCRIPT_LockModule(); |
| 66 | else |
| 67 | DMSCRIPT_UnlockModule(); |
| 68 | |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 69 | return S_OK; |
| 70 | } |
| 71 | |
Dmitry Timoshkov | 247246e | 2005-05-30 10:01:08 +0000 | [diff] [blame] | 72 | static const IClassFactoryVtbl ScriptAutoImplSegmentCF_Vtbl = { |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 73 | ScriptAutoImplSegmentCF_QueryInterface, |
| 74 | ScriptAutoImplSegmentCF_AddRef, |
| 75 | ScriptAutoImplSegmentCF_Release, |
| 76 | ScriptAutoImplSegmentCF_CreateInstance, |
| 77 | ScriptAutoImplSegmentCF_LockServer |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 78 | }; |
| 79 | |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 80 | static IClassFactoryImpl ScriptAutoImplSegment_CF = {&ScriptAutoImplSegmentCF_Vtbl}; |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 81 | |
| 82 | /****************************************************************** |
| 83 | * DirectMusicScriptTrack ClassFactory |
| 84 | */ |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 85 | static HRESULT WINAPI ScriptTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 86 | FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid)); |
| 87 | |
| 88 | if (ppobj == NULL) return E_POINTER; |
| 89 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 90 | return E_NOINTERFACE; |
| 91 | } |
| 92 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 93 | static ULONG WINAPI ScriptTrackCF_AddRef(LPCLASSFACTORY iface) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 94 | DMSCRIPT_LockModule(); |
| 95 | |
| 96 | return 2; /* non-heap based object */ |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 97 | } |
| 98 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 99 | static ULONG WINAPI ScriptTrackCF_Release(LPCLASSFACTORY iface) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 100 | DMSCRIPT_UnlockModule(); |
| 101 | |
| 102 | return 1; /* non-heap based object */ |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 103 | } |
| 104 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 105 | static HRESULT WINAPI ScriptTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 106 | TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj); |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 107 | return DMUSIC_CreateDirectMusicScriptTrack (riid, ppobj, pOuter); |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 108 | } |
| 109 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 110 | static HRESULT WINAPI ScriptTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 111 | TRACE("(%d)\n", dolock); |
| 112 | |
| 113 | if (dolock) |
| 114 | DMSCRIPT_LockModule(); |
| 115 | else |
| 116 | DMSCRIPT_UnlockModule(); |
| 117 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 118 | return S_OK; |
| 119 | } |
| 120 | |
Dmitry Timoshkov | 247246e | 2005-05-30 10:01:08 +0000 | [diff] [blame] | 121 | static const IClassFactoryVtbl ScriptTrackCF_Vtbl = { |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 122 | ScriptTrackCF_QueryInterface, |
| 123 | ScriptTrackCF_AddRef, |
| 124 | ScriptTrackCF_Release, |
| 125 | ScriptTrackCF_CreateInstance, |
| 126 | ScriptTrackCF_LockServer |
| 127 | }; |
| 128 | |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 129 | static IClassFactoryImpl ScriptTrack_CF = {&ScriptTrackCF_Vtbl}; |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 130 | |
| 131 | /****************************************************************** |
| 132 | * DirectMusicAudioVBScript ClassFactory |
| 133 | */ |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 134 | static HRESULT WINAPI AudioVBScriptCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 135 | FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid)); |
| 136 | |
| 137 | if (ppobj == NULL) return E_POINTER; |
| 138 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 139 | return E_NOINTERFACE; |
| 140 | } |
| 141 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 142 | static ULONG WINAPI AudioVBScriptCF_AddRef(LPCLASSFACTORY iface) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 143 | DMSCRIPT_LockModule(); |
| 144 | |
| 145 | return 2; /* non-heap based object */ |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 146 | } |
| 147 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 148 | static ULONG WINAPI AudioVBScriptCF_Release(LPCLASSFACTORY iface) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 149 | DMSCRIPT_UnlockModule(); |
| 150 | |
| 151 | return 1; /* non-heap based object */ |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 152 | } |
| 153 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 154 | static HRESULT WINAPI AudioVBScriptCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 155 | FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid)); |
| 156 | |
| 157 | if (ppobj == NULL) return E_POINTER; |
| 158 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 159 | return E_NOINTERFACE; |
| 160 | } |
| 161 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 162 | static HRESULT WINAPI AudioVBScriptCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 163 | TRACE("(%d)\n", dolock); |
| 164 | |
| 165 | if (dolock) |
| 166 | DMSCRIPT_LockModule(); |
| 167 | else |
| 168 | DMSCRIPT_UnlockModule(); |
| 169 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 170 | return S_OK; |
| 171 | } |
| 172 | |
Dmitry Timoshkov | 247246e | 2005-05-30 10:01:08 +0000 | [diff] [blame] | 173 | static const IClassFactoryVtbl AudioVBScriptCF_Vtbl = { |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 174 | AudioVBScriptCF_QueryInterface, |
| 175 | AudioVBScriptCF_AddRef, |
| 176 | AudioVBScriptCF_Release, |
| 177 | AudioVBScriptCF_CreateInstance, |
| 178 | AudioVBScriptCF_LockServer |
| 179 | }; |
| 180 | |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 181 | static IClassFactoryImpl AudioVBScript_CF = {&AudioVBScriptCF_Vtbl}; |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 182 | |
| 183 | /****************************************************************** |
| 184 | * DirectMusicScript ClassFactory |
| 185 | */ |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 186 | static HRESULT WINAPI ScriptCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 187 | FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid)); |
| 188 | |
| 189 | if (ppobj == NULL) return E_POINTER; |
| 190 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 191 | return E_NOINTERFACE; |
| 192 | } |
| 193 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 194 | static ULONG WINAPI ScriptCF_AddRef(LPCLASSFACTORY iface) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 195 | DMSCRIPT_LockModule(); |
| 196 | |
| 197 | return 2; /* non-heap based object */ |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 198 | } |
| 199 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 200 | static ULONG WINAPI ScriptCF_Release(LPCLASSFACTORY iface) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 201 | DMSCRIPT_UnlockModule(); |
| 202 | |
| 203 | return 1; /* non-heap based object */ |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 204 | } |
| 205 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 206 | static HRESULT WINAPI ScriptCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 207 | TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj); |
| 208 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 209 | return DMUSIC_CreateDirectMusicScriptImpl (riid, ppobj, pOuter); |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 210 | } |
| 211 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 212 | static HRESULT WINAPI ScriptCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 213 | TRACE("(%d)\n", dolock); |
| 214 | |
| 215 | if (dolock) |
| 216 | DMSCRIPT_LockModule(); |
| 217 | else |
| 218 | DMSCRIPT_UnlockModule(); |
| 219 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 220 | return S_OK; |
| 221 | } |
| 222 | |
Dmitry Timoshkov | 247246e | 2005-05-30 10:01:08 +0000 | [diff] [blame] | 223 | static const IClassFactoryVtbl ScriptCF_Vtbl = { |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 224 | ScriptCF_QueryInterface, |
| 225 | ScriptCF_AddRef, |
| 226 | ScriptCF_Release, |
| 227 | ScriptCF_CreateInstance, |
| 228 | ScriptCF_LockServer |
| 229 | }; |
| 230 | |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 231 | static IClassFactoryImpl Script_CF = {&ScriptCF_Vtbl}; |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 232 | |
| 233 | /****************************************************************** |
| 234 | * DirectMusicScriptAutoImplPerformance ClassFactory |
| 235 | */ |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 236 | static HRESULT WINAPI ScriptAutoImplPerformanceCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 237 | FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid)); |
| 238 | |
| 239 | if (ppobj == NULL) return E_POINTER; |
| 240 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 241 | return E_NOINTERFACE; |
| 242 | } |
| 243 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 244 | static ULONG WINAPI ScriptAutoImplPerformanceCF_AddRef(LPCLASSFACTORY iface) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 245 | DMSCRIPT_LockModule(); |
| 246 | |
| 247 | return 2; /* non-heap based object */ |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 248 | } |
| 249 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 250 | static ULONG WINAPI ScriptAutoImplPerformanceCF_Release(LPCLASSFACTORY iface) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 251 | DMSCRIPT_UnlockModule(); |
| 252 | |
| 253 | return 1; /* non-heap based object */ |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 254 | } |
| 255 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 256 | static HRESULT WINAPI ScriptAutoImplPerformanceCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 257 | FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid)); |
| 258 | |
| 259 | if (ppobj == NULL) return E_POINTER; |
| 260 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 261 | return E_NOINTERFACE; |
| 262 | } |
| 263 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 264 | static HRESULT WINAPI ScriptAutoImplPerformanceCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 265 | TRACE("(%d)\n", dolock); |
| 266 | |
| 267 | if (dolock) |
| 268 | DMSCRIPT_LockModule(); |
| 269 | else |
| 270 | DMSCRIPT_UnlockModule(); |
| 271 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 272 | return S_OK; |
| 273 | } |
| 274 | |
Dmitry Timoshkov | 247246e | 2005-05-30 10:01:08 +0000 | [diff] [blame] | 275 | static const IClassFactoryVtbl ScriptAutoImplPerformanceCF_Vtbl = { |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 276 | ScriptAutoImplPerformanceCF_QueryInterface, |
| 277 | ScriptAutoImplPerformanceCF_AddRef, |
| 278 | ScriptAutoImplPerformanceCF_Release, |
| 279 | ScriptAutoImplPerformanceCF_CreateInstance, |
| 280 | ScriptAutoImplPerformanceCF_LockServer |
| 281 | }; |
| 282 | |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 283 | static IClassFactoryImpl ScriptAutoImplPerformance_CF = {&ScriptAutoImplPerformanceCF_Vtbl}; |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 284 | |
| 285 | /****************************************************************** |
| 286 | * DirectMusicScriptSourceCodeLoader ClassFactory |
| 287 | */ |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 288 | static HRESULT WINAPI ScriptSourceCodeLoaderCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 289 | FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid)); |
| 290 | |
| 291 | if (ppobj == NULL) return E_POINTER; |
| 292 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 293 | return E_NOINTERFACE; |
| 294 | } |
| 295 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 296 | static ULONG WINAPI ScriptSourceCodeLoaderCF_AddRef(LPCLASSFACTORY iface) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 297 | DMSCRIPT_LockModule(); |
| 298 | |
| 299 | return 2; /* non-heap based object */ |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 300 | } |
| 301 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 302 | static ULONG WINAPI ScriptSourceCodeLoaderCF_Release(LPCLASSFACTORY iface) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 303 | DMSCRIPT_UnlockModule(); |
| 304 | |
| 305 | return 1; /* non-heap based object */ |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 306 | } |
| 307 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 308 | static HRESULT WINAPI ScriptSourceCodeLoaderCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 309 | FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid)); |
| 310 | |
| 311 | if (ppobj == NULL) return E_POINTER; |
| 312 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 313 | return E_NOINTERFACE; |
| 314 | } |
| 315 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 316 | static HRESULT WINAPI ScriptSourceCodeLoaderCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 317 | TRACE("(%d)\n", dolock); |
| 318 | |
| 319 | if (dolock) |
| 320 | DMSCRIPT_LockModule(); |
| 321 | else |
| 322 | DMSCRIPT_UnlockModule(); |
| 323 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 324 | return S_OK; |
| 325 | } |
| 326 | |
Dmitry Timoshkov | 247246e | 2005-05-30 10:01:08 +0000 | [diff] [blame] | 327 | static const IClassFactoryVtbl ScriptSourceCodeLoaderCF_Vtbl = { |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 328 | ScriptSourceCodeLoaderCF_QueryInterface, |
| 329 | ScriptSourceCodeLoaderCF_AddRef, |
| 330 | ScriptSourceCodeLoaderCF_Release, |
| 331 | ScriptSourceCodeLoaderCF_CreateInstance, |
| 332 | ScriptSourceCodeLoaderCF_LockServer |
| 333 | }; |
| 334 | |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 335 | static IClassFactoryImpl ScriptSourceCodeLoader_CF = {&ScriptSourceCodeLoaderCF_Vtbl}; |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 336 | |
| 337 | /****************************************************************** |
| 338 | * DirectMusicScriptAutoImplSegmentState ClassFactory |
| 339 | */ |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 340 | static HRESULT WINAPI ScriptAutoImplSegmentStateCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 341 | FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid)); |
| 342 | |
| 343 | if (ppobj == NULL) return E_POINTER; |
| 344 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 345 | return E_NOINTERFACE; |
| 346 | } |
| 347 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 348 | static ULONG WINAPI ScriptAutoImplSegmentStateCF_AddRef(LPCLASSFACTORY iface) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 349 | DMSCRIPT_LockModule(); |
| 350 | |
| 351 | return 2; /* non-heap based object */ |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 352 | } |
| 353 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 354 | static ULONG WINAPI ScriptAutoImplSegmentStateCF_Release(LPCLASSFACTORY iface) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 355 | DMSCRIPT_UnlockModule(); |
| 356 | |
| 357 | return 1; /* non-heap based object */ |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 358 | } |
| 359 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 360 | static HRESULT WINAPI ScriptAutoImplSegmentStateCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 361 | FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid)); |
| 362 | |
| 363 | if (ppobj == NULL) return E_POINTER; |
| 364 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 365 | return E_NOINTERFACE; |
| 366 | } |
| 367 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 368 | static HRESULT WINAPI ScriptAutoImplSegmentStateCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 369 | TRACE("(%d)\n", dolock); |
| 370 | |
| 371 | if (dolock) |
| 372 | DMSCRIPT_LockModule(); |
| 373 | else |
| 374 | DMSCRIPT_UnlockModule(); |
| 375 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 376 | return S_OK; |
| 377 | } |
| 378 | |
Dmitry Timoshkov | 247246e | 2005-05-30 10:01:08 +0000 | [diff] [blame] | 379 | static const IClassFactoryVtbl ScriptAutoImplSegmentStateCF_Vtbl = { |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 380 | ScriptAutoImplSegmentStateCF_QueryInterface, |
| 381 | ScriptAutoImplSegmentStateCF_AddRef, |
| 382 | ScriptAutoImplSegmentStateCF_Release, |
| 383 | ScriptAutoImplSegmentStateCF_CreateInstance, |
| 384 | ScriptAutoImplSegmentStateCF_LockServer |
| 385 | }; |
| 386 | |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 387 | static IClassFactoryImpl ScriptAutoImplSegmentState_CF = {&ScriptAutoImplSegmentStateCF_Vtbl}; |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 388 | |
| 389 | /****************************************************************** |
| 390 | * DirectMusicScriptAutoImplAudioPathConfig ClassFactory |
| 391 | */ |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 392 | static HRESULT WINAPI ScriptAutoImplAudioPathConfigCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 393 | FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid)); |
| 394 | |
| 395 | if (ppobj == NULL) return E_POINTER; |
| 396 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 397 | return E_NOINTERFACE; |
| 398 | } |
| 399 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 400 | static ULONG WINAPI ScriptAutoImplAudioPathConfigCF_AddRef(LPCLASSFACTORY iface) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 401 | DMSCRIPT_LockModule(); |
| 402 | |
| 403 | return 2; /* non-heap based object */ |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 404 | } |
| 405 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 406 | static ULONG WINAPI ScriptAutoImplAudioPathConfigCF_Release(LPCLASSFACTORY iface) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 407 | DMSCRIPT_UnlockModule(); |
| 408 | |
| 409 | return 1; /* non-heap based object */ |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 410 | } |
| 411 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 412 | static HRESULT WINAPI ScriptAutoImplAudioPathConfigCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 413 | FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid)); |
| 414 | |
| 415 | if (ppobj == NULL) return E_POINTER; |
| 416 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 417 | return E_NOINTERFACE; |
| 418 | } |
| 419 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 420 | static HRESULT WINAPI ScriptAutoImplAudioPathConfigCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 421 | TRACE("(%d)\n", dolock); |
| 422 | |
| 423 | if (dolock) |
| 424 | DMSCRIPT_LockModule(); |
| 425 | else |
| 426 | DMSCRIPT_UnlockModule(); |
| 427 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 428 | return S_OK; |
| 429 | } |
| 430 | |
Dmitry Timoshkov | 247246e | 2005-05-30 10:01:08 +0000 | [diff] [blame] | 431 | static const IClassFactoryVtbl ScriptAutoImplAudioPathConfigCF_Vtbl = { |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 432 | ScriptAutoImplAudioPathConfigCF_QueryInterface, |
| 433 | ScriptAutoImplAudioPathConfigCF_AddRef, |
| 434 | ScriptAutoImplAudioPathConfigCF_Release, |
| 435 | ScriptAutoImplAudioPathConfigCF_CreateInstance, |
| 436 | ScriptAutoImplAudioPathConfigCF_LockServer |
| 437 | }; |
| 438 | |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 439 | static IClassFactoryImpl ScriptAutoImplAudioPathConfig_CF = {&ScriptAutoImplAudioPathConfigCF_Vtbl}; |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 440 | |
| 441 | /****************************************************************** |
| 442 | * DirectMusicScriptAutoImplAudioPath ClassFactory |
| 443 | */ |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 444 | static HRESULT WINAPI ScriptAutoImplAudioPathCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 445 | FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid)); |
| 446 | |
| 447 | if (ppobj == NULL) return E_POINTER; |
| 448 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 449 | return E_NOINTERFACE; |
| 450 | } |
| 451 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 452 | static ULONG WINAPI ScriptAutoImplAudioPathCF_AddRef(LPCLASSFACTORY iface) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 453 | DMSCRIPT_LockModule(); |
| 454 | |
| 455 | return 2; /* non-heap based object */ |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 456 | } |
| 457 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 458 | static ULONG WINAPI ScriptAutoImplAudioPathCF_Release(LPCLASSFACTORY iface) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 459 | DMSCRIPT_UnlockModule(); |
| 460 | |
| 461 | return 1; /* non-heap based object */ |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 462 | } |
| 463 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 464 | static HRESULT WINAPI ScriptAutoImplAudioPathCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 465 | FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid)); |
| 466 | |
| 467 | if (ppobj == NULL) return E_POINTER; |
| 468 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 469 | return E_NOINTERFACE; |
| 470 | } |
| 471 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 472 | static HRESULT WINAPI ScriptAutoImplAudioPathCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 473 | TRACE("(%d)\n", dolock); |
| 474 | |
| 475 | if (dolock) |
| 476 | DMSCRIPT_LockModule(); |
| 477 | else |
| 478 | DMSCRIPT_UnlockModule(); |
| 479 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 480 | return S_OK; |
| 481 | } |
| 482 | |
Dmitry Timoshkov | 247246e | 2005-05-30 10:01:08 +0000 | [diff] [blame] | 483 | static const IClassFactoryVtbl ScriptAutoImplAudioPathCF_Vtbl = { |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 484 | ScriptAutoImplAudioPathCF_QueryInterface, |
| 485 | ScriptAutoImplAudioPathCF_AddRef, |
| 486 | ScriptAutoImplAudioPathCF_Release, |
| 487 | ScriptAutoImplAudioPathCF_CreateInstance, |
| 488 | ScriptAutoImplAudioPathCF_LockServer |
| 489 | }; |
| 490 | |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 491 | static IClassFactoryImpl ScriptAutoImplAudioPath_CF = {&ScriptAutoImplAudioPathCF_Vtbl}; |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 492 | |
| 493 | /****************************************************************** |
| 494 | * DirectMusicScriptAutoImplSong ClassFactory |
| 495 | */ |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 496 | static HRESULT WINAPI ScriptAutoImplSongCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 497 | FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid)); |
| 498 | |
| 499 | if (ppobj == NULL) return E_POINTER; |
| 500 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 501 | return E_NOINTERFACE; |
| 502 | } |
| 503 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 504 | static ULONG WINAPI ScriptAutoImplSongCF_AddRef(LPCLASSFACTORY iface) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 505 | DMSCRIPT_LockModule(); |
| 506 | |
| 507 | return 2; /* non-heap based */ |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 508 | } |
| 509 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 510 | static ULONG WINAPI ScriptAutoImplSongCF_Release(LPCLASSFACTORY iface) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 511 | DMSCRIPT_UnlockModule(); |
| 512 | |
| 513 | return 1; /* non-heap based object */ |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 514 | } |
| 515 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 516 | static HRESULT WINAPI ScriptAutoImplSongCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 517 | FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid)); |
| 518 | |
| 519 | if (ppobj == NULL) return E_POINTER; |
| 520 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 521 | return E_NOINTERFACE; |
| 522 | } |
| 523 | |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 524 | static HRESULT WINAPI ScriptAutoImplSongCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 525 | TRACE("(%d)\n", dolock); |
| 526 | |
| 527 | if (dolock) |
| 528 | DMSCRIPT_LockModule(); |
| 529 | else |
| 530 | DMSCRIPT_UnlockModule(); |
| 531 | |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 532 | return S_OK; |
| 533 | } |
| 534 | |
Dmitry Timoshkov | 247246e | 2005-05-30 10:01:08 +0000 | [diff] [blame] | 535 | static const IClassFactoryVtbl ScriptAutoImplSongCF_Vtbl = { |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 536 | ScriptAutoImplSongCF_QueryInterface, |
| 537 | ScriptAutoImplSongCF_AddRef, |
| 538 | ScriptAutoImplSongCF_Release, |
| 539 | ScriptAutoImplSongCF_CreateInstance, |
| 540 | ScriptAutoImplSongCF_LockServer |
| 541 | }; |
| 542 | |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 543 | static IClassFactoryImpl ScriptAutoImplSong_CF = {&ScriptAutoImplSongCF_Vtbl}; |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 544 | |
| 545 | /****************************************************************** |
| 546 | * DllMain |
| 547 | * |
| 548 | * |
| 549 | */ |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 550 | BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { |
| 551 | if (fdwReason == DLL_PROCESS_ATTACH) { |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 552 | DisableThreadLibraryCalls(hinstDLL); |
| 553 | /* FIXME: Initialisation */ |
Rok Mandeljc | 0382ea1 | 2004-01-20 00:21:40 +0000 | [diff] [blame] | 554 | } else if (fdwReason == DLL_PROCESS_DETACH) { |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 555 | /* FIXME: Cleanup */ |
| 556 | } |
| 557 | |
| 558 | return TRUE; |
| 559 | } |
| 560 | |
| 561 | |
| 562 | /****************************************************************** |
Francois Gouget | 1de5d3c | 2005-08-10 14:45:58 +0000 | [diff] [blame] | 563 | * DllCanUnloadNow (DMSCRIPT.@) |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 564 | * |
| 565 | * |
| 566 | */ |
Alexandre Julliard | d37f0ab | 2005-08-08 17:35:28 +0000 | [diff] [blame] | 567 | HRESULT WINAPI DllCanUnloadNow(void) |
| 568 | { |
James Hawkins | 0994b85 | 2005-02-02 09:31:28 +0000 | [diff] [blame] | 569 | return DMSCRIPT_refCount != 0 ? S_FALSE : S_OK; |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 570 | } |
| 571 | |
| 572 | |
| 573 | /****************************************************************** |
Vincent Béron | 21e3ba8 | 2005-08-10 09:53:47 +0000 | [diff] [blame] | 574 | * DllGetClassObject (DMSCRIPT.@) |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 575 | * |
| 576 | * |
| 577 | */ |
Alexandre Julliard | d37f0ab | 2005-08-08 17:35:28 +0000 | [diff] [blame] | 578 | HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) |
| 579 | { |
Rok Mandeljc | b26d65b | 2004-02-25 01:30:03 +0000 | [diff] [blame] | 580 | TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv); |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 581 | if (IsEqualCLSID (rclsid, &CLSID_DirectMusicScriptAutoImpSegment) && IsEqualIID (riid, &IID_IClassFactory)) { |
| 582 | *ppv = (LPVOID) &ScriptAutoImplSegment_CF; |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 583 | IClassFactory_AddRef((IClassFactory*)*ppv); |
| 584 | return S_OK; |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 585 | } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicScriptTrack) && IsEqualIID (riid, &IID_IClassFactory)) { |
| 586 | *ppv = (LPVOID) &ScriptTrack_CF; |
| 587 | IClassFactory_AddRef((IClassFactory*)*ppv); |
| 588 | return S_OK; |
| 589 | } else if (IsEqualCLSID (rclsid, &CLSID_AudioVBScript) && IsEqualIID (riid, &IID_IClassFactory)) { |
| 590 | *ppv = (LPVOID) &AudioVBScript_CF; |
| 591 | IClassFactory_AddRef((IClassFactory*)*ppv); |
| 592 | return S_OK; |
| 593 | } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicScript) && IsEqualIID (riid, &IID_IClassFactory)) { |
| 594 | *ppv = (LPVOID) &Script_CF; |
| 595 | IClassFactory_AddRef((IClassFactory*)*ppv); |
| 596 | return S_OK; |
| 597 | } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicScriptAutoImpPerformance) && IsEqualIID (riid, &IID_IClassFactory)) { |
| 598 | *ppv = (LPVOID) &ScriptAutoImplPerformance_CF; |
| 599 | IClassFactory_AddRef((IClassFactory*)*ppv); |
| 600 | return S_OK; |
Rok Mandeljc | b26d65b | 2004-02-25 01:30:03 +0000 | [diff] [blame] | 601 | } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicScriptSourceCodeLoader) && IsEqualIID (riid, &IID_IClassFactory)) { |
Rok Mandeljc | df167d1 | 2003-08-22 23:53:27 +0000 | [diff] [blame] | 602 | *ppv = (LPVOID) &ScriptSourceCodeLoader_CF; |
| 603 | IClassFactory_AddRef((IClassFactory*)*ppv); |
| 604 | return S_OK; |
| 605 | } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicScriptAutoImpSegmentState) && IsEqualIID (riid, &IID_IClassFactory)) { |
| 606 | *ppv = (LPVOID) &ScriptAutoImplSegmentState_CF; |
| 607 | IClassFactory_AddRef((IClassFactory*)*ppv); |
| 608 | return S_OK; |
| 609 | } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicScriptAutoImpAudioPathConfig) && IsEqualIID (riid, &IID_IClassFactory)) { |
| 610 | *ppv = (LPVOID) &ScriptAutoImplAudioPathConfig_CF; |
| 611 | IClassFactory_AddRef((IClassFactory*)*ppv); |
| 612 | return S_OK; |
| 613 | } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicScriptAutoImpAudioPath) && IsEqualIID (riid, &IID_IClassFactory)) { |
| 614 | *ppv = (LPVOID) &ScriptAutoImplAudioPath_CF; |
| 615 | IClassFactory_AddRef((IClassFactory*)*ppv); |
| 616 | return S_OK; |
| 617 | } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicScriptAutoImpSong) && IsEqualIID (riid, &IID_IClassFactory)) { |
| 618 | *ppv = (LPVOID) &ScriptAutoImplSong_CF; |
| 619 | IClassFactory_AddRef((IClassFactory*)*ppv); |
| 620 | return S_OK; |
| 621 | } |
| 622 | |
Rok Mandeljc | b26d65b | 2004-02-25 01:30:03 +0000 | [diff] [blame] | 623 | WARN("(%s, %s, %p): no interface found.\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv); |
Rok Mandeljc | 473c565 | 2003-07-21 22:10:14 +0000 | [diff] [blame] | 624 | return CLASS_E_CLASSNOTAVAILABLE; |
| 625 | } |
Rok Mandeljc | b26d65b | 2004-02-25 01:30:03 +0000 | [diff] [blame] | 626 | |
| 627 | |
| 628 | /****************************************************************** |
| 629 | * Helper functions |
| 630 | * |
| 631 | * |
| 632 | */ |
| 633 | /* check whether the given DWORD is even (return 0) or odd (return 1) */ |
| 634 | int even_or_odd (DWORD number) { |
| 635 | return (number & 0x1); /* basically, check if bit 0 is set ;) */ |
| 636 | } |
| 637 | |
| 638 | /* FOURCC to string conversion for debug messages */ |
| 639 | const char *debugstr_fourcc (DWORD fourcc) { |
| 640 | if (!fourcc) return "'null'"; |
| 641 | return wine_dbg_sprintf ("\'%c%c%c%c\'", |
| 642 | (char)(fourcc), (char)(fourcc >> 8), |
| 643 | (char)(fourcc >> 16), (char)(fourcc >> 24)); |
| 644 | } |
| 645 | |
| 646 | /* DMUS_VERSION struct to string conversion for debug messages */ |
| 647 | const char *debugstr_dmversion (LPDMUS_VERSION version) { |
| 648 | if (!version) return "'null'"; |
| 649 | return wine_dbg_sprintf ("\'%i,%i,%i,%i\'", |
| 650 | (int)((version->dwVersionMS && 0xFFFF0000) >> 8), (int)(version->dwVersionMS && 0x0000FFFF), |
| 651 | (int)((version->dwVersionLS && 0xFFFF0000) >> 8), (int)(version->dwVersionLS && 0x0000FFFF)); |
| 652 | } |
| 653 | |
| 654 | /* returns name of given GUID */ |
| 655 | const char *debugstr_dmguid (const GUID *id) { |
| 656 | static const guid_info guids[] = { |
| 657 | /* CLSIDs */ |
| 658 | GE(CLSID_AudioVBScript), |
| 659 | GE(CLSID_DirectMusic), |
| 660 | GE(CLSID_DirectMusicAudioPath), |
| 661 | GE(CLSID_DirectMusicAudioPathConfig), |
| 662 | GE(CLSID_DirectMusicAuditionTrack), |
| 663 | GE(CLSID_DirectMusicBand), |
| 664 | GE(CLSID_DirectMusicBandTrack), |
| 665 | GE(CLSID_DirectMusicChordMapTrack), |
| 666 | GE(CLSID_DirectMusicChordMap), |
| 667 | GE(CLSID_DirectMusicChordTrack), |
| 668 | GE(CLSID_DirectMusicCollection), |
| 669 | GE(CLSID_DirectMusicCommandTrack), |
| 670 | GE(CLSID_DirectMusicComposer), |
| 671 | GE(CLSID_DirectMusicContainer), |
| 672 | GE(CLSID_DirectMusicGraph), |
| 673 | GE(CLSID_DirectMusicLoader), |
| 674 | GE(CLSID_DirectMusicLyricsTrack), |
| 675 | GE(CLSID_DirectMusicMarkerTrack), |
| 676 | GE(CLSID_DirectMusicMelodyFormulationTrack), |
| 677 | GE(CLSID_DirectMusicMotifTrack), |
| 678 | GE(CLSID_DirectMusicMuteTrack), |
| 679 | GE(CLSID_DirectMusicParamControlTrack), |
| 680 | GE(CLSID_DirectMusicPatternTrack), |
| 681 | GE(CLSID_DirectMusicPerformance), |
| 682 | GE(CLSID_DirectMusicScript), |
| 683 | GE(CLSID_DirectMusicScriptAutoImpSegment), |
| 684 | GE(CLSID_DirectMusicScriptAutoImpPerformance), |
| 685 | GE(CLSID_DirectMusicScriptAutoImpSegmentState), |
| 686 | GE(CLSID_DirectMusicScriptAutoImpAudioPathConfig), |
| 687 | GE(CLSID_DirectMusicScriptAutoImpAudioPath), |
| 688 | GE(CLSID_DirectMusicScriptAutoImpSong), |
| 689 | GE(CLSID_DirectMusicScriptSourceCodeLoader), |
| 690 | GE(CLSID_DirectMusicScriptTrack), |
| 691 | GE(CLSID_DirectMusicSection), |
| 692 | GE(CLSID_DirectMusicSegment), |
| 693 | GE(CLSID_DirectMusicSegmentState), |
| 694 | GE(CLSID_DirectMusicSegmentTriggerTrack), |
| 695 | GE(CLSID_DirectMusicSegTriggerTrack), |
| 696 | GE(CLSID_DirectMusicSeqTrack), |
| 697 | GE(CLSID_DirectMusicSignPostTrack), |
| 698 | GE(CLSID_DirectMusicSong), |
| 699 | GE(CLSID_DirectMusicStyle), |
| 700 | GE(CLSID_DirectMusicStyleTrack), |
| 701 | GE(CLSID_DirectMusicSynth), |
| 702 | GE(CLSID_DirectMusicSynthSink), |
| 703 | GE(CLSID_DirectMusicSysExTrack), |
| 704 | GE(CLSID_DirectMusicTemplate), |
| 705 | GE(CLSID_DirectMusicTempoTrack), |
| 706 | GE(CLSID_DirectMusicTimeSigTrack), |
| 707 | GE(CLSID_DirectMusicWaveTrack), |
| 708 | GE(CLSID_DirectSoundWave), |
| 709 | /* IIDs */ |
| 710 | GE(IID_IDirectMusic), |
| 711 | GE(IID_IDirectMusic2), |
| 712 | GE(IID_IDirectMusic8), |
| 713 | GE(IID_IDirectMusicAudioPath), |
| 714 | GE(IID_IDirectMusicBand), |
| 715 | GE(IID_IDirectMusicBuffer), |
| 716 | GE(IID_IDirectMusicChordMap), |
| 717 | GE(IID_IDirectMusicCollection), |
| 718 | GE(IID_IDirectMusicComposer), |
| 719 | GE(IID_IDirectMusicContainer), |
| 720 | GE(IID_IDirectMusicDownload), |
| 721 | GE(IID_IDirectMusicDownloadedInstrument), |
| 722 | GE(IID_IDirectMusicGetLoader), |
| 723 | GE(IID_IDirectMusicGraph), |
| 724 | GE(IID_IDirectMusicInstrument), |
| 725 | GE(IID_IDirectMusicLoader), |
| 726 | GE(IID_IDirectMusicLoader8), |
| 727 | GE(IID_IDirectMusicObject), |
| 728 | GE(IID_IDirectMusicPatternTrack), |
| 729 | GE(IID_IDirectMusicPerformance), |
| 730 | GE(IID_IDirectMusicPerformance2), |
| 731 | GE(IID_IDirectMusicPerformance8), |
| 732 | GE(IID_IDirectMusicPort), |
| 733 | GE(IID_IDirectMusicPortDownload), |
| 734 | GE(IID_IDirectMusicScript), |
| 735 | GE(IID_IDirectMusicSegment), |
| 736 | GE(IID_IDirectMusicSegment2), |
| 737 | GE(IID_IDirectMusicSegment8), |
| 738 | GE(IID_IDirectMusicSegmentState), |
| 739 | GE(IID_IDirectMusicSegmentState8), |
| 740 | GE(IID_IDirectMusicStyle), |
| 741 | GE(IID_IDirectMusicStyle8), |
| 742 | GE(IID_IDirectMusicSynth), |
| 743 | GE(IID_IDirectMusicSynth8), |
| 744 | GE(IID_IDirectMusicSynthSink), |
| 745 | GE(IID_IDirectMusicThru), |
| 746 | GE(IID_IDirectMusicTool), |
| 747 | GE(IID_IDirectMusicTool8), |
| 748 | GE(IID_IDirectMusicTrack), |
| 749 | GE(IID_IDirectMusicTrack8), |
| 750 | GE(IID_IUnknown), |
| 751 | GE(IID_IPersistStream), |
| 752 | GE(IID_IStream), |
| 753 | GE(IID_IClassFactory), |
| 754 | /* GUIDs */ |
| 755 | GE(GUID_DirectMusicAllTypes), |
| 756 | GE(GUID_NOTIFICATION_CHORD), |
| 757 | GE(GUID_NOTIFICATION_COMMAND), |
| 758 | GE(GUID_NOTIFICATION_MEASUREANDBEAT), |
| 759 | GE(GUID_NOTIFICATION_PERFORMANCE), |
| 760 | GE(GUID_NOTIFICATION_RECOMPOSE), |
| 761 | GE(GUID_NOTIFICATION_SEGMENT), |
| 762 | GE(GUID_BandParam), |
| 763 | GE(GUID_ChordParam), |
| 764 | GE(GUID_CommandParam), |
| 765 | GE(GUID_CommandParam2), |
| 766 | GE(GUID_CommandParamNext), |
| 767 | GE(GUID_IDirectMusicBand), |
| 768 | GE(GUID_IDirectMusicChordMap), |
| 769 | GE(GUID_IDirectMusicStyle), |
| 770 | GE(GUID_MuteParam), |
| 771 | GE(GUID_Play_Marker), |
| 772 | GE(GUID_RhythmParam), |
| 773 | GE(GUID_TempoParam), |
| 774 | GE(GUID_TimeSignature), |
| 775 | GE(GUID_Valid_Start_Time), |
| 776 | GE(GUID_Clear_All_Bands), |
| 777 | GE(GUID_ConnectToDLSCollection), |
| 778 | GE(GUID_Disable_Auto_Download), |
| 779 | GE(GUID_DisableTempo), |
| 780 | GE(GUID_DisableTimeSig), |
| 781 | GE(GUID_Download), |
| 782 | GE(GUID_DownloadToAudioPath), |
| 783 | GE(GUID_Enable_Auto_Download), |
| 784 | GE(GUID_EnableTempo), |
| 785 | GE(GUID_EnableTimeSig), |
| 786 | GE(GUID_IgnoreBankSelectForGM), |
| 787 | GE(GUID_SeedVariations), |
| 788 | GE(GUID_StandardMIDIFile), |
| 789 | GE(GUID_Unload), |
| 790 | GE(GUID_UnloadFromAudioPath), |
| 791 | GE(GUID_Variations), |
| 792 | GE(GUID_PerfMasterTempo), |
| 793 | GE(GUID_PerfMasterVolume), |
| 794 | GE(GUID_PerfMasterGrooveLevel), |
| 795 | GE(GUID_PerfAutoDownload), |
| 796 | GE(GUID_DefaultGMCollection), |
| 797 | GE(GUID_Synth_Default), |
| 798 | GE(GUID_Buffer_Reverb), |
| 799 | GE(GUID_Buffer_EnvReverb), |
| 800 | GE(GUID_Buffer_Stereo), |
| 801 | GE(GUID_Buffer_3D_Dry), |
| 802 | GE(GUID_Buffer_Mono), |
| 803 | GE(GUID_DMUS_PROP_GM_Hardware), |
| 804 | GE(GUID_DMUS_PROP_GS_Capable), |
| 805 | GE(GUID_DMUS_PROP_GS_Hardware), |
| 806 | GE(GUID_DMUS_PROP_DLS1), |
| 807 | GE(GUID_DMUS_PROP_DLS2), |
| 808 | GE(GUID_DMUS_PROP_Effects), |
| 809 | GE(GUID_DMUS_PROP_INSTRUMENT2), |
| 810 | GE(GUID_DMUS_PROP_LegacyCaps), |
| 811 | GE(GUID_DMUS_PROP_MemorySize), |
| 812 | GE(GUID_DMUS_PROP_SampleMemorySize), |
| 813 | GE(GUID_DMUS_PROP_SamplePlaybackRate), |
| 814 | GE(GUID_DMUS_PROP_SetSynthSink), |
| 815 | GE(GUID_DMUS_PROP_SinkUsesDSound), |
| 816 | GE(GUID_DMUS_PROP_SynthSink_DSOUND), |
| 817 | GE(GUID_DMUS_PROP_SynthSink_WAVE), |
| 818 | GE(GUID_DMUS_PROP_Volume), |
| 819 | GE(GUID_DMUS_PROP_WavesReverb), |
| 820 | GE(GUID_DMUS_PROP_WriteLatency), |
| 821 | GE(GUID_DMUS_PROP_WritePeriod), |
| 822 | GE(GUID_DMUS_PROP_XG_Capable), |
| 823 | GE(GUID_DMUS_PROP_XG_Hardware) |
| 824 | }; |
| 825 | |
| 826 | unsigned int i; |
| 827 | |
| 828 | if (!id) return "(null)"; |
| 829 | |
| 830 | for (i = 0; i < sizeof(guids)/sizeof(guids[0]); i++) { |
| 831 | if (IsEqualGUID(id, &guids[i].guid)) |
| 832 | return guids[i].name; |
| 833 | } |
| 834 | /* if we didn't find it, act like standard debugstr_guid */ |
| 835 | return debugstr_guid(id); |
| 836 | } |
| 837 | |
| 838 | /* returns name of given error code */ |
| 839 | const char *debugstr_dmreturn (DWORD code) { |
| 840 | static const flag_info codes[] = { |
| 841 | FE(S_OK), |
| 842 | FE(S_FALSE), |
| 843 | FE(DMUS_S_PARTIALLOAD), |
| 844 | FE(DMUS_S_PARTIALDOWNLOAD), |
| 845 | FE(DMUS_S_REQUEUE), |
| 846 | FE(DMUS_S_FREE), |
| 847 | FE(DMUS_S_END), |
| 848 | FE(DMUS_S_STRING_TRUNCATED), |
| 849 | FE(DMUS_S_LAST_TOOL), |
| 850 | FE(DMUS_S_OVER_CHORD), |
| 851 | FE(DMUS_S_UP_OCTAVE), |
| 852 | FE(DMUS_S_DOWN_OCTAVE), |
| 853 | FE(DMUS_S_NOBUFFERCONTROL), |
| 854 | FE(DMUS_S_GARBAGE_COLLECTED), |
| 855 | FE(DMUS_E_DRIVER_FAILED), |
| 856 | FE(DMUS_E_PORTS_OPEN), |
| 857 | FE(DMUS_E_DEVICE_IN_USE), |
| 858 | FE(DMUS_E_INSUFFICIENTBUFFER), |
| 859 | FE(DMUS_E_BUFFERNOTSET), |
| 860 | FE(DMUS_E_BUFFERNOTAVAILABLE), |
| 861 | FE(DMUS_E_NOTADLSCOL), |
| 862 | FE(DMUS_E_INVALIDOFFSET), |
| 863 | FE(DMUS_E_ALREADY_LOADED), |
| 864 | FE(DMUS_E_INVALIDPOS), |
| 865 | FE(DMUS_E_INVALIDPATCH), |
| 866 | FE(DMUS_E_CANNOTSEEK), |
| 867 | FE(DMUS_E_CANNOTWRITE), |
| 868 | FE(DMUS_E_CHUNKNOTFOUND), |
| 869 | FE(DMUS_E_INVALID_DOWNLOADID), |
| 870 | FE(DMUS_E_NOT_DOWNLOADED_TO_PORT), |
| 871 | FE(DMUS_E_ALREADY_DOWNLOADED), |
| 872 | FE(DMUS_E_UNKNOWN_PROPERTY), |
| 873 | FE(DMUS_E_SET_UNSUPPORTED), |
| 874 | FE(DMUS_E_GET_UNSUPPORTED), |
| 875 | FE(DMUS_E_NOTMONO), |
| 876 | FE(DMUS_E_BADARTICULATION), |
| 877 | FE(DMUS_E_BADINSTRUMENT), |
| 878 | FE(DMUS_E_BADWAVELINK), |
| 879 | FE(DMUS_E_NOARTICULATION), |
| 880 | FE(DMUS_E_NOTPCM), |
| 881 | FE(DMUS_E_BADWAVE), |
| 882 | FE(DMUS_E_BADOFFSETTABLE), |
| 883 | FE(DMUS_E_UNKNOWNDOWNLOAD), |
| 884 | FE(DMUS_E_NOSYNTHSINK), |
| 885 | FE(DMUS_E_ALREADYOPEN), |
| 886 | FE(DMUS_E_ALREADYCLOSED), |
| 887 | FE(DMUS_E_SYNTHNOTCONFIGURED), |
| 888 | FE(DMUS_E_SYNTHACTIVE), |
| 889 | FE(DMUS_E_CANNOTREAD), |
| 890 | FE(DMUS_E_DMUSIC_RELEASED), |
| 891 | FE(DMUS_E_BUFFER_EMPTY), |
| 892 | FE(DMUS_E_BUFFER_FULL), |
| 893 | FE(DMUS_E_PORT_NOT_CAPTURE), |
| 894 | FE(DMUS_E_PORT_NOT_RENDER), |
| 895 | FE(DMUS_E_DSOUND_NOT_SET), |
| 896 | FE(DMUS_E_ALREADY_ACTIVATED), |
| 897 | FE(DMUS_E_INVALIDBUFFER), |
| 898 | FE(DMUS_E_WAVEFORMATNOTSUPPORTED), |
| 899 | FE(DMUS_E_SYNTHINACTIVE), |
| 900 | FE(DMUS_E_DSOUND_ALREADY_SET), |
| 901 | FE(DMUS_E_INVALID_EVENT), |
| 902 | FE(DMUS_E_UNSUPPORTED_STREAM), |
| 903 | FE(DMUS_E_ALREADY_INITED), |
| 904 | FE(DMUS_E_INVALID_BAND), |
| 905 | FE(DMUS_E_TRACK_HDR_NOT_FIRST_CK), |
| 906 | FE(DMUS_E_TOOL_HDR_NOT_FIRST_CK), |
| 907 | FE(DMUS_E_INVALID_TRACK_HDR), |
| 908 | FE(DMUS_E_INVALID_TOOL_HDR), |
| 909 | FE(DMUS_E_ALL_TOOLS_FAILED), |
| 910 | FE(DMUS_E_ALL_TRACKS_FAILED), |
| 911 | FE(DMUS_E_NOT_FOUND), |
| 912 | FE(DMUS_E_NOT_INIT), |
| 913 | FE(DMUS_E_TYPE_DISABLED), |
| 914 | FE(DMUS_E_TYPE_UNSUPPORTED), |
| 915 | FE(DMUS_E_TIME_PAST), |
| 916 | FE(DMUS_E_TRACK_NOT_FOUND), |
| 917 | FE(DMUS_E_TRACK_NO_CLOCKTIME_SUPPORT), |
| 918 | FE(DMUS_E_NO_MASTER_CLOCK), |
| 919 | FE(DMUS_E_LOADER_NOCLASSID), |
| 920 | FE(DMUS_E_LOADER_BADPATH), |
| 921 | FE(DMUS_E_LOADER_FAILEDOPEN), |
| 922 | FE(DMUS_E_LOADER_FORMATNOTSUPPORTED), |
| 923 | FE(DMUS_E_LOADER_FAILEDCREATE), |
| 924 | FE(DMUS_E_LOADER_OBJECTNOTFOUND), |
| 925 | FE(DMUS_E_LOADER_NOFILENAME), |
| 926 | FE(DMUS_E_INVALIDFILE), |
| 927 | FE(DMUS_E_ALREADY_EXISTS), |
| 928 | FE(DMUS_E_OUT_OF_RANGE), |
| 929 | FE(DMUS_E_SEGMENT_INIT_FAILED), |
| 930 | FE(DMUS_E_ALREADY_SENT), |
| 931 | FE(DMUS_E_CANNOT_FREE), |
| 932 | FE(DMUS_E_CANNOT_OPEN_PORT), |
| 933 | FE(DMUS_E_CANNOT_CONVERT), |
| 934 | FE(DMUS_E_DESCEND_CHUNK_FAIL), |
| 935 | FE(DMUS_E_NOT_LOADED), |
| 936 | FE(DMUS_E_SCRIPT_LANGUAGE_INCOMPATIBLE), |
| 937 | FE(DMUS_E_SCRIPT_UNSUPPORTED_VARTYPE), |
| 938 | FE(DMUS_E_SCRIPT_ERROR_IN_SCRIPT), |
| 939 | FE(DMUS_E_SCRIPT_CANTLOAD_OLEAUT32), |
| 940 | FE(DMUS_E_SCRIPT_LOADSCRIPT_ERROR), |
| 941 | FE(DMUS_E_SCRIPT_INVALID_FILE), |
| 942 | FE(DMUS_E_INVALID_SCRIPTTRACK), |
| 943 | FE(DMUS_E_SCRIPT_VARIABLE_NOT_FOUND), |
| 944 | FE(DMUS_E_SCRIPT_ROUTINE_NOT_FOUND), |
| 945 | FE(DMUS_E_SCRIPT_CONTENT_READONLY), |
| 946 | FE(DMUS_E_SCRIPT_NOT_A_REFERENCE), |
| 947 | FE(DMUS_E_SCRIPT_VALUE_NOT_SUPPORTED), |
| 948 | FE(DMUS_E_INVALID_SEGMENTTRIGGERTRACK), |
| 949 | FE(DMUS_E_INVALID_LYRICSTRACK), |
| 950 | FE(DMUS_E_INVALID_PARAMCONTROLTRACK), |
| 951 | FE(DMUS_E_AUDIOVBSCRIPT_SYNTAXERROR), |
| 952 | FE(DMUS_E_AUDIOVBSCRIPT_RUNTIMEERROR), |
| 953 | FE(DMUS_E_AUDIOVBSCRIPT_OPERATIONFAILURE), |
| 954 | FE(DMUS_E_AUDIOPATHS_NOT_VALID), |
| 955 | FE(DMUS_E_AUDIOPATHS_IN_USE), |
| 956 | FE(DMUS_E_NO_AUDIOPATH_CONFIG), |
| 957 | FE(DMUS_E_AUDIOPATH_INACTIVE), |
| 958 | FE(DMUS_E_AUDIOPATH_NOBUFFER), |
| 959 | FE(DMUS_E_AUDIOPATH_NOPORT), |
| 960 | FE(DMUS_E_NO_AUDIOPATH), |
| 961 | FE(DMUS_E_INVALIDCHUNK), |
| 962 | FE(DMUS_E_AUDIOPATH_NOGLOBALFXBUFFER), |
| 963 | FE(DMUS_E_INVALID_CONTAINER_OBJECT) |
| 964 | }; |
| 965 | unsigned int i; |
| 966 | for (i = 0; i < sizeof(codes)/sizeof(codes[0]); i++) { |
| 967 | if (code == codes[i].val) |
| 968 | return codes[i].name; |
| 969 | } |
| 970 | /* if we didn't find it, return value */ |
| 971 | return wine_dbg_sprintf("0x%08lx", code); |
| 972 | } |
| 973 | |
| 974 | /* generic flag-dumping function */ |
| 975 | const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){ |
| 976 | char buffer[128] = "", *ptr = &buffer[0]; |
| 977 | unsigned int i, size = sizeof(buffer); |
| 978 | |
| 979 | for (i=0; i < num_names; i++) |
| 980 | { |
| 981 | if ((flags & names[i].val) || /* standard flag*/ |
| 982 | ((!flags) && (!names[i].val))) { /* zero value only */ |
| 983 | int cnt = snprintf(ptr, size, "%s ", names[i].name); |
| 984 | if (cnt < 0 || cnt >= size) break; |
| 985 | size -= cnt; |
| 986 | ptr += cnt; |
| 987 | } |
| 988 | } |
| 989 | |
| 990 | return wine_dbg_sprintf("%s", buffer); |
| 991 | } |
| 992 | |
| 993 | /* dump DMUS_OBJ flags */ |
| 994 | const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) { |
| 995 | static const flag_info flags[] = { |
| 996 | FE(DMUS_OBJ_OBJECT), |
| 997 | FE(DMUS_OBJ_CLASS), |
| 998 | FE(DMUS_OBJ_NAME), |
| 999 | FE(DMUS_OBJ_CATEGORY), |
| 1000 | FE(DMUS_OBJ_FILENAME), |
| 1001 | FE(DMUS_OBJ_FULLPATH), |
| 1002 | FE(DMUS_OBJ_URL), |
| 1003 | FE(DMUS_OBJ_VERSION), |
| 1004 | FE(DMUS_OBJ_DATE), |
| 1005 | FE(DMUS_OBJ_LOADED), |
| 1006 | FE(DMUS_OBJ_MEMORY), |
| 1007 | FE(DMUS_OBJ_STREAM) |
| 1008 | }; |
| 1009 | return debugstr_flags (flagmask, flags, sizeof(flags)/sizeof(flags[0])); |
| 1010 | } |
| 1011 | |
| 1012 | /* dump whole DMUS_OBJECTDESC struct */ |
| 1013 | const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) { |
| 1014 | if (pDesc) { |
| 1015 | char buffer[1024] = "", *ptr = &buffer[0]; |
| 1016 | |
| 1017 | ptr += sprintf(ptr, "DMUS_OBJECTDESC (%p):\n", pDesc); |
| 1018 | ptr += sprintf(ptr, " - dwSize = %ld\n", pDesc->dwSize); |
| 1019 | ptr += sprintf(ptr, " - dwValidData = %s\n", debugstr_DMUS_OBJ_FLAGS (pDesc->dwValidData)); |
| 1020 | if (pDesc->dwValidData & DMUS_OBJ_CLASS) ptr += sprintf(ptr, " - guidClass = %s\n", debugstr_dmguid(&pDesc->guidClass)); |
| 1021 | if (pDesc->dwValidData & DMUS_OBJ_OBJECT) ptr += sprintf(ptr, " - guidObject = %s\n", debugstr_guid(&pDesc->guidObject)); |
| 1022 | if (pDesc->dwValidData & DMUS_OBJ_DATE) ptr += sprintf(ptr, " - ftDate = FIXME\n"); |
| 1023 | if (pDesc->dwValidData & DMUS_OBJ_VERSION) ptr += sprintf(ptr, " - vVersion = %s\n", debugstr_dmversion(&pDesc->vVersion)); |
| 1024 | if (pDesc->dwValidData & DMUS_OBJ_NAME) ptr += sprintf(ptr, " - wszName = %s\n", debugstr_w(pDesc->wszName)); |
| 1025 | if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) ptr += sprintf(ptr, " - wszCategory = %s\n", debugstr_w(pDesc->wszCategory)); |
| 1026 | if (pDesc->dwValidData & DMUS_OBJ_FILENAME) ptr += sprintf(ptr, " - wszFileName = %s\n", debugstr_w(pDesc->wszFileName)); |
Stefan Leichter | 6a87f2b | 2006-09-13 22:30:06 +0200 | [diff] [blame^] | 1027 | if (pDesc->dwValidData & DMUS_OBJ_MEMORY) ptr += sprintf(ptr, " - llMemLength = 0x%s\n - pbMemData = %p\n", |
| 1028 | wine_dbgstr_longlong(pDesc->llMemLength), pDesc->pbMemData); |
Rok Mandeljc | b26d65b | 2004-02-25 01:30:03 +0000 | [diff] [blame] | 1029 | if (pDesc->dwValidData & DMUS_OBJ_STREAM) ptr += sprintf(ptr, " - pStream = %p", pDesc->pStream); |
| 1030 | |
| 1031 | return wine_dbg_sprintf("%s", buffer); |
| 1032 | } else { |
| 1033 | return wine_dbg_sprintf("(NULL)"); |
| 1034 | } |
| 1035 | } |