1 /* DirectMusicSynthesizer 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 "wine/port.h"
25 #include "dmsynth_private.h"
27 WINE_DEFAULT_DEBUG_CHANNEL(dmsynth
);
29 LONG DMSYNTH_refCount
= 0;
32 const IClassFactoryVtbl
*lpVtbl
;
35 /******************************************************************
36 * DirectMusicSynth ClassFactory
38 static HRESULT WINAPI
SynthCF_QueryInterface(LPCLASSFACTORY iface
,REFIID riid
,LPVOID
*ppobj
) {
39 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid
));
41 if (ppobj
== NULL
) return E_POINTER
;
46 static ULONG WINAPI
SynthCF_AddRef(LPCLASSFACTORY iface
) {
49 return 2; /* non-heap based object */
52 static ULONG WINAPI
SynthCF_Release(LPCLASSFACTORY iface
) {
53 DMSYNTH_UnlockModule();
55 return 1; /* non-heap based object */
58 static HRESULT WINAPI
SynthCF_CreateInstance(LPCLASSFACTORY iface
, LPUNKNOWN pOuter
, REFIID riid
, LPVOID
*ppobj
) {
59 TRACE ("(%p, %s, %p)\n", pOuter
, debugstr_dmguid(riid
), ppobj
);
60 return DMUSIC_CreateDirectMusicSynthImpl (riid
, ppobj
, pOuter
);
63 static HRESULT WINAPI
SynthCF_LockServer(LPCLASSFACTORY iface
,BOOL dolock
) {
64 TRACE("(%d)\n", dolock
);
69 DMSYNTH_UnlockModule();
74 static const IClassFactoryVtbl SynthCF_Vtbl
= {
75 SynthCF_QueryInterface
,
78 SynthCF_CreateInstance
,
82 static IClassFactoryImpl Synth_CF
= {&SynthCF_Vtbl
};
84 /******************************************************************
85 * DirectMusicSynthSink ClassFactory
87 static HRESULT WINAPI
SynthSinkCF_QueryInterface(LPCLASSFACTORY iface
,REFIID riid
,LPVOID
*ppobj
) {
88 FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid
));
90 if (ppobj
== NULL
) return E_POINTER
;
95 static ULONG WINAPI
SynthSinkCF_AddRef(LPCLASSFACTORY iface
) {
98 return 2; /* non-heap based object */
101 static ULONG WINAPI
SynthSinkCF_Release(LPCLASSFACTORY iface
) {
102 DMSYNTH_UnlockModule();
104 return 1; /* non-heap based object */
107 static HRESULT WINAPI
SynthSinkCF_CreateInstance(LPCLASSFACTORY iface
, LPUNKNOWN pOuter
, REFIID riid
, LPVOID
*ppobj
) {
108 TRACE ("(%p, %s, %p)\n", pOuter
, debugstr_dmguid(riid
), ppobj
);
109 return DMUSIC_CreateDirectMusicSynthSinkImpl (riid
, ppobj
, pOuter
);
112 static HRESULT WINAPI
SynthSinkCF_LockServer(LPCLASSFACTORY iface
,BOOL dolock
) {
113 TRACE("(%d)\n", dolock
);
116 DMSYNTH_LockModule();
118 DMSYNTH_UnlockModule();
123 static const IClassFactoryVtbl SynthSinkCF_Vtbl
= {
124 SynthSinkCF_QueryInterface
,
127 SynthSinkCF_CreateInstance
,
128 SynthSinkCF_LockServer
131 static IClassFactoryImpl SynthSink_CF
= {&SynthSinkCF_Vtbl
};
133 /******************************************************************
138 BOOL WINAPI
DllMain(HINSTANCE hinstDLL
, DWORD fdwReason
, LPVOID lpvReserved
) {
139 if (fdwReason
== DLL_PROCESS_ATTACH
) {
140 DisableThreadLibraryCalls(hinstDLL
);
141 /* FIXME: Initialisation */
142 } else if (fdwReason
== DLL_PROCESS_DETACH
) {
150 /******************************************************************
151 * DllCanUnloadNow (DMSYNTH.@)
155 HRESULT WINAPI
DllCanUnloadNow(void)
157 return DMSYNTH_refCount
!= 0 ? S_FALSE
: S_OK
;
161 /******************************************************************
162 * DllGetClassObject (DMSYNTH.@)
166 HRESULT WINAPI
DllGetClassObject(REFCLSID rclsid
, REFIID riid
, LPVOID
*ppv
)
168 TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid
), debugstr_dmguid(riid
), ppv
);
169 if (IsEqualCLSID (rclsid
, &CLSID_DirectMusicSynth
) && IsEqualIID (riid
, &IID_IClassFactory
)) {
170 *ppv
= (LPVOID
) &Synth_CF
;
171 IClassFactory_AddRef((IClassFactory
*)*ppv
);
173 } else if (IsEqualCLSID (rclsid
, &CLSID_DirectMusicSynth
) && IsEqualIID (riid
, &IID_IClassFactory
)) {
174 *ppv
= (LPVOID
) &SynthSink_CF
;
175 IClassFactory_AddRef((IClassFactory
*)*ppv
);
179 WARN("(%s,%s,%p): no interface found.\n", debugstr_dmguid(rclsid
), debugstr_dmguid(riid
), ppv
);
180 return CLASS_E_CLASSNOTAVAILABLE
;
183 /******************************************************************
189 /* FOURCC to string conversion for debug messages */
190 const char *debugstr_fourcc (DWORD fourcc
) {
191 if (!fourcc
) return "'null'";
192 return wine_dbg_sprintf ("\'%c%c%c%c\'",
193 (char)(fourcc
), (char)(fourcc
>> 8),
194 (char)(fourcc
>> 16), (char)(fourcc
>> 24));
197 /* DMUS_VERSION struct to string conversion for debug messages */
198 const char *debugstr_dmversion (LPDMUS_VERSION version
) {
199 if (!version
) return "'null'";
200 return wine_dbg_sprintf ("\'%i,%i,%i,%i\'",
201 (int)((version
->dwVersionMS
& 0xFFFF0000) >> 8), (int)(version
->dwVersionMS
& 0x0000FFFF),
202 (int)((version
->dwVersionLS
& 0xFFFF0000) >> 8), (int)(version
->dwVersionLS
& 0x0000FFFF));
205 /* returns name of given GUID */
206 const char *debugstr_dmguid (const GUID
*id
) {
207 static const guid_info guids
[] = {
209 GE(CLSID_AudioVBScript
),
210 GE(CLSID_DirectMusic
),
211 GE(CLSID_DirectMusicAudioPath
),
212 GE(CLSID_DirectMusicAudioPathConfig
),
213 GE(CLSID_DirectMusicAuditionTrack
),
214 GE(CLSID_DirectMusicBand
),
215 GE(CLSID_DirectMusicBandTrack
),
216 GE(CLSID_DirectMusicChordMapTrack
),
217 GE(CLSID_DirectMusicChordMap
),
218 GE(CLSID_DirectMusicChordTrack
),
219 GE(CLSID_DirectMusicCollection
),
220 GE(CLSID_DirectMusicCommandTrack
),
221 GE(CLSID_DirectMusicComposer
),
222 GE(CLSID_DirectMusicContainer
),
223 GE(CLSID_DirectMusicGraph
),
224 GE(CLSID_DirectMusicLoader
),
225 GE(CLSID_DirectMusicLyricsTrack
),
226 GE(CLSID_DirectMusicMarkerTrack
),
227 GE(CLSID_DirectMusicMelodyFormulationTrack
),
228 GE(CLSID_DirectMusicMotifTrack
),
229 GE(CLSID_DirectMusicMuteTrack
),
230 GE(CLSID_DirectMusicParamControlTrack
),
231 GE(CLSID_DirectMusicPatternTrack
),
232 GE(CLSID_DirectMusicPerformance
),
233 GE(CLSID_DirectMusicScript
),
234 GE(CLSID_DirectMusicScriptAutoImpSegment
),
235 GE(CLSID_DirectMusicScriptAutoImpPerformance
),
236 GE(CLSID_DirectMusicScriptAutoImpSegmentState
),
237 GE(CLSID_DirectMusicScriptAutoImpAudioPathConfig
),
238 GE(CLSID_DirectMusicScriptAutoImpAudioPath
),
239 GE(CLSID_DirectMusicScriptAutoImpSong
),
240 GE(CLSID_DirectMusicScriptSourceCodeLoader
),
241 GE(CLSID_DirectMusicScriptTrack
),
242 GE(CLSID_DirectMusicSection
),
243 GE(CLSID_DirectMusicSegment
),
244 GE(CLSID_DirectMusicSegmentState
),
245 GE(CLSID_DirectMusicSegmentTriggerTrack
),
246 GE(CLSID_DirectMusicSegTriggerTrack
),
247 GE(CLSID_DirectMusicSeqTrack
),
248 GE(CLSID_DirectMusicSignPostTrack
),
249 GE(CLSID_DirectMusicSong
),
250 GE(CLSID_DirectMusicStyle
),
251 GE(CLSID_DirectMusicStyleTrack
),
252 GE(CLSID_DirectMusicSynth
),
253 GE(CLSID_DirectMusicSynthSink
),
254 GE(CLSID_DirectMusicSysExTrack
),
255 GE(CLSID_DirectMusicTemplate
),
256 GE(CLSID_DirectMusicTempoTrack
),
257 GE(CLSID_DirectMusicTimeSigTrack
),
258 GE(CLSID_DirectMusicWaveTrack
),
259 GE(CLSID_DirectSoundWave
),
261 GE(IID_IDirectMusic
),
262 GE(IID_IDirectMusic2
),
263 GE(IID_IDirectMusic8
),
264 GE(IID_IDirectMusicAudioPath
),
265 GE(IID_IDirectMusicBand
),
266 GE(IID_IDirectMusicBuffer
),
267 GE(IID_IDirectMusicChordMap
),
268 GE(IID_IDirectMusicCollection
),
269 GE(IID_IDirectMusicComposer
),
270 GE(IID_IDirectMusicContainer
),
271 GE(IID_IDirectMusicDownload
),
272 GE(IID_IDirectMusicDownloadedInstrument
),
273 GE(IID_IDirectMusicGetLoader
),
274 GE(IID_IDirectMusicGraph
),
275 GE(IID_IDirectMusicInstrument
),
276 GE(IID_IDirectMusicLoader
),
277 GE(IID_IDirectMusicLoader8
),
278 GE(IID_IDirectMusicObject
),
279 GE(IID_IDirectMusicPatternTrack
),
280 GE(IID_IDirectMusicPerformance
),
281 GE(IID_IDirectMusicPerformance2
),
282 GE(IID_IDirectMusicPerformance8
),
283 GE(IID_IDirectMusicPort
),
284 GE(IID_IDirectMusicPortDownload
),
285 GE(IID_IDirectMusicScript
),
286 GE(IID_IDirectMusicSegment
),
287 GE(IID_IDirectMusicSegment2
),
288 GE(IID_IDirectMusicSegment8
),
289 GE(IID_IDirectMusicSegmentState
),
290 GE(IID_IDirectMusicSegmentState8
),
291 GE(IID_IDirectMusicStyle
),
292 GE(IID_IDirectMusicStyle8
),
293 GE(IID_IDirectMusicSynth
),
294 GE(IID_IDirectMusicSynth8
),
295 GE(IID_IDirectMusicSynthSink
),
296 GE(IID_IDirectMusicThru
),
297 GE(IID_IDirectMusicTool
),
298 GE(IID_IDirectMusicTool8
),
299 GE(IID_IDirectMusicTrack
),
300 GE(IID_IDirectMusicTrack8
),
302 GE(IID_IPersistStream
),
304 GE(IID_IClassFactory
),
306 GE(GUID_DirectMusicAllTypes
),
307 GE(GUID_NOTIFICATION_CHORD
),
308 GE(GUID_NOTIFICATION_COMMAND
),
309 GE(GUID_NOTIFICATION_MEASUREANDBEAT
),
310 GE(GUID_NOTIFICATION_PERFORMANCE
),
311 GE(GUID_NOTIFICATION_RECOMPOSE
),
312 GE(GUID_NOTIFICATION_SEGMENT
),
315 GE(GUID_CommandParam
),
316 GE(GUID_CommandParam2
),
317 GE(GUID_CommandParamNext
),
318 GE(GUID_IDirectMusicBand
),
319 GE(GUID_IDirectMusicChordMap
),
320 GE(GUID_IDirectMusicStyle
),
322 GE(GUID_Play_Marker
),
323 GE(GUID_RhythmParam
),
325 GE(GUID_TimeSignature
),
326 GE(GUID_Valid_Start_Time
),
327 GE(GUID_Clear_All_Bands
),
328 GE(GUID_ConnectToDLSCollection
),
329 GE(GUID_Disable_Auto_Download
),
330 GE(GUID_DisableTempo
),
331 GE(GUID_DisableTimeSig
),
333 GE(GUID_DownloadToAudioPath
),
334 GE(GUID_Enable_Auto_Download
),
335 GE(GUID_EnableTempo
),
336 GE(GUID_EnableTimeSig
),
337 GE(GUID_IgnoreBankSelectForGM
),
338 GE(GUID_SeedVariations
),
339 GE(GUID_StandardMIDIFile
),
341 GE(GUID_UnloadFromAudioPath
),
343 GE(GUID_PerfMasterTempo
),
344 GE(GUID_PerfMasterVolume
),
345 GE(GUID_PerfMasterGrooveLevel
),
346 GE(GUID_PerfAutoDownload
),
347 GE(GUID_DefaultGMCollection
),
348 GE(GUID_Synth_Default
),
349 GE(GUID_Buffer_Reverb
),
350 GE(GUID_Buffer_EnvReverb
),
351 GE(GUID_Buffer_Stereo
),
352 GE(GUID_Buffer_3D_Dry
),
353 GE(GUID_Buffer_Mono
),
354 GE(GUID_DMUS_PROP_GM_Hardware
),
355 GE(GUID_DMUS_PROP_GS_Capable
),
356 GE(GUID_DMUS_PROP_GS_Hardware
),
357 GE(GUID_DMUS_PROP_DLS1
),
358 GE(GUID_DMUS_PROP_DLS2
),
359 GE(GUID_DMUS_PROP_Effects
),
360 GE(GUID_DMUS_PROP_INSTRUMENT2
),
361 GE(GUID_DMUS_PROP_LegacyCaps
),
362 GE(GUID_DMUS_PROP_MemorySize
),
363 GE(GUID_DMUS_PROP_SampleMemorySize
),
364 GE(GUID_DMUS_PROP_SamplePlaybackRate
),
365 GE(GUID_DMUS_PROP_SetSynthSink
),
366 GE(GUID_DMUS_PROP_SinkUsesDSound
),
367 GE(GUID_DMUS_PROP_SynthSink_DSOUND
),
368 GE(GUID_DMUS_PROP_SynthSink_WAVE
),
369 GE(GUID_DMUS_PROP_Volume
),
370 GE(GUID_DMUS_PROP_WavesReverb
),
371 GE(GUID_DMUS_PROP_WriteLatency
),
372 GE(GUID_DMUS_PROP_WritePeriod
),
373 GE(GUID_DMUS_PROP_XG_Capable
),
374 GE(GUID_DMUS_PROP_XG_Hardware
)
379 if (!id
) return "(null)";
381 for (i
= 0; i
< sizeof(guids
)/sizeof(guids
[0]); i
++) {
382 if (IsEqualGUID(id
, guids
[i
].guid
))
383 return guids
[i
].name
;
385 /* if we didn't find it, act like standard debugstr_guid */
386 return debugstr_guid(id
);
389 /* returns name of given error code */
390 const char *debugstr_dmreturn (DWORD code
) {
391 static const flag_info codes
[] = {
394 FE(DMUS_S_PARTIALLOAD
),
395 FE(DMUS_S_PARTIALDOWNLOAD
),
399 FE(DMUS_S_STRING_TRUNCATED
),
400 FE(DMUS_S_LAST_TOOL
),
401 FE(DMUS_S_OVER_CHORD
),
402 FE(DMUS_S_UP_OCTAVE
),
403 FE(DMUS_S_DOWN_OCTAVE
),
404 FE(DMUS_S_NOBUFFERCONTROL
),
405 FE(DMUS_S_GARBAGE_COLLECTED
),
406 FE(DMUS_E_DRIVER_FAILED
),
407 FE(DMUS_E_PORTS_OPEN
),
408 FE(DMUS_E_DEVICE_IN_USE
),
409 FE(DMUS_E_INSUFFICIENTBUFFER
),
410 FE(DMUS_E_BUFFERNOTSET
),
411 FE(DMUS_E_BUFFERNOTAVAILABLE
),
412 FE(DMUS_E_NOTADLSCOL
),
413 FE(DMUS_E_INVALIDOFFSET
),
414 FE(DMUS_E_ALREADY_LOADED
),
415 FE(DMUS_E_INVALIDPOS
),
416 FE(DMUS_E_INVALIDPATCH
),
417 FE(DMUS_E_CANNOTSEEK
),
418 FE(DMUS_E_CANNOTWRITE
),
419 FE(DMUS_E_CHUNKNOTFOUND
),
420 FE(DMUS_E_INVALID_DOWNLOADID
),
421 FE(DMUS_E_NOT_DOWNLOADED_TO_PORT
),
422 FE(DMUS_E_ALREADY_DOWNLOADED
),
423 FE(DMUS_E_UNKNOWN_PROPERTY
),
424 FE(DMUS_E_SET_UNSUPPORTED
),
425 FE(DMUS_E_GET_UNSUPPORTED
),
427 FE(DMUS_E_BADARTICULATION
),
428 FE(DMUS_E_BADINSTRUMENT
),
429 FE(DMUS_E_BADWAVELINK
),
430 FE(DMUS_E_NOARTICULATION
),
433 FE(DMUS_E_BADOFFSETTABLE
),
434 FE(DMUS_E_UNKNOWNDOWNLOAD
),
435 FE(DMUS_E_NOSYNTHSINK
),
436 FE(DMUS_E_ALREADYOPEN
),
437 FE(DMUS_E_ALREADYCLOSED
),
438 FE(DMUS_E_SYNTHNOTCONFIGURED
),
439 FE(DMUS_E_SYNTHACTIVE
),
440 FE(DMUS_E_CANNOTREAD
),
441 FE(DMUS_E_DMUSIC_RELEASED
),
442 FE(DMUS_E_BUFFER_EMPTY
),
443 FE(DMUS_E_BUFFER_FULL
),
444 FE(DMUS_E_PORT_NOT_CAPTURE
),
445 FE(DMUS_E_PORT_NOT_RENDER
),
446 FE(DMUS_E_DSOUND_NOT_SET
),
447 FE(DMUS_E_ALREADY_ACTIVATED
),
448 FE(DMUS_E_INVALIDBUFFER
),
449 FE(DMUS_E_WAVEFORMATNOTSUPPORTED
),
450 FE(DMUS_E_SYNTHINACTIVE
),
451 FE(DMUS_E_DSOUND_ALREADY_SET
),
452 FE(DMUS_E_INVALID_EVENT
),
453 FE(DMUS_E_UNSUPPORTED_STREAM
),
454 FE(DMUS_E_ALREADY_INITED
),
455 FE(DMUS_E_INVALID_BAND
),
456 FE(DMUS_E_TRACK_HDR_NOT_FIRST_CK
),
457 FE(DMUS_E_TOOL_HDR_NOT_FIRST_CK
),
458 FE(DMUS_E_INVALID_TRACK_HDR
),
459 FE(DMUS_E_INVALID_TOOL_HDR
),
460 FE(DMUS_E_ALL_TOOLS_FAILED
),
461 FE(DMUS_E_ALL_TRACKS_FAILED
),
462 FE(DMUS_E_NOT_FOUND
),
464 FE(DMUS_E_TYPE_DISABLED
),
465 FE(DMUS_E_TYPE_UNSUPPORTED
),
466 FE(DMUS_E_TIME_PAST
),
467 FE(DMUS_E_TRACK_NOT_FOUND
),
468 FE(DMUS_E_TRACK_NO_CLOCKTIME_SUPPORT
),
469 FE(DMUS_E_NO_MASTER_CLOCK
),
470 FE(DMUS_E_LOADER_NOCLASSID
),
471 FE(DMUS_E_LOADER_BADPATH
),
472 FE(DMUS_E_LOADER_FAILEDOPEN
),
473 FE(DMUS_E_LOADER_FORMATNOTSUPPORTED
),
474 FE(DMUS_E_LOADER_FAILEDCREATE
),
475 FE(DMUS_E_LOADER_OBJECTNOTFOUND
),
476 FE(DMUS_E_LOADER_NOFILENAME
),
477 FE(DMUS_E_INVALIDFILE
),
478 FE(DMUS_E_ALREADY_EXISTS
),
479 FE(DMUS_E_OUT_OF_RANGE
),
480 FE(DMUS_E_SEGMENT_INIT_FAILED
),
481 FE(DMUS_E_ALREADY_SENT
),
482 FE(DMUS_E_CANNOT_FREE
),
483 FE(DMUS_E_CANNOT_OPEN_PORT
),
484 FE(DMUS_E_CANNOT_CONVERT
),
485 FE(DMUS_E_DESCEND_CHUNK_FAIL
),
486 FE(DMUS_E_NOT_LOADED
),
487 FE(DMUS_E_SCRIPT_LANGUAGE_INCOMPATIBLE
),
488 FE(DMUS_E_SCRIPT_UNSUPPORTED_VARTYPE
),
489 FE(DMUS_E_SCRIPT_ERROR_IN_SCRIPT
),
490 FE(DMUS_E_SCRIPT_CANTLOAD_OLEAUT32
),
491 FE(DMUS_E_SCRIPT_LOADSCRIPT_ERROR
),
492 FE(DMUS_E_SCRIPT_INVALID_FILE
),
493 FE(DMUS_E_INVALID_SCRIPTTRACK
),
494 FE(DMUS_E_SCRIPT_VARIABLE_NOT_FOUND
),
495 FE(DMUS_E_SCRIPT_ROUTINE_NOT_FOUND
),
496 FE(DMUS_E_SCRIPT_CONTENT_READONLY
),
497 FE(DMUS_E_SCRIPT_NOT_A_REFERENCE
),
498 FE(DMUS_E_SCRIPT_VALUE_NOT_SUPPORTED
),
499 FE(DMUS_E_INVALID_SEGMENTTRIGGERTRACK
),
500 FE(DMUS_E_INVALID_LYRICSTRACK
),
501 FE(DMUS_E_INVALID_PARAMCONTROLTRACK
),
502 FE(DMUS_E_AUDIOVBSCRIPT_SYNTAXERROR
),
503 FE(DMUS_E_AUDIOVBSCRIPT_RUNTIMEERROR
),
504 FE(DMUS_E_AUDIOVBSCRIPT_OPERATIONFAILURE
),
505 FE(DMUS_E_AUDIOPATHS_NOT_VALID
),
506 FE(DMUS_E_AUDIOPATHS_IN_USE
),
507 FE(DMUS_E_NO_AUDIOPATH_CONFIG
),
508 FE(DMUS_E_AUDIOPATH_INACTIVE
),
509 FE(DMUS_E_AUDIOPATH_NOBUFFER
),
510 FE(DMUS_E_AUDIOPATH_NOPORT
),
511 FE(DMUS_E_NO_AUDIOPATH
),
512 FE(DMUS_E_INVALIDCHUNK
),
513 FE(DMUS_E_AUDIOPATH_NOGLOBALFXBUFFER
),
514 FE(DMUS_E_INVALID_CONTAINER_OBJECT
)
517 for (i
= 0; i
< sizeof(codes
)/sizeof(codes
[0]); i
++) {
518 if (code
== codes
[i
].val
)
519 return codes
[i
].name
;
521 /* if we didn't find it, return value */
522 return wine_dbg_sprintf("0x%08x", code
);
525 /* generic flag-dumping function */
526 const char* debugstr_flags (DWORD flags
, const flag_info
* names
, size_t num_names
){
527 char buffer
[128] = "", *ptr
= &buffer
[0];
528 unsigned int i
, size
= sizeof(buffer
);
530 for (i
=0; i
< num_names
; i
++)
532 if ((flags
& names
[i
].val
) || /* standard flag*/
533 ((!flags
) && (!names
[i
].val
))) { /* zero value only */
534 int cnt
= snprintf(ptr
, size
, "%s ", names
[i
].name
);
535 if (cnt
< 0 || cnt
>= size
) break;
541 return wine_dbg_sprintf("%s", buffer
);