Merge branch 'master' of git+ssh://repo.or.cz/srv/git/wine/winequartzdrv
[wine/winequartzdrv.git] / dlls / dswave / dswave_main.c
bloba66f1be61d0347a1eb9dae7ead243cca69422d22
1 /* DirectMusic Wave 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
20 #include <stdio.h>
22 #include "dswave_private.h"
24 WINE_DEFAULT_DEBUG_CHANNEL(dswave);
26 LONG DSWAVE_refCount = 0;
28 typedef struct {
29 const IClassFactoryVtbl *lpVtbl;
30 } IClassFactoryImpl;
32 /******************************************************************
33 * DirectMusicWave ClassFactory
35 static HRESULT WINAPI WaveCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
36 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
38 if (ppobj == NULL) return E_POINTER;
40 return E_NOINTERFACE;
43 static ULONG WINAPI WaveCF_AddRef(LPCLASSFACTORY iface) {
44 DSWAVE_LockModule();
46 return 2; /* non-heap based object */
49 static ULONG WINAPI WaveCF_Release(LPCLASSFACTORY iface) {
50 DSWAVE_UnlockModule();
52 return 1; /* non-heap based object */
55 static HRESULT WINAPI WaveCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) {
56 TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj);
58 return DMUSIC_CreateDirectMusicWaveImpl (riid, ppobj, pOuter);
61 static HRESULT WINAPI WaveCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
62 TRACE("(%d)\n", dolock);
64 if (dolock)
65 DSWAVE_LockModule();
66 else
67 DSWAVE_UnlockModule();
69 return S_OK;
72 static const IClassFactoryVtbl WaveCF_Vtbl = {
73 WaveCF_QueryInterface,
74 WaveCF_AddRef,
75 WaveCF_Release,
76 WaveCF_CreateInstance,
77 WaveCF_LockServer
80 static IClassFactoryImpl Wave_CF = {&WaveCF_Vtbl};
82 /******************************************************************
83 * DllMain
87 BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
88 if (fdwReason == DLL_PROCESS_ATTACH) {
89 DisableThreadLibraryCalls(hinstDLL);
90 /* FIXME: Initialisation */
91 } else if (fdwReason == DLL_PROCESS_DETACH) {
92 /* FIXME: Cleanup */
95 return TRUE;
99 /******************************************************************
100 * DllCanUnloadNow (DSWAVE.@)
104 HRESULT WINAPI DllCanUnloadNow(void)
106 return DSWAVE_refCount != 0 ? S_FALSE : S_OK;
110 /******************************************************************
111 * DllGetClassObject (DSWAVE.@)
115 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
117 TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
118 if (IsEqualCLSID (rclsid, &CLSID_DirectSoundWave) && IsEqualIID (riid, &IID_IClassFactory)) {
119 *ppv = (LPVOID) &Wave_CF;
120 IClassFactory_AddRef((IClassFactory*)*ppv);
121 return S_OK;
124 WARN("(%s, %s, %p): no interface found.\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
125 return CLASS_E_CLASSNOTAVAILABLE;
128 /******************************************************************
129 * Helper functions
133 /* check whether the given DWORD is even (return 0) or odd (return 1) */
134 int even_or_odd (DWORD number) {
135 return (number & 0x1); /* basically, check if bit 0 is set ;) */
138 /* FOURCC to string conversion for debug messages */
139 const char *debugstr_fourcc (DWORD fourcc) {
140 if (!fourcc) return "'null'";
141 return wine_dbg_sprintf ("\'%c%c%c%c\'",
142 (char)(fourcc), (char)(fourcc >> 8),
143 (char)(fourcc >> 16), (char)(fourcc >> 24));
146 /* DMUS_VERSION struct to string conversion for debug messages */
147 const char *debugstr_dmversion (const DMUS_VERSION *version) {
148 if (!version) return "'null'";
149 return wine_dbg_sprintf ("\'%i,%i,%i,%i\'",
150 (int)((version->dwVersionMS & 0xFFFF0000) >> 8), (int)(version->dwVersionMS & 0x0000FFFF),
151 (int)((version->dwVersionLS & 0xFFFF0000) >> 8), (int)(version->dwVersionLS & 0x0000FFFF));
154 /* returns name of given GUID */
155 const char *debugstr_dmguid (const GUID *id) {
156 static const guid_info guids[] = {
157 /* CLSIDs */
158 GE(CLSID_AudioVBScript),
159 GE(CLSID_DirectMusic),
160 GE(CLSID_DirectMusicAudioPath),
161 GE(CLSID_DirectMusicAudioPathConfig),
162 GE(CLSID_DirectMusicAuditionTrack),
163 GE(CLSID_DirectMusicBand),
164 GE(CLSID_DirectMusicBandTrack),
165 GE(CLSID_DirectMusicChordMapTrack),
166 GE(CLSID_DirectMusicChordMap),
167 GE(CLSID_DirectMusicChordTrack),
168 GE(CLSID_DirectMusicCollection),
169 GE(CLSID_DirectMusicCommandTrack),
170 GE(CLSID_DirectMusicComposer),
171 GE(CLSID_DirectMusicContainer),
172 GE(CLSID_DirectMusicGraph),
173 GE(CLSID_DirectMusicLoader),
174 GE(CLSID_DirectMusicLyricsTrack),
175 GE(CLSID_DirectMusicMarkerTrack),
176 GE(CLSID_DirectMusicMelodyFormulationTrack),
177 GE(CLSID_DirectMusicMotifTrack),
178 GE(CLSID_DirectMusicMuteTrack),
179 GE(CLSID_DirectMusicParamControlTrack),
180 GE(CLSID_DirectMusicPatternTrack),
181 GE(CLSID_DirectMusicPerformance),
182 GE(CLSID_DirectMusicScript),
183 GE(CLSID_DirectMusicScriptAutoImpSegment),
184 GE(CLSID_DirectMusicScriptAutoImpPerformance),
185 GE(CLSID_DirectMusicScriptAutoImpSegmentState),
186 GE(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
187 GE(CLSID_DirectMusicScriptAutoImpAudioPath),
188 GE(CLSID_DirectMusicScriptAutoImpSong),
189 GE(CLSID_DirectMusicScriptSourceCodeLoader),
190 GE(CLSID_DirectMusicScriptTrack),
191 GE(CLSID_DirectMusicSection),
192 GE(CLSID_DirectMusicSegment),
193 GE(CLSID_DirectMusicSegmentState),
194 GE(CLSID_DirectMusicSegmentTriggerTrack),
195 GE(CLSID_DirectMusicSegTriggerTrack),
196 GE(CLSID_DirectMusicSeqTrack),
197 GE(CLSID_DirectMusicSignPostTrack),
198 GE(CLSID_DirectMusicSong),
199 GE(CLSID_DirectMusicStyle),
200 GE(CLSID_DirectMusicStyleTrack),
201 GE(CLSID_DirectMusicSynth),
202 GE(CLSID_DirectMusicSynthSink),
203 GE(CLSID_DirectMusicSysExTrack),
204 GE(CLSID_DirectMusicTemplate),
205 GE(CLSID_DirectMusicTempoTrack),
206 GE(CLSID_DirectMusicTimeSigTrack),
207 GE(CLSID_DirectMusicWaveTrack),
208 GE(CLSID_DirectSoundWave),
209 /* IIDs */
210 GE(IID_IDirectMusic),
211 GE(IID_IDirectMusic2),
212 GE(IID_IDirectMusic8),
213 GE(IID_IDirectMusicAudioPath),
214 GE(IID_IDirectMusicBand),
215 GE(IID_IDirectMusicBuffer),
216 GE(IID_IDirectMusicChordMap),
217 GE(IID_IDirectMusicCollection),
218 GE(IID_IDirectMusicComposer),
219 GE(IID_IDirectMusicContainer),
220 GE(IID_IDirectMusicDownload),
221 GE(IID_IDirectMusicDownloadedInstrument),
222 GE(IID_IDirectMusicGetLoader),
223 GE(IID_IDirectMusicGraph),
224 GE(IID_IDirectMusicInstrument),
225 GE(IID_IDirectMusicLoader),
226 GE(IID_IDirectMusicLoader8),
227 GE(IID_IDirectMusicObject),
228 GE(IID_IDirectMusicPatternTrack),
229 GE(IID_IDirectMusicPerformance),
230 GE(IID_IDirectMusicPerformance2),
231 GE(IID_IDirectMusicPerformance8),
232 GE(IID_IDirectMusicPort),
233 GE(IID_IDirectMusicPortDownload),
234 GE(IID_IDirectMusicScript),
235 GE(IID_IDirectMusicSegment),
236 GE(IID_IDirectMusicSegment2),
237 GE(IID_IDirectMusicSegment8),
238 GE(IID_IDirectMusicSegmentState),
239 GE(IID_IDirectMusicSegmentState8),
240 GE(IID_IDirectMusicStyle),
241 GE(IID_IDirectMusicStyle8),
242 GE(IID_IDirectMusicSynth),
243 GE(IID_IDirectMusicSynth8),
244 GE(IID_IDirectMusicSynthSink),
245 GE(IID_IDirectMusicThru),
246 GE(IID_IDirectMusicTool),
247 GE(IID_IDirectMusicTool8),
248 GE(IID_IDirectMusicTrack),
249 GE(IID_IDirectMusicTrack8),
250 GE(IID_IUnknown),
251 GE(IID_IPersistStream),
252 GE(IID_IStream),
253 GE(IID_IClassFactory),
254 /* GUIDs */
255 GE(GUID_DirectMusicAllTypes),
256 GE(GUID_NOTIFICATION_CHORD),
257 GE(GUID_NOTIFICATION_COMMAND),
258 GE(GUID_NOTIFICATION_MEASUREANDBEAT),
259 GE(GUID_NOTIFICATION_PERFORMANCE),
260 GE(GUID_NOTIFICATION_RECOMPOSE),
261 GE(GUID_NOTIFICATION_SEGMENT),
262 GE(GUID_BandParam),
263 GE(GUID_ChordParam),
264 GE(GUID_CommandParam),
265 GE(GUID_CommandParam2),
266 GE(GUID_CommandParamNext),
267 GE(GUID_IDirectMusicBand),
268 GE(GUID_IDirectMusicChordMap),
269 GE(GUID_IDirectMusicStyle),
270 GE(GUID_MuteParam),
271 GE(GUID_Play_Marker),
272 GE(GUID_RhythmParam),
273 GE(GUID_TempoParam),
274 GE(GUID_TimeSignature),
275 GE(GUID_Valid_Start_Time),
276 GE(GUID_Clear_All_Bands),
277 GE(GUID_ConnectToDLSCollection),
278 GE(GUID_Disable_Auto_Download),
279 GE(GUID_DisableTempo),
280 GE(GUID_DisableTimeSig),
281 GE(GUID_Download),
282 GE(GUID_DownloadToAudioPath),
283 GE(GUID_Enable_Auto_Download),
284 GE(GUID_EnableTempo),
285 GE(GUID_EnableTimeSig),
286 GE(GUID_IgnoreBankSelectForGM),
287 GE(GUID_SeedVariations),
288 GE(GUID_StandardMIDIFile),
289 GE(GUID_Unload),
290 GE(GUID_UnloadFromAudioPath),
291 GE(GUID_Variations),
292 GE(GUID_PerfMasterTempo),
293 GE(GUID_PerfMasterVolume),
294 GE(GUID_PerfMasterGrooveLevel),
295 GE(GUID_PerfAutoDownload),
296 GE(GUID_DefaultGMCollection),
297 GE(GUID_Synth_Default),
298 GE(GUID_Buffer_Reverb),
299 GE(GUID_Buffer_EnvReverb),
300 GE(GUID_Buffer_Stereo),
301 GE(GUID_Buffer_3D_Dry),
302 GE(GUID_Buffer_Mono),
303 GE(GUID_DMUS_PROP_GM_Hardware),
304 GE(GUID_DMUS_PROP_GS_Capable),
305 GE(GUID_DMUS_PROP_GS_Hardware),
306 GE(GUID_DMUS_PROP_DLS1),
307 GE(GUID_DMUS_PROP_DLS2),
308 GE(GUID_DMUS_PROP_Effects),
309 GE(GUID_DMUS_PROP_INSTRUMENT2),
310 GE(GUID_DMUS_PROP_LegacyCaps),
311 GE(GUID_DMUS_PROP_MemorySize),
312 GE(GUID_DMUS_PROP_SampleMemorySize),
313 GE(GUID_DMUS_PROP_SamplePlaybackRate),
314 GE(GUID_DMUS_PROP_SetSynthSink),
315 GE(GUID_DMUS_PROP_SinkUsesDSound),
316 GE(GUID_DMUS_PROP_SynthSink_DSOUND),
317 GE(GUID_DMUS_PROP_SynthSink_WAVE),
318 GE(GUID_DMUS_PROP_Volume),
319 GE(GUID_DMUS_PROP_WavesReverb),
320 GE(GUID_DMUS_PROP_WriteLatency),
321 GE(GUID_DMUS_PROP_WritePeriod),
322 GE(GUID_DMUS_PROP_XG_Capable),
323 GE(GUID_DMUS_PROP_XG_Hardware)
326 unsigned int i;
328 if (!id) return "(null)";
330 for (i = 0; i < sizeof(guids)/sizeof(guids[0]); i++) {
331 if (IsEqualGUID(id, guids[i].guid))
332 return guids[i].name;
334 /* if we didn't find it, act like standard debugstr_guid */
335 return debugstr_guid(id);
338 /* returns name of given error code */
339 const char *debugstr_dmreturn (DWORD code) {
340 static const flag_info codes[] = {
341 FE(S_OK),
342 FE(S_FALSE),
343 FE(DMUS_S_PARTIALLOAD),
344 FE(DMUS_S_PARTIALDOWNLOAD),
345 FE(DMUS_S_REQUEUE),
346 FE(DMUS_S_FREE),
347 FE(DMUS_S_END),
348 FE(DMUS_S_STRING_TRUNCATED),
349 FE(DMUS_S_LAST_TOOL),
350 FE(DMUS_S_OVER_CHORD),
351 FE(DMUS_S_UP_OCTAVE),
352 FE(DMUS_S_DOWN_OCTAVE),
353 FE(DMUS_S_NOBUFFERCONTROL),
354 FE(DMUS_S_GARBAGE_COLLECTED),
355 FE(DMUS_E_DRIVER_FAILED),
356 FE(DMUS_E_PORTS_OPEN),
357 FE(DMUS_E_DEVICE_IN_USE),
358 FE(DMUS_E_INSUFFICIENTBUFFER),
359 FE(DMUS_E_BUFFERNOTSET),
360 FE(DMUS_E_BUFFERNOTAVAILABLE),
361 FE(DMUS_E_NOTADLSCOL),
362 FE(DMUS_E_INVALIDOFFSET),
363 FE(DMUS_E_ALREADY_LOADED),
364 FE(DMUS_E_INVALIDPOS),
365 FE(DMUS_E_INVALIDPATCH),
366 FE(DMUS_E_CANNOTSEEK),
367 FE(DMUS_E_CANNOTWRITE),
368 FE(DMUS_E_CHUNKNOTFOUND),
369 FE(DMUS_E_INVALID_DOWNLOADID),
370 FE(DMUS_E_NOT_DOWNLOADED_TO_PORT),
371 FE(DMUS_E_ALREADY_DOWNLOADED),
372 FE(DMUS_E_UNKNOWN_PROPERTY),
373 FE(DMUS_E_SET_UNSUPPORTED),
374 FE(DMUS_E_GET_UNSUPPORTED),
375 FE(DMUS_E_NOTMONO),
376 FE(DMUS_E_BADARTICULATION),
377 FE(DMUS_E_BADINSTRUMENT),
378 FE(DMUS_E_BADWAVELINK),
379 FE(DMUS_E_NOARTICULATION),
380 FE(DMUS_E_NOTPCM),
381 FE(DMUS_E_BADWAVE),
382 FE(DMUS_E_BADOFFSETTABLE),
383 FE(DMUS_E_UNKNOWNDOWNLOAD),
384 FE(DMUS_E_NOSYNTHSINK),
385 FE(DMUS_E_ALREADYOPEN),
386 FE(DMUS_E_ALREADYCLOSED),
387 FE(DMUS_E_SYNTHNOTCONFIGURED),
388 FE(DMUS_E_SYNTHACTIVE),
389 FE(DMUS_E_CANNOTREAD),
390 FE(DMUS_E_DMUSIC_RELEASED),
391 FE(DMUS_E_BUFFER_EMPTY),
392 FE(DMUS_E_BUFFER_FULL),
393 FE(DMUS_E_PORT_NOT_CAPTURE),
394 FE(DMUS_E_PORT_NOT_RENDER),
395 FE(DMUS_E_DSOUND_NOT_SET),
396 FE(DMUS_E_ALREADY_ACTIVATED),
397 FE(DMUS_E_INVALIDBUFFER),
398 FE(DMUS_E_WAVEFORMATNOTSUPPORTED),
399 FE(DMUS_E_SYNTHINACTIVE),
400 FE(DMUS_E_DSOUND_ALREADY_SET),
401 FE(DMUS_E_INVALID_EVENT),
402 FE(DMUS_E_UNSUPPORTED_STREAM),
403 FE(DMUS_E_ALREADY_INITED),
404 FE(DMUS_E_INVALID_BAND),
405 FE(DMUS_E_TRACK_HDR_NOT_FIRST_CK),
406 FE(DMUS_E_TOOL_HDR_NOT_FIRST_CK),
407 FE(DMUS_E_INVALID_TRACK_HDR),
408 FE(DMUS_E_INVALID_TOOL_HDR),
409 FE(DMUS_E_ALL_TOOLS_FAILED),
410 FE(DMUS_E_ALL_TRACKS_FAILED),
411 FE(DMUS_E_NOT_FOUND),
412 FE(DMUS_E_NOT_INIT),
413 FE(DMUS_E_TYPE_DISABLED),
414 FE(DMUS_E_TYPE_UNSUPPORTED),
415 FE(DMUS_E_TIME_PAST),
416 FE(DMUS_E_TRACK_NOT_FOUND),
417 FE(DMUS_E_TRACK_NO_CLOCKTIME_SUPPORT),
418 FE(DMUS_E_NO_MASTER_CLOCK),
419 FE(DMUS_E_LOADER_NOCLASSID),
420 FE(DMUS_E_LOADER_BADPATH),
421 FE(DMUS_E_LOADER_FAILEDOPEN),
422 FE(DMUS_E_LOADER_FORMATNOTSUPPORTED),
423 FE(DMUS_E_LOADER_FAILEDCREATE),
424 FE(DMUS_E_LOADER_OBJECTNOTFOUND),
425 FE(DMUS_E_LOADER_NOFILENAME),
426 FE(DMUS_E_INVALIDFILE),
427 FE(DMUS_E_ALREADY_EXISTS),
428 FE(DMUS_E_OUT_OF_RANGE),
429 FE(DMUS_E_SEGMENT_INIT_FAILED),
430 FE(DMUS_E_ALREADY_SENT),
431 FE(DMUS_E_CANNOT_FREE),
432 FE(DMUS_E_CANNOT_OPEN_PORT),
433 FE(DMUS_E_CANNOT_CONVERT),
434 FE(DMUS_E_DESCEND_CHUNK_FAIL),
435 FE(DMUS_E_NOT_LOADED),
436 FE(DMUS_E_SCRIPT_LANGUAGE_INCOMPATIBLE),
437 FE(DMUS_E_SCRIPT_UNSUPPORTED_VARTYPE),
438 FE(DMUS_E_SCRIPT_ERROR_IN_SCRIPT),
439 FE(DMUS_E_SCRIPT_CANTLOAD_OLEAUT32),
440 FE(DMUS_E_SCRIPT_LOADSCRIPT_ERROR),
441 FE(DMUS_E_SCRIPT_INVALID_FILE),
442 FE(DMUS_E_INVALID_SCRIPTTRACK),
443 FE(DMUS_E_SCRIPT_VARIABLE_NOT_FOUND),
444 FE(DMUS_E_SCRIPT_ROUTINE_NOT_FOUND),
445 FE(DMUS_E_SCRIPT_CONTENT_READONLY),
446 FE(DMUS_E_SCRIPT_NOT_A_REFERENCE),
447 FE(DMUS_E_SCRIPT_VALUE_NOT_SUPPORTED),
448 FE(DMUS_E_INVALID_SEGMENTTRIGGERTRACK),
449 FE(DMUS_E_INVALID_LYRICSTRACK),
450 FE(DMUS_E_INVALID_PARAMCONTROLTRACK),
451 FE(DMUS_E_AUDIOVBSCRIPT_SYNTAXERROR),
452 FE(DMUS_E_AUDIOVBSCRIPT_RUNTIMEERROR),
453 FE(DMUS_E_AUDIOVBSCRIPT_OPERATIONFAILURE),
454 FE(DMUS_E_AUDIOPATHS_NOT_VALID),
455 FE(DMUS_E_AUDIOPATHS_IN_USE),
456 FE(DMUS_E_NO_AUDIOPATH_CONFIG),
457 FE(DMUS_E_AUDIOPATH_INACTIVE),
458 FE(DMUS_E_AUDIOPATH_NOBUFFER),
459 FE(DMUS_E_AUDIOPATH_NOPORT),
460 FE(DMUS_E_NO_AUDIOPATH),
461 FE(DMUS_E_INVALIDCHUNK),
462 FE(DMUS_E_AUDIOPATH_NOGLOBALFXBUFFER),
463 FE(DMUS_E_INVALID_CONTAINER_OBJECT)
465 unsigned int i;
466 for (i = 0; i < sizeof(codes)/sizeof(codes[0]); i++) {
467 if (code == codes[i].val)
468 return codes[i].name;
470 /* if we didn't find it, return value */
471 return wine_dbg_sprintf("0x%08x", code);
474 /* generic flag-dumping function */
475 const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){
476 char buffer[128] = "", *ptr = &buffer[0];
477 unsigned int i, size = sizeof(buffer);
479 for (i=0; i < num_names; i++)
481 if ((flags & names[i].val) || /* standard flag*/
482 ((!flags) && (!names[i].val))) { /* zero value only */
483 int cnt = snprintf(ptr, size, "%s ", names[i].name);
484 if (cnt < 0 || cnt >= size) break;
485 size -= cnt;
486 ptr += cnt;
490 return wine_dbg_sprintf("%s", buffer);
493 /* dump DMUS_OBJ flags */
494 const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) {
495 static const flag_info flags[] = {
496 FE(DMUS_OBJ_OBJECT),
497 FE(DMUS_OBJ_CLASS),
498 FE(DMUS_OBJ_NAME),
499 FE(DMUS_OBJ_CATEGORY),
500 FE(DMUS_OBJ_FILENAME),
501 FE(DMUS_OBJ_FULLPATH),
502 FE(DMUS_OBJ_URL),
503 FE(DMUS_OBJ_VERSION),
504 FE(DMUS_OBJ_DATE),
505 FE(DMUS_OBJ_LOADED),
506 FE(DMUS_OBJ_MEMORY),
507 FE(DMUS_OBJ_STREAM)
509 return debugstr_flags (flagmask, flags, sizeof(flags)/sizeof(flags[0]));
512 /* dump whole DMUS_OBJECTDESC struct */
513 const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) {
514 if (pDesc) {
515 char buffer[1024] = "", *ptr = &buffer[0];
517 ptr += sprintf(ptr, "DMUS_OBJECTDESC (%p):\n", pDesc);
518 ptr += sprintf(ptr, " - dwSize = %d\n", pDesc->dwSize);
519 ptr += sprintf(ptr, " - dwValidData = %s\n", debugstr_DMUS_OBJ_FLAGS (pDesc->dwValidData));
520 if (pDesc->dwValidData & DMUS_OBJ_CLASS) ptr += sprintf(ptr, " - guidClass = %s\n", debugstr_dmguid(&pDesc->guidClass));
521 if (pDesc->dwValidData & DMUS_OBJ_OBJECT) ptr += sprintf(ptr, " - guidObject = %s\n", debugstr_guid(&pDesc->guidObject));
522 if (pDesc->dwValidData & DMUS_OBJ_DATE) ptr += sprintf(ptr, " - ftDate = FIXME\n");
523 if (pDesc->dwValidData & DMUS_OBJ_VERSION) ptr += sprintf(ptr, " - vVersion = %s\n", debugstr_dmversion(&pDesc->vVersion));
524 if (pDesc->dwValidData & DMUS_OBJ_NAME) ptr += sprintf(ptr, " - wszName = %s\n", debugstr_w(pDesc->wszName));
525 if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) ptr += sprintf(ptr, " - wszCategory = %s\n", debugstr_w(pDesc->wszCategory));
526 if (pDesc->dwValidData & DMUS_OBJ_FILENAME) ptr += sprintf(ptr, " - wszFileName = %s\n", debugstr_w(pDesc->wszFileName));
527 if (pDesc->dwValidData & DMUS_OBJ_MEMORY) ptr += sprintf(ptr, " - llMemLength = 0x%s\n - pbMemData = %p\n",
528 wine_dbgstr_longlong(pDesc->llMemLength), pDesc->pbMemData);
529 if (pDesc->dwValidData & DMUS_OBJ_STREAM) ptr += sprintf(ptr, " - pStream = %p", pDesc->pStream);
531 return wine_dbg_sprintf("%s", buffer);
532 } else {
533 return wine_dbg_sprintf("(NULL)");