sprintf corupted the output string thus making the output useless. Use TRACE to print each of the member variables. One place used debugstr_DMUS_OBJECTDESC but never printed it.
Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com --- dlls/dmime/audiopath.c | 2 +- dlls/dmime/dmutils.c | 53 ++++++++++++++++++++++++------------------ dlls/dmime/dmutils.h | 2 +- dlls/dmime/graph.c | 2 +- dlls/dmime/segment.c | 2 +- 5 files changed, 34 insertions(+), 27 deletions(-)
diff --git a/dlls/dmime/audiopath.c b/dlls/dmime/audiopath.c index 21aaa4d4129..3e7a268cbf8 100644 --- a/dlls/dmime/audiopath.c +++ b/dlls/dmime/audiopath.c @@ -285,7 +285,7 @@ static HRESULT WINAPI path_IDirectMusicObject_ParseDescriptor(IDirectMusicObject desc->guidClass = CLSID_DirectMusicAudioPathConfig; desc->dwValidData |= DMUS_OBJ_CLASS;
- TRACE("returning descriptor:\n%s\n", debugstr_DMUS_OBJECTDESC (desc)); + dump_DMUS_OBJECTDESC (desc); return S_OK; }
diff --git a/dlls/dmime/dmutils.c b/dlls/dmime/dmutils.c index 121e6dc5a46..33f5da99a97 100644 --- a/dlls/dmime/dmutils.c +++ b/dlls/dmime/dmutils.c @@ -41,6 +41,7 @@ #include "dmutils.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmfile); +WINE_DECLARE_DEBUG_CHANNEL(dmime);
static HRESULT IDirectMusicUtils_IPersistStream_ParseDescGeneric (DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, LPDMUS_OBJECTDESC pDesc) {
@@ -143,7 +144,7 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface,
TRACE("** DM Reference Begin of Load ***\n"); TRACE("With Desc:\n"); - debugstr_DMUS_OBJECTDESC(&ref_desc); + dump_DMUS_OBJECTDESC(&ref_desc);
{ LPDIRECTMUSICGETLOADER pGetLoader = NULL; @@ -430,26 +431,32 @@ static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) { return debugstr_flags(flagmask, flags, ARRAY_SIZE(flags)); }
-const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) { - if (pDesc) { - char buffer[1024], *ptr = buffer; - - ptr += sprintf(ptr, "DMUS_OBJECTDESC (%p):\n", pDesc); - ptr += sprintf(ptr, " - dwSize = 0x%08X\n", pDesc->dwSize); - ptr += sprintf(ptr, " - dwValidData = 0x%08X ( %s)\n", pDesc->dwValidData, debugstr_DMUS_OBJ_FLAGS (pDesc->dwValidData)); - if (pDesc->dwValidData & DMUS_OBJ_CLASS) ptr += sprintf(ptr, " - guidClass = %s\n", debugstr_dmguid(&pDesc->guidClass)); - if (pDesc->dwValidData & DMUS_OBJ_OBJECT) ptr += sprintf(ptr, " - guidObject = %s\n", debugstr_guid(&pDesc->guidObject)); - if (pDesc->dwValidData & DMUS_OBJ_DATE) ptr += sprintf(ptr, " - ftDate = %s\n", debugstr_filetime (&pDesc->ftDate)); - if (pDesc->dwValidData & DMUS_OBJ_VERSION) ptr += sprintf(ptr, " - vVersion = %s\n", debugstr_dmversion(&pDesc->vVersion)); - if (pDesc->dwValidData & DMUS_OBJ_NAME) ptr += sprintf(ptr, " - wszName = %s\n", debugstr_w(pDesc->wszName)); - if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) ptr += sprintf(ptr, " - wszCategory = %s\n", debugstr_w(pDesc->wszCategory)); - if (pDesc->dwValidData & DMUS_OBJ_FILENAME) ptr += sprintf(ptr, " - wszFileName = %s\n", debugstr_w(pDesc->wszFileName)); - if (pDesc->dwValidData & DMUS_OBJ_MEMORY) ptr += sprintf(ptr, " - llMemLength = 0x%s\n - pbMemData = %p\n", - wine_dbgstr_longlong(pDesc->llMemLength), pDesc->pbMemData); - if (pDesc->dwValidData & DMUS_OBJ_STREAM) ptr += sprintf(ptr, " - pStream = %p\n", pDesc->pStream); - - return wine_dbg_sprintf("%s", buffer); - } else { - return wine_dbg_sprintf("(NULL)"); - } +void dump_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) { + if(!TRACE_ON(dmime)) + return; + + if (pDesc) { + TRACE_(dmime)("DMUS_OBJECTDESC (%p):", pDesc); + TRACE_(dmime)(" - dwSize = 0x%08X\n", pDesc->dwSize); + TRACE_(dmime)(" - dwValidData = 0x%08X ( %s)\n", pDesc->dwValidData, debugstr_DMUS_OBJ_FLAGS (pDesc->dwValidData)); + if (pDesc->dwValidData & DMUS_OBJ_CLASS) + TRACE_(dmime)(" - guidClass = %s\n", debugstr_dmguid(&pDesc->guidClass)); + if (pDesc->dwValidData & DMUS_OBJ_OBJECT) + TRACE_(dmime)(" - guidObject = %s\n", debugstr_guid(&pDesc->guidObject)); + if (pDesc->dwValidData & DMUS_OBJ_DATE) + TRACE_(dmime)(" - ftDate = %s\n", debugstr_filetime (&pDesc->ftDate)); + if (pDesc->dwValidData & DMUS_OBJ_VERSION) + TRACE_(dmime)(" - vVersion = %s\n", debugstr_dmversion(&pDesc->vVersion)); + if (pDesc->dwValidData & DMUS_OBJ_NAME) + TRACE_(dmime)(" - wszName = %s\n", debugstr_w(pDesc->wszName)); + if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) + TRACE_(dmime)(" - wszCategory = %s\n", debugstr_w(pDesc->wszCategory)); + if (pDesc->dwValidData & DMUS_OBJ_FILENAME) + TRACE_(dmime)(" - wszFileName = %s\n", debugstr_w(pDesc->wszFileName)); + if (pDesc->dwValidData & DMUS_OBJ_MEMORY) + TRACE_(dmime)(" - llMemLength = 0x%s\n - pbMemData = %p\n", wine_dbgstr_longlong(pDesc->llMemLength), + pDesc->pbMemData); + if (pDesc->dwValidData & DMUS_OBJ_STREAM) + TRACE_(dmime)(" - pStream = %p\n", pDesc->pStream); + } } diff --git a/dlls/dmime/dmutils.h b/dlls/dmime/dmutils.h index 187c9ed3d40..e48791a972f 100644 --- a/dlls/dmime/dmutils.h +++ b/dlls/dmime/dmutils.h @@ -56,6 +56,6 @@ extern const char *debugstr_fourcc (DWORD fourcc) DECLSPEC_HIDDEN; extern const char *debugstr_dmguid (const GUID *id) DECLSPEC_HIDDEN;
/* dump whole DMUS_OBJECTDESC struct */ -extern const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) DECLSPEC_HIDDEN; +void dump_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) DECLSPEC_HIDDEN;
#endif /* __WINE_DMUTILS_H */ diff --git a/dlls/dmime/graph.c b/dlls/dmime/graph.c index fafd4ecffff..95d331f1f5f 100644 --- a/dlls/dmime/graph.c +++ b/dlls/dmime/graph.c @@ -216,7 +216,7 @@ static HRESULT WINAPI graph_IDirectMusicObject_ParseDescriptor(IDirectMusicObjec desc->guidClass = CLSID_DirectMusicGraph; desc->dwValidData |= DMUS_OBJ_CLASS;
- TRACE("returning descriptor:\n%s\n", debugstr_DMUS_OBJECTDESC (desc)); + dump_DMUS_OBJECTDESC (desc); return S_OK; }
diff --git a/dlls/dmime/segment.c b/dlls/dmime/segment.c index 9a9872bd4ce..c804037aef2 100644 --- a/dlls/dmime/segment.c +++ b/dlls/dmime/segment.c @@ -607,7 +607,7 @@ static HRESULT WINAPI seg_IDirectMusicObject_ParseDescriptor(IDirectMusicObject desc->guidClass = CLSID_DirectMusicSegment; desc->dwValidData |= DMUS_OBJ_CLASS;
- TRACE("returning descriptor:\n%s\n", debugstr_DMUS_OBJECTDESC (desc)); + dump_DMUS_OBJECTDESC (desc); return S_OK; }