Wine-devel
Threads by month
- ----- 2026 -----
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
December 2019
- 73 participants
- 634 discussions
[PATCH 1/2] msado15: Add ISupportErrorInfo support to _Connection
by Alistair Leslie-Hughes 12 Dec '19
by Alistair Leslie-Hughes 12 Dec '19
12 Dec '19
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/msado15/connection.c | 46 +++++++++++++++++++++++++++++++++++-
dlls/msado15/tests/msado15.c | 5 ++--
2 files changed, 47 insertions(+), 4 deletions(-)
diff --git a/dlls/msado15/connection.c b/dlls/msado15/connection.c
index 037ab52199..80d921d091 100644
--- a/dlls/msado15/connection.c
+++ b/dlls/msado15/connection.c
@@ -33,6 +33,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msado15);
struct connection
{
_Connection Connection_iface;
+ ISupportErrorInfo ISupportErrorInfo_iface;
LONG refs;
ObjectStateEnum state;
@@ -44,6 +45,11 @@ static inline struct connection *impl_from_Connection( _Connection *iface )
return CONTAINING_RECORD( iface, struct connection, Connection_iface );
}
+static inline struct connection *impl_from_ISupportErrorInfo(ISupportErrorInfo *iface)
+{
+ return CONTAINING_RECORD(iface, struct connection, ISupportErrorInfo_iface);
+}
+
static ULONG WINAPI connection_AddRef( _Connection *iface )
{
struct connection *connection = impl_from_Connection( iface );
@@ -64,13 +70,18 @@ static ULONG WINAPI connection_Release( _Connection *iface )
static HRESULT WINAPI connection_QueryInterface( _Connection *iface, REFIID riid, void **obj )
{
- TRACE( "%p, %s, %p\n", iface, debugstr_guid(riid), obj );
+ struct connection *connection = impl_from_Connection( iface );
+ TRACE( "%p, %s, %p\n", connection, debugstr_guid(riid), obj );
if (IsEqualGUID( riid, &IID__Connection ) || IsEqualGUID( riid, &IID_IDispatch ) ||
IsEqualGUID( riid, &IID_IUnknown ))
{
*obj = iface;
}
+ else if(IsEqualGUID( riid, &IID_ISupportErrorInfo ))
+ {
+ *obj = &connection->ISupportErrorInfo_iface;
+ }
else
{
FIXME( "interface %s not implemented\n", debugstr_guid(riid) );
@@ -339,12 +350,45 @@ static const struct _ConnectionVtbl connection_vtbl =
connection_Cancel
};
+static HRESULT WINAPI SupportErrorInfo_QueryInterface(ISupportErrorInfo *iface, REFIID riid, void **obj)
+{
+ struct connection *connection = impl_from_ISupportErrorInfo( iface );
+ return connection_QueryInterface(&connection->Connection_iface, riid, obj);
+}
+
+static ULONG WINAPI SupportErrorInfo_AddRef(ISupportErrorInfo *iface)
+{
+ struct connection *connection = impl_from_ISupportErrorInfo( iface );
+ return connection_AddRef(&connection->Connection_iface);
+}
+
+static ULONG WINAPI SupportErrorInfo_Release(ISupportErrorInfo *iface)
+{
+ struct connection *connection = impl_from_ISupportErrorInfo( iface );
+ return connection_Release(&connection->Connection_iface);
+}
+
+static HRESULT WINAPI SupportErrorInfo_InterfaceSupportsErrorInfo(ISupportErrorInfo *iface, REFIID riid)
+{
+ struct connection *connection = impl_from_ISupportErrorInfo( iface );
+ FIXME("(%p)->(%s)\n", connection, debugstr_guid(riid));
+ return S_FALSE;
+}
+
+static const struct ISupportErrorInfoVtbl support_error_vtbl = {
+ SupportErrorInfo_QueryInterface,
+ SupportErrorInfo_AddRef,
+ SupportErrorInfo_Release,
+ SupportErrorInfo_InterfaceSupportsErrorInfo
+};
+
HRESULT Connection_create( void **obj )
{
struct connection *connection;
if (!(connection = heap_alloc( sizeof(*connection) ))) return E_OUTOFMEMORY;
connection->Connection_iface.lpVtbl = &connection_vtbl;
+ connection->ISupportErrorInfo_iface.lpVtbl = &support_error_vtbl;
connection->refs = 1;
connection->state = adStateClosed;
connection->timeout = 30;
diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c
index 4ef4762ac6..5a1813694b 100644
--- a/dlls/msado15/tests/msado15.c
+++ b/dlls/msado15/tests/msado15.c
@@ -414,9 +414,8 @@ static void test_Connection(void)
ok(hr == E_NOINTERFACE, "Unexpected IRunnableObject interface\n");
hr = _Connection_QueryInterface(connection, &IID_ISupportErrorInfo, (void**)&errorinfo);
- todo_wine ok(hr == S_OK, "Failed to get ISupportErrorInfo interface\n");
- if (hr == S_OK)
- ISupportErrorInfo_Release(errorinfo);
+ ok(hr == S_OK, "Failed to get ISupportErrorInfo interface\n");
+ ISupportErrorInfo_Release(errorinfo);
if (0) /* Crashes on windows */
{
--
2.17.1
2
1
[PATCH 9/9] dmcompos: Use the debug functions provided by dmobject.[ch]
by Michael Stefaniuc 12 Dec '19
by Michael Stefaniuc 12 Dec '19
12 Dec '19
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmcompos/chordmap.c | 4 +-
dlls/dmcompos/composer.c | 1 +
dlls/dmcompos/dmcompos_main.c | 265 +------------------------------
dlls/dmcompos/dmcompos_private.h | 22 ---
dlls/dmcompos/dmobject.c | 247 +++++++++++++++++++++++++++-
dlls/dmcompos/dmobject.h | 14 +-
6 files changed, 258 insertions(+), 295 deletions(-)
diff --git a/dlls/dmcompos/chordmap.c b/dlls/dmcompos/chordmap.c
index 5296970b56..c58857e04c 100644
--- a/dlls/dmcompos/chordmap.c
+++ b/dlls/dmcompos/chordmap.c
@@ -129,7 +129,9 @@ static HRESULT WINAPI chord_IDirectMusicObject_ParseDescriptor(IDirectMusicObjec
desc->guidClass = CLSID_DirectMusicChordMap;
desc->dwValidData |= DMUS_OBJ_CLASS;
- TRACE("returning descriptor:\n%s\n", debugstr_DMUS_OBJECTDESC (desc));
+ TRACE("returning descriptor:\n");
+ dump_DMUS_OBJECTDESC(desc);
+
return S_OK;
}
diff --git a/dlls/dmcompos/composer.c b/dlls/dmcompos/composer.c
index f2d826020d..9fbe1689c6 100644
--- a/dlls/dmcompos/composer.c
+++ b/dlls/dmcompos/composer.c
@@ -18,6 +18,7 @@
*/
#include "dmcompos_private.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmcompos);
diff --git a/dlls/dmcompos/dmcompos_main.c b/dlls/dmcompos/dmcompos_main.c
index 3428a58b91..b8b3c5d6d2 100644
--- a/dlls/dmcompos/dmcompos_main.c
+++ b/dlls/dmcompos/dmcompos_main.c
@@ -33,6 +33,7 @@
#include "dmusici.h"
#include "dmcompos_private.h"
+#include "dmobject.h"
#include "rpcproxy.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmcompos);
@@ -213,267 +214,3 @@ HRESULT WINAPI DllUnregisterServer(void)
*
*
*/
-/* FOURCC to string conversion for debug messages */
-const char *debugstr_fourcc (DWORD fourcc) {
- if (!fourcc) return "'null'";
- return wine_dbg_sprintf ("\'%c%c%c%c\'",
- (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
-}
-
-/* DMUS_VERSION struct to string conversion for debug messages */
-static const char *debugstr_dmversion(const DMUS_VERSION *version)
-{
- if (!version)
- return "'null'";
- return wine_dbg_sprintf("'%hu,%hu,%hu,%hu'",
- HIWORD(version->dwVersionMS), LOWORD(version->dwVersionMS),
- HIWORD(version->dwVersionLS), LOWORD(version->dwVersionLS));
-}
-
-/* returns name of given GUID */
-const char *debugstr_dmguid (const GUID *id) {
- static const guid_info guids[] = {
- /* CLSIDs */
- GE(CLSID_AudioVBScript),
- GE(CLSID_DirectMusic),
- GE(CLSID_DirectMusicAudioPathConfig),
- GE(CLSID_DirectMusicAuditionTrack),
- GE(CLSID_DirectMusicBand),
- GE(CLSID_DirectMusicBandTrack),
- GE(CLSID_DirectMusicChordMapTrack),
- GE(CLSID_DirectMusicChordMap),
- GE(CLSID_DirectMusicChordTrack),
- GE(CLSID_DirectMusicCollection),
- GE(CLSID_DirectMusicCommandTrack),
- GE(CLSID_DirectMusicComposer),
- GE(CLSID_DirectMusicContainer),
- GE(CLSID_DirectMusicGraph),
- GE(CLSID_DirectMusicLoader),
- GE(CLSID_DirectMusicLyricsTrack),
- GE(CLSID_DirectMusicMarkerTrack),
- GE(CLSID_DirectMusicMelodyFormulationTrack),
- GE(CLSID_DirectMusicMotifTrack),
- GE(CLSID_DirectMusicMuteTrack),
- GE(CLSID_DirectMusicParamControlTrack),
- GE(CLSID_DirectMusicPatternTrack),
- GE(CLSID_DirectMusicPerformance),
- GE(CLSID_DirectMusicScript),
- GE(CLSID_DirectMusicScriptAutoImpSegment),
- GE(CLSID_DirectMusicScriptAutoImpPerformance),
- GE(CLSID_DirectMusicScriptAutoImpSegmentState),
- GE(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
- GE(CLSID_DirectMusicScriptAutoImpAudioPath),
- GE(CLSID_DirectMusicScriptAutoImpSong),
- GE(CLSID_DirectMusicScriptSourceCodeLoader),
- GE(CLSID_DirectMusicScriptTrack),
- GE(CLSID_DirectMusicSection),
- GE(CLSID_DirectMusicSegment),
- GE(CLSID_DirectMusicSegmentState),
- GE(CLSID_DirectMusicSegmentTriggerTrack),
- GE(CLSID_DirectMusicSegTriggerTrack),
- GE(CLSID_DirectMusicSeqTrack),
- GE(CLSID_DirectMusicSignPostTrack),
- GE(CLSID_DirectMusicSong),
- GE(CLSID_DirectMusicStyle),
- GE(CLSID_DirectMusicStyleTrack),
- GE(CLSID_DirectMusicSynth),
- GE(CLSID_DirectMusicSynthSink),
- GE(CLSID_DirectMusicSysExTrack),
- GE(CLSID_DirectMusicTemplate),
- GE(CLSID_DirectMusicTempoTrack),
- GE(CLSID_DirectMusicTimeSigTrack),
- GE(CLSID_DirectMusicWaveTrack),
- GE(CLSID_DirectSoundWave),
- /* IIDs */
- GE(IID_IDirectMusic),
- GE(IID_IDirectMusic2),
- GE(IID_IDirectMusic8),
- GE(IID_IDirectMusicAudioPath),
- GE(IID_IDirectMusicBand),
- GE(IID_IDirectMusicBuffer),
- GE(IID_IDirectMusicChordMap),
- GE(IID_IDirectMusicCollection),
- GE(IID_IDirectMusicComposer),
- GE(IID_IDirectMusicContainer),
- GE(IID_IDirectMusicDownload),
- GE(IID_IDirectMusicDownloadedInstrument),
- GE(IID_IDirectMusicGetLoader),
- GE(IID_IDirectMusicGraph),
- GE(IID_IDirectMusicInstrument),
- GE(IID_IDirectMusicLoader),
- GE(IID_IDirectMusicLoader8),
- GE(IID_IDirectMusicObject),
- GE(IID_IDirectMusicPatternTrack),
- GE(IID_IDirectMusicPerformance),
- GE(IID_IDirectMusicPerformance2),
- GE(IID_IDirectMusicPerformance8),
- GE(IID_IDirectMusicPort),
- GE(IID_IDirectMusicPortDownload),
- GE(IID_IDirectMusicScript),
- GE(IID_IDirectMusicSegment),
- GE(IID_IDirectMusicSegment2),
- GE(IID_IDirectMusicSegment8),
- GE(IID_IDirectMusicSegmentState),
- GE(IID_IDirectMusicSegmentState8),
- GE(IID_IDirectMusicStyle),
- GE(IID_IDirectMusicStyle8),
- GE(IID_IDirectMusicSynth),
- GE(IID_IDirectMusicSynth8),
- GE(IID_IDirectMusicSynthSink),
- GE(IID_IDirectMusicThru),
- GE(IID_IDirectMusicTool),
- GE(IID_IDirectMusicTool8),
- GE(IID_IDirectMusicTrack),
- GE(IID_IDirectMusicTrack8),
- GE(IID_IUnknown),
- GE(IID_IPersistStream),
- GE(IID_IStream),
- GE(IID_IClassFactory),
- /* GUIDs */
- GE(GUID_DirectMusicAllTypes),
- GE(GUID_NOTIFICATION_CHORD),
- GE(GUID_NOTIFICATION_COMMAND),
- GE(GUID_NOTIFICATION_MEASUREANDBEAT),
- GE(GUID_NOTIFICATION_PERFORMANCE),
- GE(GUID_NOTIFICATION_RECOMPOSE),
- GE(GUID_NOTIFICATION_SEGMENT),
- GE(GUID_BandParam),
- GE(GUID_ChordParam),
- GE(GUID_CommandParam),
- GE(GUID_CommandParam2),
- GE(GUID_CommandParamNext),
- GE(GUID_IDirectMusicBand),
- GE(GUID_IDirectMusicChordMap),
- GE(GUID_IDirectMusicStyle),
- GE(GUID_MuteParam),
- GE(GUID_Play_Marker),
- GE(GUID_RhythmParam),
- GE(GUID_TempoParam),
- GE(GUID_TimeSignature),
- GE(GUID_Valid_Start_Time),
- GE(GUID_Clear_All_Bands),
- GE(GUID_ConnectToDLSCollection),
- GE(GUID_Disable_Auto_Download),
- GE(GUID_DisableTempo),
- GE(GUID_DisableTimeSig),
- GE(GUID_Download),
- GE(GUID_DownloadToAudioPath),
- GE(GUID_Enable_Auto_Download),
- GE(GUID_EnableTempo),
- GE(GUID_EnableTimeSig),
- GE(GUID_IgnoreBankSelectForGM),
- GE(GUID_SeedVariations),
- GE(GUID_StandardMIDIFile),
- GE(GUID_Unload),
- GE(GUID_UnloadFromAudioPath),
- GE(GUID_Variations),
- GE(GUID_PerfMasterTempo),
- GE(GUID_PerfMasterVolume),
- GE(GUID_PerfMasterGrooveLevel),
- GE(GUID_PerfAutoDownload),
- GE(GUID_DefaultGMCollection),
- GE(GUID_Synth_Default),
- GE(GUID_Buffer_Reverb),
- GE(GUID_Buffer_EnvReverb),
- GE(GUID_Buffer_Stereo),
- GE(GUID_Buffer_3D_Dry),
- GE(GUID_Buffer_Mono),
- GE(GUID_DMUS_PROP_GM_Hardware),
- GE(GUID_DMUS_PROP_GS_Capable),
- GE(GUID_DMUS_PROP_GS_Hardware),
- GE(GUID_DMUS_PROP_DLS1),
- GE(GUID_DMUS_PROP_DLS2),
- GE(GUID_DMUS_PROP_Effects),
- GE(GUID_DMUS_PROP_INSTRUMENT2),
- GE(GUID_DMUS_PROP_LegacyCaps),
- GE(GUID_DMUS_PROP_MemorySize),
- GE(GUID_DMUS_PROP_SampleMemorySize),
- GE(GUID_DMUS_PROP_SamplePlaybackRate),
- GE(GUID_DMUS_PROP_SetSynthSink),
- GE(GUID_DMUS_PROP_SinkUsesDSound),
- GE(GUID_DMUS_PROP_SynthSink_DSOUND),
- GE(GUID_DMUS_PROP_SynthSink_WAVE),
- GE(GUID_DMUS_PROP_Volume),
- GE(GUID_DMUS_PROP_WavesReverb),
- GE(GUID_DMUS_PROP_WriteLatency),
- GE(GUID_DMUS_PROP_WritePeriod),
- GE(GUID_DMUS_PROP_XG_Capable),
- GE(GUID_DMUS_PROP_XG_Hardware)
- };
-
- unsigned int i;
-
- if (!id) return "(null)";
-
- for (i = 0; i < ARRAY_SIZE(guids); i++) {
- if (IsEqualGUID(id, guids[i].guid))
- return guids[i].name;
- }
- /* if we didn't find it, act like standard debugstr_guid */
- return debugstr_guid(id);
-}
-
-/* generic flag-dumping function */
-static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){
- char buffer[128] = "", *ptr = &buffer[0];
- unsigned int i;
- int size = sizeof(buffer);
-
- for (i=0; i < num_names; i++)
- {
- if ((flags & names[i].val) || /* standard flag*/
- ((!flags) && (!names[i].val))) { /* zero value only */
- int cnt = snprintf(ptr, size, "%s ", names[i].name);
- if (cnt < 0 || cnt >= size) break;
- size -= cnt;
- ptr += cnt;
- }
- }
-
- return wine_dbg_sprintf("%s", buffer);
-}
-
-/* dump DMUS_OBJ flags */
-static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) {
- static const flag_info flags[] = {
- FE(DMUS_OBJ_OBJECT),
- FE(DMUS_OBJ_CLASS),
- FE(DMUS_OBJ_NAME),
- FE(DMUS_OBJ_CATEGORY),
- FE(DMUS_OBJ_FILENAME),
- FE(DMUS_OBJ_FULLPATH),
- FE(DMUS_OBJ_URL),
- FE(DMUS_OBJ_VERSION),
- FE(DMUS_OBJ_DATE),
- FE(DMUS_OBJ_LOADED),
- FE(DMUS_OBJ_MEMORY),
- FE(DMUS_OBJ_STREAM)
- };
- return debugstr_flags(flagmask, flags, ARRAY_SIZE(flags));
-}
-
-/* dump whole DMUS_OBJECTDESC struct */
-const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) {
- if (pDesc) {
- char buffer[1024] = "", *ptr = &buffer[0];
-
- ptr += sprintf(ptr, "DMUS_OBJECTDESC (%p):\n", pDesc);
- ptr += sprintf(ptr, " - dwSize = %d\n", pDesc->dwSize);
- ptr += sprintf(ptr, " - dwValidData = %s\n", 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 = FIXME\n");
- 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 - pbMemData = %p\n",
- wine_dbgstr_longlong(pDesc->llMemLength), pDesc->pbMemData);
- if (pDesc->dwValidData & DMUS_OBJ_STREAM) ptr += sprintf(ptr, " - pStream = %p", pDesc->pStream);
-
- return wine_dbg_sprintf("%s", buffer);
- } else {
- return wine_dbg_sprintf("(NULL)");
- }
-}
diff --git a/dlls/dmcompos/dmcompos_private.h b/dlls/dmcompos/dmcompos_private.h
index 1958c27378..98796875b8 100644
--- a/dlls/dmcompos/dmcompos_private.h
+++ b/dlls/dmcompos/dmcompos_private.h
@@ -65,26 +65,4 @@ typedef struct _DMUS_PRIVATE_CHUNK {
DWORD dwSize; /* size of the chunk */
} DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK;
-/* used for generic dumping (copied from ddraw) */
-typedef struct {
- DWORD val;
- const char* name;
-} flag_info;
-
-typedef struct {
- const GUID *guid;
- const char* name;
-} guid_info;
-
-/* used for initialising structs (primarily for DMUS_OBJECTDESC) */
-#define FE(x) { x, #x }
-#define GE(x) { &x, #x }
-
-/* FOURCC to string conversion for debug messages */
-extern const char *debugstr_fourcc (DWORD fourcc) DECLSPEC_HIDDEN;
-/* returns name of given GUID */
-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;
-
#endif /* __WINE_DMCOMPOS_PRIVATE_H */
diff --git a/dlls/dmcompos/dmobject.c b/dlls/dmcompos/dmobject.c
index 25f3198d2b..9ea31ab32a 100644
--- a/dlls/dmcompos/dmobject.c
+++ b/dlls/dmcompos/dmobject.c
@@ -25,22 +25,257 @@
#include "objbase.h"
#include "dmusici.h"
#include "dmusicf.h"
+#include "dmusics.h"
#include "dmobject.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmobj);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
-/* RIFF format parsing */
-#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+/* Debugging helpers */
+const char *debugstr_dmguid(const GUID *id) {
+ unsigned int i;
+#define X(guid) { &guid, #guid }
+ static const struct {
+ const GUID *guid;
+ const char *name;
+ } guids[] = {
+ /* CLSIDs */
+ X(CLSID_AudioVBScript),
+ X(CLSID_DirectMusic),
+ X(CLSID_DirectMusicAudioPathConfig),
+ X(CLSID_DirectMusicAuditionTrack),
+ X(CLSID_DirectMusicBand),
+ X(CLSID_DirectMusicBandTrack),
+ X(CLSID_DirectMusicChordMapTrack),
+ X(CLSID_DirectMusicChordMap),
+ X(CLSID_DirectMusicChordTrack),
+ X(CLSID_DirectMusicCollection),
+ X(CLSID_DirectMusicCommandTrack),
+ X(CLSID_DirectMusicComposer),
+ X(CLSID_DirectMusicContainer),
+ X(CLSID_DirectMusicGraph),
+ X(CLSID_DirectMusicLoader),
+ X(CLSID_DirectMusicLyricsTrack),
+ X(CLSID_DirectMusicMarkerTrack),
+ X(CLSID_DirectMusicMelodyFormulationTrack),
+ X(CLSID_DirectMusicMotifTrack),
+ X(CLSID_DirectMusicMuteTrack),
+ X(CLSID_DirectMusicParamControlTrack),
+ X(CLSID_DirectMusicPatternTrack),
+ X(CLSID_DirectMusicPerformance),
+ X(CLSID_DirectMusicScript),
+ X(CLSID_DirectMusicScriptAutoImpSegment),
+ X(CLSID_DirectMusicScriptAutoImpPerformance),
+ X(CLSID_DirectMusicScriptAutoImpSegmentState),
+ X(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
+ X(CLSID_DirectMusicScriptAutoImpAudioPath),
+ X(CLSID_DirectMusicScriptAutoImpSong),
+ X(CLSID_DirectMusicScriptSourceCodeLoader),
+ X(CLSID_DirectMusicScriptTrack),
+ X(CLSID_DirectMusicSection),
+ X(CLSID_DirectMusicSegment),
+ X(CLSID_DirectMusicSegmentState),
+ X(CLSID_DirectMusicSegmentTriggerTrack),
+ X(CLSID_DirectMusicSegTriggerTrack),
+ X(CLSID_DirectMusicSeqTrack),
+ X(CLSID_DirectMusicSignPostTrack),
+ X(CLSID_DirectMusicSong),
+ X(CLSID_DirectMusicStyle),
+ X(CLSID_DirectMusicStyleTrack),
+ X(CLSID_DirectMusicSynth),
+ X(CLSID_DirectMusicSynthSink),
+ X(CLSID_DirectMusicSysExTrack),
+ X(CLSID_DirectMusicTemplate),
+ X(CLSID_DirectMusicTempoTrack),
+ X(CLSID_DirectMusicTimeSigTrack),
+ X(CLSID_DirectMusicWaveTrack),
+ X(CLSID_DirectSoundWave),
+ /* IIDs */
+ X(IID_IDirectMusic),
+ X(IID_IDirectMusic2),
+ X(IID_IDirectMusic8),
+ X(IID_IDirectMusicAudioPath),
+ X(IID_IDirectMusicBand),
+ X(IID_IDirectMusicBuffer),
+ X(IID_IDirectMusicChordMap),
+ X(IID_IDirectMusicCollection),
+ X(IID_IDirectMusicComposer),
+ X(IID_IDirectMusicContainer),
+ X(IID_IDirectMusicDownload),
+ X(IID_IDirectMusicDownloadedInstrument),
+ X(IID_IDirectMusicGetLoader),
+ X(IID_IDirectMusicGraph),
+ X(IID_IDirectMusicInstrument),
+ X(IID_IDirectMusicLoader),
+ X(IID_IDirectMusicLoader8),
+ X(IID_IDirectMusicObject),
+ X(IID_IDirectMusicPatternTrack),
+ X(IID_IDirectMusicPerformance),
+ X(IID_IDirectMusicPerformance2),
+ X(IID_IDirectMusicPerformance8),
+ X(IID_IDirectMusicPort),
+ X(IID_IDirectMusicPortDownload),
+ X(IID_IDirectMusicScript),
+ X(IID_IDirectMusicSegment),
+ X(IID_IDirectMusicSegment2),
+ X(IID_IDirectMusicSegment8),
+ X(IID_IDirectMusicSegmentState),
+ X(IID_IDirectMusicSegmentState8),
+ X(IID_IDirectMusicStyle),
+ X(IID_IDirectMusicStyle8),
+ X(IID_IDirectMusicSynth),
+ X(IID_IDirectMusicSynth8),
+ X(IID_IDirectMusicSynthSink),
+ X(IID_IDirectMusicThru),
+ X(IID_IDirectMusicTool),
+ X(IID_IDirectMusicTool8),
+ X(IID_IDirectMusicTrack),
+ X(IID_IDirectMusicTrack8),
+ X(IID_IUnknown),
+ X(IID_IPersistStream),
+ X(IID_IStream),
+ X(IID_IClassFactory),
+ /* GUIDs */
+ X(GUID_DirectMusicAllTypes),
+ X(GUID_NOTIFICATION_CHORD),
+ X(GUID_NOTIFICATION_COMMAND),
+ X(GUID_NOTIFICATION_MEASUREANDBEAT),
+ X(GUID_NOTIFICATION_PERFORMANCE),
+ X(GUID_NOTIFICATION_RECOMPOSE),
+ X(GUID_NOTIFICATION_SEGMENT),
+ X(GUID_BandParam),
+ X(GUID_ChordParam),
+ X(GUID_CommandParam),
+ X(GUID_CommandParam2),
+ X(GUID_CommandParamNext),
+ X(GUID_IDirectMusicBand),
+ X(GUID_IDirectMusicChordMap),
+ X(GUID_IDirectMusicStyle),
+ X(GUID_MuteParam),
+ X(GUID_Play_Marker),
+ X(GUID_RhythmParam),
+ X(GUID_TempoParam),
+ X(GUID_TimeSignature),
+ X(GUID_Valid_Start_Time),
+ X(GUID_Clear_All_Bands),
+ X(GUID_ConnectToDLSCollection),
+ X(GUID_Disable_Auto_Download),
+ X(GUID_DisableTempo),
+ X(GUID_DisableTimeSig),
+ X(GUID_Download),
+ X(GUID_DownloadToAudioPath),
+ X(GUID_Enable_Auto_Download),
+ X(GUID_EnableTempo),
+ X(GUID_EnableTimeSig),
+ X(GUID_IgnoreBankSelectForGM),
+ X(GUID_SeedVariations),
+ X(GUID_StandardMIDIFile),
+ X(GUID_Unload),
+ X(GUID_UnloadFromAudioPath),
+ X(GUID_Variations),
+ X(GUID_PerfMasterTempo),
+ X(GUID_PerfMasterVolume),
+ X(GUID_PerfMasterGrooveLevel),
+ X(GUID_PerfAutoDownload),
+ X(GUID_DefaultGMCollection),
+ X(GUID_Synth_Default),
+ X(GUID_Buffer_Reverb),
+ X(GUID_Buffer_EnvReverb),
+ X(GUID_Buffer_Stereo),
+ X(GUID_Buffer_3D_Dry),
+ X(GUID_Buffer_Mono),
+ X(GUID_DMUS_PROP_GM_Hardware),
+ X(GUID_DMUS_PROP_GS_Capable),
+ X(GUID_DMUS_PROP_GS_Hardware),
+ X(GUID_DMUS_PROP_DLS1),
+ X(GUID_DMUS_PROP_DLS2),
+ X(GUID_DMUS_PROP_Effects),
+ X(GUID_DMUS_PROP_INSTRUMENT2),
+ X(GUID_DMUS_PROP_LegacyCaps),
+ X(GUID_DMUS_PROP_MemorySize),
+ X(GUID_DMUS_PROP_SampleMemorySize),
+ X(GUID_DMUS_PROP_SamplePlaybackRate),
+ X(GUID_DMUS_PROP_SetSynthSink),
+ X(GUID_DMUS_PROP_SinkUsesDSound),
+ X(GUID_DMUS_PROP_SynthSink_DSOUND),
+ X(GUID_DMUS_PROP_SynthSink_WAVE),
+ X(GUID_DMUS_PROP_Volume),
+ X(GUID_DMUS_PROP_WavesReverb),
+ X(GUID_DMUS_PROP_WriteLatency),
+ X(GUID_DMUS_PROP_WritePeriod),
+ X(GUID_DMUS_PROP_XG_Capable),
+ X(GUID_DMUS_PROP_XG_Hardware)
+ };
+#undef X
+
+ if (!id)
+ return "(null)";
+
+ for (i = 0; i < ARRAY_SIZE(guids); i++)
+ if (IsEqualGUID(id, guids[i].guid))
+ return guids[i].name;
+
+ return debugstr_guid(id);
+}
-static inline const char *debugstr_fourcc(DWORD fourcc)
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc)
{
- if (!fourcc) return "''";
- return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
+ if (!desc || !TRACE_ON(dmfile))
+ return;
+
+ TRACE_(dmfile)("DMUS_OBJECTDESC (%p):", desc);
+ TRACE_(dmfile)(" - dwSize = %u\n", desc->dwSize);
+
+#define X(flag) if (desc->dwValidData & flag) TRACE_(dmfile)(#flag " ")
+ TRACE_(dmfile)(" - dwValidData = %#08x ( ", desc->dwValidData);
+ X(DMUS_OBJ_OBJECT);
+ X(DMUS_OBJ_CLASS);
+ X(DMUS_OBJ_NAME);
+ X(DMUS_OBJ_CATEGORY);
+ X(DMUS_OBJ_FILENAME);
+ X(DMUS_OBJ_FULLPATH);
+ X(DMUS_OBJ_URL);
+ X(DMUS_OBJ_VERSION);
+ X(DMUS_OBJ_DATE);
+ X(DMUS_OBJ_LOADED);
+ X(DMUS_OBJ_MEMORY);
+ X(DMUS_OBJ_STREAM);
+ TRACE_(dmfile)(")\n");
+#undef X
+
+ if (desc->dwValidData & DMUS_OBJ_CLASS)
+ TRACE_(dmfile)(" - guidClass = %s\n", debugstr_dmguid(&desc->guidClass));
+ if (desc->dwValidData & DMUS_OBJ_OBJECT)
+ TRACE_(dmfile)(" - guidObject = %s\n", debugstr_guid(&desc->guidObject));
+
+ if (desc->dwValidData & DMUS_OBJ_DATE) {
+ SYSTEMTIME time;
+ FileTimeToSystemTime(&desc->ftDate, &time);
+ TRACE_(dmfile)(" - ftDate = \'%04u-%02u-%02u %02u:%02u:%02u\'\n",
+ time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond);
+ }
+ if (desc->dwValidData & DMUS_OBJ_VERSION)
+ TRACE_(dmfile)(" - vVersion = \'%u,%u,%u,%u\'\n",
+ HIWORD(desc->vVersion.dwVersionMS), LOWORD(desc->vVersion.dwVersionMS),
+ HIWORD(desc->vVersion.dwVersionLS), LOWORD(desc->vVersion.dwVersionLS));
+ if (desc->dwValidData & DMUS_OBJ_NAME)
+ TRACE_(dmfile)(" - wszName = %s\n", debugstr_w(desc->wszName));
+ if (desc->dwValidData & DMUS_OBJ_CATEGORY)
+ TRACE_(dmfile)(" - wszCategory = %s\n", debugstr_w(desc->wszCategory));
+ if (desc->dwValidData & DMUS_OBJ_FILENAME)
+ TRACE_(dmfile)(" - wszFileName = %s\n", debugstr_w(desc->wszFileName));
+ if (desc->dwValidData & DMUS_OBJ_MEMORY)
+ TRACE_(dmfile)(" - llMemLength = 0x%s - pbMemData = %p\n",
+ wine_dbgstr_longlong(desc->llMemLength), desc->pbMemData);
+ if (desc->dwValidData & DMUS_OBJ_STREAM)
+ TRACE_(dmfile)(" - pStream = %p\n", desc->pStream);
}
+
+/* RIFF format parsing */
+#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+
const char *debugstr_chunk(const struct chunk_entry *chunk)
{
const char *type = "";
diff --git a/dlls/dmcompos/dmobject.h b/dlls/dmcompos/dmobject.h
index 4a721cc152..d347020691 100644
--- a/dlls/dmcompos/dmobject.h
+++ b/dlls/dmcompos/dmobject.h
@@ -60,8 +60,6 @@ static inline HRESULT stream_reset_chunk_start(IStream *stream, const struct chu
return IStream_Seek(stream, offset, STREAM_SEEK_SET, NULL);
}
-const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
-
/* IDirectMusicObject base object */
struct dmobject {
@@ -106,3 +104,15 @@ HRESULT WINAPI unimpl_IPersistStream_Save(IPersistStream *iface, IStream *stream
BOOL clear_dirty) DECLSPEC_HIDDEN;
HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface,
ULARGE_INTEGER *size) DECLSPEC_HIDDEN;
+
+/* Debugging helpers */
+const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+const char *debugstr_dmguid(const GUID *id) DECLSPEC_HIDDEN;
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN;
+
+static inline const char *debugstr_fourcc(DWORD fourcc)
+{
+ if (!fourcc) return "''";
+ return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
+ (char)(fourcc >> 16), (char)(fourcc >> 24));
+}
--
2.23.0
1
0
[PATCH 8/9] dmime: Use the debug functions provided by dmobject.[ch]
by Michael Stefaniuc 12 Dec '19
by Michael Stefaniuc 12 Dec '19
12 Dec '19
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmime/dmime_main.c | 1 +
dlls/dmime/dmobject.c | 247 ++++++++++++++++++++++++++++++-
dlls/dmime/dmobject.h | 14 +-
dlls/dmime/dmutils.c | 302 +-------------------------------------
dlls/dmime/dmutils.h | 26 ----
dlls/dmime/performance.c | 1 +
dlls/dmime/segmentstate.c | 1 +
7 files changed, 257 insertions(+), 335 deletions(-)
diff --git a/dlls/dmime/dmime_main.c b/dlls/dmime/dmime_main.c
index 37302ff0eb..1749bbe69d 100644
--- a/dlls/dmime/dmime_main.c
+++ b/dlls/dmime/dmime_main.c
@@ -34,6 +34,7 @@
#include "dmusici.h"
#include "dmime_private.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
diff --git a/dlls/dmime/dmobject.c b/dlls/dmime/dmobject.c
index 25f3198d2b..9ea31ab32a 100644
--- a/dlls/dmime/dmobject.c
+++ b/dlls/dmime/dmobject.c
@@ -25,22 +25,257 @@
#include "objbase.h"
#include "dmusici.h"
#include "dmusicf.h"
+#include "dmusics.h"
#include "dmobject.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmobj);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
-/* RIFF format parsing */
-#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+/* Debugging helpers */
+const char *debugstr_dmguid(const GUID *id) {
+ unsigned int i;
+#define X(guid) { &guid, #guid }
+ static const struct {
+ const GUID *guid;
+ const char *name;
+ } guids[] = {
+ /* CLSIDs */
+ X(CLSID_AudioVBScript),
+ X(CLSID_DirectMusic),
+ X(CLSID_DirectMusicAudioPathConfig),
+ X(CLSID_DirectMusicAuditionTrack),
+ X(CLSID_DirectMusicBand),
+ X(CLSID_DirectMusicBandTrack),
+ X(CLSID_DirectMusicChordMapTrack),
+ X(CLSID_DirectMusicChordMap),
+ X(CLSID_DirectMusicChordTrack),
+ X(CLSID_DirectMusicCollection),
+ X(CLSID_DirectMusicCommandTrack),
+ X(CLSID_DirectMusicComposer),
+ X(CLSID_DirectMusicContainer),
+ X(CLSID_DirectMusicGraph),
+ X(CLSID_DirectMusicLoader),
+ X(CLSID_DirectMusicLyricsTrack),
+ X(CLSID_DirectMusicMarkerTrack),
+ X(CLSID_DirectMusicMelodyFormulationTrack),
+ X(CLSID_DirectMusicMotifTrack),
+ X(CLSID_DirectMusicMuteTrack),
+ X(CLSID_DirectMusicParamControlTrack),
+ X(CLSID_DirectMusicPatternTrack),
+ X(CLSID_DirectMusicPerformance),
+ X(CLSID_DirectMusicScript),
+ X(CLSID_DirectMusicScriptAutoImpSegment),
+ X(CLSID_DirectMusicScriptAutoImpPerformance),
+ X(CLSID_DirectMusicScriptAutoImpSegmentState),
+ X(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
+ X(CLSID_DirectMusicScriptAutoImpAudioPath),
+ X(CLSID_DirectMusicScriptAutoImpSong),
+ X(CLSID_DirectMusicScriptSourceCodeLoader),
+ X(CLSID_DirectMusicScriptTrack),
+ X(CLSID_DirectMusicSection),
+ X(CLSID_DirectMusicSegment),
+ X(CLSID_DirectMusicSegmentState),
+ X(CLSID_DirectMusicSegmentTriggerTrack),
+ X(CLSID_DirectMusicSegTriggerTrack),
+ X(CLSID_DirectMusicSeqTrack),
+ X(CLSID_DirectMusicSignPostTrack),
+ X(CLSID_DirectMusicSong),
+ X(CLSID_DirectMusicStyle),
+ X(CLSID_DirectMusicStyleTrack),
+ X(CLSID_DirectMusicSynth),
+ X(CLSID_DirectMusicSynthSink),
+ X(CLSID_DirectMusicSysExTrack),
+ X(CLSID_DirectMusicTemplate),
+ X(CLSID_DirectMusicTempoTrack),
+ X(CLSID_DirectMusicTimeSigTrack),
+ X(CLSID_DirectMusicWaveTrack),
+ X(CLSID_DirectSoundWave),
+ /* IIDs */
+ X(IID_IDirectMusic),
+ X(IID_IDirectMusic2),
+ X(IID_IDirectMusic8),
+ X(IID_IDirectMusicAudioPath),
+ X(IID_IDirectMusicBand),
+ X(IID_IDirectMusicBuffer),
+ X(IID_IDirectMusicChordMap),
+ X(IID_IDirectMusicCollection),
+ X(IID_IDirectMusicComposer),
+ X(IID_IDirectMusicContainer),
+ X(IID_IDirectMusicDownload),
+ X(IID_IDirectMusicDownloadedInstrument),
+ X(IID_IDirectMusicGetLoader),
+ X(IID_IDirectMusicGraph),
+ X(IID_IDirectMusicInstrument),
+ X(IID_IDirectMusicLoader),
+ X(IID_IDirectMusicLoader8),
+ X(IID_IDirectMusicObject),
+ X(IID_IDirectMusicPatternTrack),
+ X(IID_IDirectMusicPerformance),
+ X(IID_IDirectMusicPerformance2),
+ X(IID_IDirectMusicPerformance8),
+ X(IID_IDirectMusicPort),
+ X(IID_IDirectMusicPortDownload),
+ X(IID_IDirectMusicScript),
+ X(IID_IDirectMusicSegment),
+ X(IID_IDirectMusicSegment2),
+ X(IID_IDirectMusicSegment8),
+ X(IID_IDirectMusicSegmentState),
+ X(IID_IDirectMusicSegmentState8),
+ X(IID_IDirectMusicStyle),
+ X(IID_IDirectMusicStyle8),
+ X(IID_IDirectMusicSynth),
+ X(IID_IDirectMusicSynth8),
+ X(IID_IDirectMusicSynthSink),
+ X(IID_IDirectMusicThru),
+ X(IID_IDirectMusicTool),
+ X(IID_IDirectMusicTool8),
+ X(IID_IDirectMusicTrack),
+ X(IID_IDirectMusicTrack8),
+ X(IID_IUnknown),
+ X(IID_IPersistStream),
+ X(IID_IStream),
+ X(IID_IClassFactory),
+ /* GUIDs */
+ X(GUID_DirectMusicAllTypes),
+ X(GUID_NOTIFICATION_CHORD),
+ X(GUID_NOTIFICATION_COMMAND),
+ X(GUID_NOTIFICATION_MEASUREANDBEAT),
+ X(GUID_NOTIFICATION_PERFORMANCE),
+ X(GUID_NOTIFICATION_RECOMPOSE),
+ X(GUID_NOTIFICATION_SEGMENT),
+ X(GUID_BandParam),
+ X(GUID_ChordParam),
+ X(GUID_CommandParam),
+ X(GUID_CommandParam2),
+ X(GUID_CommandParamNext),
+ X(GUID_IDirectMusicBand),
+ X(GUID_IDirectMusicChordMap),
+ X(GUID_IDirectMusicStyle),
+ X(GUID_MuteParam),
+ X(GUID_Play_Marker),
+ X(GUID_RhythmParam),
+ X(GUID_TempoParam),
+ X(GUID_TimeSignature),
+ X(GUID_Valid_Start_Time),
+ X(GUID_Clear_All_Bands),
+ X(GUID_ConnectToDLSCollection),
+ X(GUID_Disable_Auto_Download),
+ X(GUID_DisableTempo),
+ X(GUID_DisableTimeSig),
+ X(GUID_Download),
+ X(GUID_DownloadToAudioPath),
+ X(GUID_Enable_Auto_Download),
+ X(GUID_EnableTempo),
+ X(GUID_EnableTimeSig),
+ X(GUID_IgnoreBankSelectForGM),
+ X(GUID_SeedVariations),
+ X(GUID_StandardMIDIFile),
+ X(GUID_Unload),
+ X(GUID_UnloadFromAudioPath),
+ X(GUID_Variations),
+ X(GUID_PerfMasterTempo),
+ X(GUID_PerfMasterVolume),
+ X(GUID_PerfMasterGrooveLevel),
+ X(GUID_PerfAutoDownload),
+ X(GUID_DefaultGMCollection),
+ X(GUID_Synth_Default),
+ X(GUID_Buffer_Reverb),
+ X(GUID_Buffer_EnvReverb),
+ X(GUID_Buffer_Stereo),
+ X(GUID_Buffer_3D_Dry),
+ X(GUID_Buffer_Mono),
+ X(GUID_DMUS_PROP_GM_Hardware),
+ X(GUID_DMUS_PROP_GS_Capable),
+ X(GUID_DMUS_PROP_GS_Hardware),
+ X(GUID_DMUS_PROP_DLS1),
+ X(GUID_DMUS_PROP_DLS2),
+ X(GUID_DMUS_PROP_Effects),
+ X(GUID_DMUS_PROP_INSTRUMENT2),
+ X(GUID_DMUS_PROP_LegacyCaps),
+ X(GUID_DMUS_PROP_MemorySize),
+ X(GUID_DMUS_PROP_SampleMemorySize),
+ X(GUID_DMUS_PROP_SamplePlaybackRate),
+ X(GUID_DMUS_PROP_SetSynthSink),
+ X(GUID_DMUS_PROP_SinkUsesDSound),
+ X(GUID_DMUS_PROP_SynthSink_DSOUND),
+ X(GUID_DMUS_PROP_SynthSink_WAVE),
+ X(GUID_DMUS_PROP_Volume),
+ X(GUID_DMUS_PROP_WavesReverb),
+ X(GUID_DMUS_PROP_WriteLatency),
+ X(GUID_DMUS_PROP_WritePeriod),
+ X(GUID_DMUS_PROP_XG_Capable),
+ X(GUID_DMUS_PROP_XG_Hardware)
+ };
+#undef X
+
+ if (!id)
+ return "(null)";
+
+ for (i = 0; i < ARRAY_SIZE(guids); i++)
+ if (IsEqualGUID(id, guids[i].guid))
+ return guids[i].name;
+
+ return debugstr_guid(id);
+}
-static inline const char *debugstr_fourcc(DWORD fourcc)
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc)
{
- if (!fourcc) return "''";
- return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
+ if (!desc || !TRACE_ON(dmfile))
+ return;
+
+ TRACE_(dmfile)("DMUS_OBJECTDESC (%p):", desc);
+ TRACE_(dmfile)(" - dwSize = %u\n", desc->dwSize);
+
+#define X(flag) if (desc->dwValidData & flag) TRACE_(dmfile)(#flag " ")
+ TRACE_(dmfile)(" - dwValidData = %#08x ( ", desc->dwValidData);
+ X(DMUS_OBJ_OBJECT);
+ X(DMUS_OBJ_CLASS);
+ X(DMUS_OBJ_NAME);
+ X(DMUS_OBJ_CATEGORY);
+ X(DMUS_OBJ_FILENAME);
+ X(DMUS_OBJ_FULLPATH);
+ X(DMUS_OBJ_URL);
+ X(DMUS_OBJ_VERSION);
+ X(DMUS_OBJ_DATE);
+ X(DMUS_OBJ_LOADED);
+ X(DMUS_OBJ_MEMORY);
+ X(DMUS_OBJ_STREAM);
+ TRACE_(dmfile)(")\n");
+#undef X
+
+ if (desc->dwValidData & DMUS_OBJ_CLASS)
+ TRACE_(dmfile)(" - guidClass = %s\n", debugstr_dmguid(&desc->guidClass));
+ if (desc->dwValidData & DMUS_OBJ_OBJECT)
+ TRACE_(dmfile)(" - guidObject = %s\n", debugstr_guid(&desc->guidObject));
+
+ if (desc->dwValidData & DMUS_OBJ_DATE) {
+ SYSTEMTIME time;
+ FileTimeToSystemTime(&desc->ftDate, &time);
+ TRACE_(dmfile)(" - ftDate = \'%04u-%02u-%02u %02u:%02u:%02u\'\n",
+ time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond);
+ }
+ if (desc->dwValidData & DMUS_OBJ_VERSION)
+ TRACE_(dmfile)(" - vVersion = \'%u,%u,%u,%u\'\n",
+ HIWORD(desc->vVersion.dwVersionMS), LOWORD(desc->vVersion.dwVersionMS),
+ HIWORD(desc->vVersion.dwVersionLS), LOWORD(desc->vVersion.dwVersionLS));
+ if (desc->dwValidData & DMUS_OBJ_NAME)
+ TRACE_(dmfile)(" - wszName = %s\n", debugstr_w(desc->wszName));
+ if (desc->dwValidData & DMUS_OBJ_CATEGORY)
+ TRACE_(dmfile)(" - wszCategory = %s\n", debugstr_w(desc->wszCategory));
+ if (desc->dwValidData & DMUS_OBJ_FILENAME)
+ TRACE_(dmfile)(" - wszFileName = %s\n", debugstr_w(desc->wszFileName));
+ if (desc->dwValidData & DMUS_OBJ_MEMORY)
+ TRACE_(dmfile)(" - llMemLength = 0x%s - pbMemData = %p\n",
+ wine_dbgstr_longlong(desc->llMemLength), desc->pbMemData);
+ if (desc->dwValidData & DMUS_OBJ_STREAM)
+ TRACE_(dmfile)(" - pStream = %p\n", desc->pStream);
}
+
+/* RIFF format parsing */
+#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+
const char *debugstr_chunk(const struct chunk_entry *chunk)
{
const char *type = "";
diff --git a/dlls/dmime/dmobject.h b/dlls/dmime/dmobject.h
index 4a721cc152..d347020691 100644
--- a/dlls/dmime/dmobject.h
+++ b/dlls/dmime/dmobject.h
@@ -60,8 +60,6 @@ static inline HRESULT stream_reset_chunk_start(IStream *stream, const struct chu
return IStream_Seek(stream, offset, STREAM_SEEK_SET, NULL);
}
-const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
-
/* IDirectMusicObject base object */
struct dmobject {
@@ -106,3 +104,15 @@ HRESULT WINAPI unimpl_IPersistStream_Save(IPersistStream *iface, IStream *stream
BOOL clear_dirty) DECLSPEC_HIDDEN;
HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface,
ULARGE_INTEGER *size) DECLSPEC_HIDDEN;
+
+/* Debugging helpers */
+const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+const char *debugstr_dmguid(const GUID *id) DECLSPEC_HIDDEN;
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN;
+
+static inline const char *debugstr_fourcc(DWORD fourcc)
+{
+ if (!fourcc) return "''";
+ return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
+ (char)(fourcc >> 16), (char)(fourcc >> 24));
+}
diff --git a/dlls/dmime/dmutils.c b/dlls/dmime/dmutils.c
index cd955fd8a5..a61fd5a463 100644
--- a/dlls/dmime/dmutils.c
+++ b/dlls/dmime/dmutils.c
@@ -39,9 +39,9 @@
#include "dmusics.h"
#include "dmutils.h"
+#include "dmobject.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) {
@@ -161,303 +161,3 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface,
return hr;
}
-
-/* FOURCC to string conversion for debug messages */
-const char *debugstr_fourcc (DWORD fourcc) {
- if (!fourcc) return "'null'";
- return wine_dbg_sprintf ("\'%c%c%c%c\'",
- (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
-}
-
-/* DMUS_VERSION struct to string conversion for debug messages */
-static const char *debugstr_dmversion (const DMUS_VERSION *version) {
- if (!version) return "'null'";
- return wine_dbg_sprintf ("\'%i,%i,%i,%i\'",
- HIWORD(version->dwVersionMS),LOWORD(version->dwVersionMS),
- HIWORD(version->dwVersionLS), LOWORD(version->dwVersionLS));
-}
-
-/* month number into month name (for debugstr_filetime) */
-static const char *debugstr_month (DWORD dwMonth) {
- switch (dwMonth) {
- case 1: return "January";
- case 2: return "February";
- case 3: return "March";
- case 4: return "April";
- case 5: return "May";
- case 6: return "June";
- case 7: return "July";
- case 8: return "August";
- case 9: return "September";
- case 10: return "October";
- case 11: return "November";
- case 12: return "December";
- default: return "Invalid";
- }
-}
-
-/* FILETIME struct to string conversion for debug messages */
-static const char *debugstr_filetime (const FILETIME *time) {
- SYSTEMTIME sysTime;
-
- if (!time) return "'null'";
-
- FileTimeToSystemTime (time, &sysTime);
-
- return wine_dbg_sprintf ("\'%02i. %s %04i %02i:%02i:%02i\'",
- sysTime.wDay, debugstr_month(sysTime.wMonth), sysTime.wYear,
- sysTime.wHour, sysTime.wMinute, sysTime.wSecond);
-}
-
-/* returns name of given GUID */
-const char *debugstr_dmguid (const GUID *id) {
- static const guid_info guids[] = {
- /* CLSIDs */
- GE(CLSID_AudioVBScript),
- GE(CLSID_DirectMusic),
- GE(CLSID_DirectMusicAudioPathConfig),
- GE(CLSID_DirectMusicAuditionTrack),
- GE(CLSID_DirectMusicBand),
- GE(CLSID_DirectMusicBandTrack),
- GE(CLSID_DirectMusicChordMapTrack),
- GE(CLSID_DirectMusicChordMap),
- GE(CLSID_DirectMusicChordTrack),
- GE(CLSID_DirectMusicCollection),
- GE(CLSID_DirectMusicCommandTrack),
- GE(CLSID_DirectMusicComposer),
- GE(CLSID_DirectMusicContainer),
- GE(CLSID_DirectMusicGraph),
- GE(CLSID_DirectMusicLoader),
- GE(CLSID_DirectMusicLyricsTrack),
- GE(CLSID_DirectMusicMarkerTrack),
- GE(CLSID_DirectMusicMelodyFormulationTrack),
- GE(CLSID_DirectMusicMotifTrack),
- GE(CLSID_DirectMusicMuteTrack),
- GE(CLSID_DirectMusicParamControlTrack),
- GE(CLSID_DirectMusicPatternTrack),
- GE(CLSID_DirectMusicPerformance),
- GE(CLSID_DirectMusicScript),
- GE(CLSID_DirectMusicScriptAutoImpSegment),
- GE(CLSID_DirectMusicScriptAutoImpPerformance),
- GE(CLSID_DirectMusicScriptAutoImpSegmentState),
- GE(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
- GE(CLSID_DirectMusicScriptAutoImpAudioPath),
- GE(CLSID_DirectMusicScriptAutoImpSong),
- GE(CLSID_DirectMusicScriptSourceCodeLoader),
- GE(CLSID_DirectMusicScriptTrack),
- GE(CLSID_DirectMusicSection),
- GE(CLSID_DirectMusicSegment),
- GE(CLSID_DirectMusicSegmentState),
- GE(CLSID_DirectMusicSegmentTriggerTrack),
- GE(CLSID_DirectMusicSegTriggerTrack),
- GE(CLSID_DirectMusicSeqTrack),
- GE(CLSID_DirectMusicSignPostTrack),
- GE(CLSID_DirectMusicSong),
- GE(CLSID_DirectMusicStyle),
- GE(CLSID_DirectMusicStyleTrack),
- GE(CLSID_DirectMusicSynth),
- GE(CLSID_DirectMusicSynthSink),
- GE(CLSID_DirectMusicSysExTrack),
- GE(CLSID_DirectMusicTemplate),
- GE(CLSID_DirectMusicTempoTrack),
- GE(CLSID_DirectMusicTimeSigTrack),
- GE(CLSID_DirectMusicWaveTrack),
- GE(CLSID_DirectSoundWave),
- /* IIDs */
- GE(IID_IDirectMusic),
- GE(IID_IDirectMusic2),
- GE(IID_IDirectMusic8),
- GE(IID_IDirectMusicAudioPath),
- GE(IID_IDirectMusicBand),
- GE(IID_IDirectMusicBuffer),
- GE(IID_IDirectMusicChordMap),
- GE(IID_IDirectMusicCollection),
- GE(IID_IDirectMusicComposer),
- GE(IID_IDirectMusicContainer),
- GE(IID_IDirectMusicDownload),
- GE(IID_IDirectMusicDownloadedInstrument),
- GE(IID_IDirectMusicGetLoader),
- GE(IID_IDirectMusicGraph),
- GE(IID_IDirectMusicInstrument),
- GE(IID_IDirectMusicLoader),
- GE(IID_IDirectMusicLoader8),
- GE(IID_IDirectMusicObject),
- GE(IID_IDirectMusicPatternTrack),
- GE(IID_IDirectMusicPerformance),
- GE(IID_IDirectMusicPerformance2),
- GE(IID_IDirectMusicPerformance8),
- GE(IID_IDirectMusicPort),
- GE(IID_IDirectMusicPortDownload),
- GE(IID_IDirectMusicScript),
- GE(IID_IDirectMusicSegment),
- GE(IID_IDirectMusicSegment2),
- GE(IID_IDirectMusicSegment8),
- GE(IID_IDirectMusicSegmentState),
- GE(IID_IDirectMusicSegmentState8),
- GE(IID_IDirectMusicStyle),
- GE(IID_IDirectMusicStyle8),
- GE(IID_IDirectMusicSynth),
- GE(IID_IDirectMusicSynth8),
- GE(IID_IDirectMusicSynthSink),
- GE(IID_IDirectMusicThru),
- GE(IID_IDirectMusicTool),
- GE(IID_IDirectMusicTool8),
- GE(IID_IDirectMusicTrack),
- GE(IID_IDirectMusicTrack8),
- GE(IID_IUnknown),
- GE(IID_IPersistStream),
- GE(IID_IStream),
- GE(IID_IClassFactory),
- /* GUIDs */
- GE(GUID_DirectMusicAllTypes),
- GE(GUID_NOTIFICATION_CHORD),
- GE(GUID_NOTIFICATION_COMMAND),
- GE(GUID_NOTIFICATION_MEASUREANDBEAT),
- GE(GUID_NOTIFICATION_PERFORMANCE),
- GE(GUID_NOTIFICATION_RECOMPOSE),
- GE(GUID_NOTIFICATION_SEGMENT),
- GE(GUID_BandParam),
- GE(GUID_ChordParam),
- GE(GUID_CommandParam),
- GE(GUID_CommandParam2),
- GE(GUID_CommandParamNext),
- GE(GUID_IDirectMusicBand),
- GE(GUID_IDirectMusicChordMap),
- GE(GUID_IDirectMusicStyle),
- GE(GUID_MuteParam),
- GE(GUID_Play_Marker),
- GE(GUID_RhythmParam),
- GE(GUID_TempoParam),
- GE(GUID_TimeSignature),
- GE(GUID_Valid_Start_Time),
- GE(GUID_Clear_All_Bands),
- GE(GUID_ConnectToDLSCollection),
- GE(GUID_Disable_Auto_Download),
- GE(GUID_DisableTempo),
- GE(GUID_DisableTimeSig),
- GE(GUID_Download),
- GE(GUID_DownloadToAudioPath),
- GE(GUID_Enable_Auto_Download),
- GE(GUID_EnableTempo),
- GE(GUID_EnableTimeSig),
- GE(GUID_IgnoreBankSelectForGM),
- GE(GUID_SeedVariations),
- GE(GUID_StandardMIDIFile),
- GE(GUID_Unload),
- GE(GUID_UnloadFromAudioPath),
- GE(GUID_Variations),
- GE(GUID_PerfMasterTempo),
- GE(GUID_PerfMasterVolume),
- GE(GUID_PerfMasterGrooveLevel),
- GE(GUID_PerfAutoDownload),
- GE(GUID_DefaultGMCollection),
- GE(GUID_Synth_Default),
- GE(GUID_Buffer_Reverb),
- GE(GUID_Buffer_EnvReverb),
- GE(GUID_Buffer_Stereo),
- GE(GUID_Buffer_3D_Dry),
- GE(GUID_Buffer_Mono),
- GE(GUID_DMUS_PROP_GM_Hardware),
- GE(GUID_DMUS_PROP_GS_Capable),
- GE(GUID_DMUS_PROP_GS_Hardware),
- GE(GUID_DMUS_PROP_DLS1),
- GE(GUID_DMUS_PROP_DLS2),
- GE(GUID_DMUS_PROP_Effects),
- GE(GUID_DMUS_PROP_INSTRUMENT2),
- GE(GUID_DMUS_PROP_LegacyCaps),
- GE(GUID_DMUS_PROP_MemorySize),
- GE(GUID_DMUS_PROP_SampleMemorySize),
- GE(GUID_DMUS_PROP_SamplePlaybackRate),
- GE(GUID_DMUS_PROP_SetSynthSink),
- GE(GUID_DMUS_PROP_SinkUsesDSound),
- GE(GUID_DMUS_PROP_SynthSink_DSOUND),
- GE(GUID_DMUS_PROP_SynthSink_WAVE),
- GE(GUID_DMUS_PROP_Volume),
- GE(GUID_DMUS_PROP_WavesReverb),
- GE(GUID_DMUS_PROP_WriteLatency),
- GE(GUID_DMUS_PROP_WritePeriod),
- GE(GUID_DMUS_PROP_XG_Capable),
- GE(GUID_DMUS_PROP_XG_Hardware)
- };
-
- unsigned int i;
-
- if (!id) return "(null)";
- for (i = 0; i < ARRAY_SIZE(guids); i++) {
- if (IsEqualGUID(id, guids[i].guid))
- return guids[i].name;
- }
-
- /* if we didn't find it, act like standard debugstr_guid */
- return debugstr_guid(id);
-}
-
-/* generic flag-dumping function */
-static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){
- static char buffer[128] = "", *ptr = &buffer[0];
- unsigned int i;
- int size = sizeof(buffer);
-
- for (i=0; i < num_names; i++) {
- if ((flags & names[i].val)) {
- int cnt = snprintf(ptr, size, "%s ", names[i].name);
- if (cnt < 0 || cnt >= size) break;
- size -= cnt;
- ptr += cnt;
- }
- }
-
- ptr = &buffer[0];
- return ptr;
-}
-
-/* dump DMUS_OBJ flags */
-static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) {
- static const flag_info flags[] = {
- FE(DMUS_OBJ_OBJECT),
- FE(DMUS_OBJ_CLASS),
- FE(DMUS_OBJ_NAME),
- FE(DMUS_OBJ_CATEGORY),
- FE(DMUS_OBJ_FILENAME),
- FE(DMUS_OBJ_FULLPATH),
- FE(DMUS_OBJ_URL),
- FE(DMUS_OBJ_VERSION),
- FE(DMUS_OBJ_DATE),
- FE(DMUS_OBJ_LOADED),
- FE(DMUS_OBJ_MEMORY),
- FE(DMUS_OBJ_STREAM)
- };
- return debugstr_flags(flagmask, flags, ARRAY_SIZE(flags));
-}
-
-void dump_DMUS_OBJECTDESC(DMUS_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 - 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 7242746031..913bccfabd 100644
--- a/dlls/dmime/dmutils.h
+++ b/dlls/dmime/dmutils.h
@@ -32,30 +32,4 @@ typedef struct _DMUS_PRIVATE_CHUNK {
*/
extern HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface, DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, IDirectMusicObject** ppObject) DECLSPEC_HIDDEN;
-/**
- * Debug utilities
- */
-/* used for generic dumping (copied from ddraw) */
-typedef struct {
- DWORD val;
- const char* name;
-} flag_info;
-
-typedef struct {
- const GUID *guid;
- const char* name;
-} guid_info;
-
-/* used for initialising structs */
-#define FE(x) { x, #x }
-#define GE(x) { &x, #x }
-
-/* FOURCC to string conversion for debug messages */
-extern const char *debugstr_fourcc (DWORD fourcc) DECLSPEC_HIDDEN;
-/* returns name of given GUID */
-extern const char *debugstr_dmguid (const GUID *id) DECLSPEC_HIDDEN;
-
-/* dump whole DMUS_OBJECTDESC struct */
-void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *pDesc) DECLSPEC_HIDDEN;
-
#endif /* __WINE_DMUTILS_H */
diff --git a/dlls/dmime/performance.c b/dlls/dmime/performance.c
index 399b9b9919..615a3f8b14 100644
--- a/dlls/dmime/performance.c
+++ b/dlls/dmime/performance.c
@@ -19,6 +19,7 @@
*/
#include "dmime_private.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
diff --git a/dlls/dmime/segmentstate.c b/dlls/dmime/segmentstate.c
index b1b176ca5c..edd7ed70f0 100644
--- a/dlls/dmime/segmentstate.c
+++ b/dlls/dmime/segmentstate.c
@@ -18,6 +18,7 @@
*/
#include "dmime_private.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
--
2.23.0
1
0
[PATCH 7/9] dmloader: Use the debug functions provided by dmobject.[ch]
by Michael Stefaniuc 12 Dec '19
by Michael Stefaniuc 12 Dec '19
12 Dec '19
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmloader/container.c | 1 -
dlls/dmloader/debug.c | 270 -------------------------------
dlls/dmloader/debug.h | 16 --
dlls/dmloader/dmloader_private.h | 1 +
dlls/dmloader/dmobject.c | 247 +++++++++++++++++++++++++++-
dlls/dmloader/dmobject.h | 14 +-
6 files changed, 254 insertions(+), 295 deletions(-)
diff --git a/dlls/dmloader/container.c b/dlls/dmloader/container.c
index 075843ad32..005f0d7e9e 100644
--- a/dlls/dmloader/container.c
+++ b/dlls/dmloader/container.c
@@ -18,7 +18,6 @@
*/
#include "dmloader_private.h"
-#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmloader);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
diff --git a/dlls/dmloader/debug.c b/dlls/dmloader/debug.c
index 10ba0bce93..0d274394aa 100644
--- a/dlls/dmloader/debug.c
+++ b/dlls/dmloader/debug.c
@@ -20,8 +20,6 @@
#include "dmloader_private.h"
-WINE_DEFAULT_DEBUG_CHANNEL(dmloader);
-
/* figures out whether given FOURCC is valid DirectMusic form ID */
BOOL IS_VALID_DMFORM (FOURCC chunkID) {
if ((chunkID == DMUS_FOURCC_AUDIOPATH_FORM) || (chunkID == DMUS_FOURCC_BAND_FORM) || (chunkID == DMUS_FOURCC_CHORDMAP_FORM)
@@ -45,237 +43,6 @@ const char *resolve_STREAM_SEEK (DWORD flag) {
}
}
-/* FOURCC to string conversion for debug messages */
-const char *debugstr_fourcc (DWORD fourcc) {
- if (!fourcc) return "'null'";
- return wine_dbg_sprintf ("\'%c%c%c%c\'",
- (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
-}
-
-/* DMUS_VERSION struct to string conversion for debug messages */
-const char *debugstr_dmversion (const DMUS_VERSION *version) {
- if (!version) return "'null'";
- return wine_dbg_sprintf ("\'%i,%i,%i,%i\'",
- HIWORD(version->dwVersionMS),LOWORD(version->dwVersionMS),
- HIWORD(version->dwVersionLS), LOWORD(version->dwVersionLS));
-}
-
-/* month number into month name (for debugstr_filetime) */
-static const char *debugstr_month (DWORD dwMonth) {
- switch (dwMonth) {
- case 1: return "January";
- case 2: return "February";
- case 3: return "March";
- case 4: return "April";
- case 5: return "May";
- case 6: return "June";
- case 7: return "July";
- case 8: return "August";
- case 9: return "September";
- case 10: return "October";
- case 11: return "November";
- case 12: return "December";
- default: return "Invalid";
- }
-}
-
-/* FILETIME struct to string conversion for debug messages */
-const char *debugstr_filetime (const FILETIME *time) {
- SYSTEMTIME sysTime;
-
- if (!time) return "'null'";
-
- FileTimeToSystemTime (time, &sysTime);
-
- return wine_dbg_sprintf ("\'%02i. %s %04i %02i:%02i:%02i\'",
- sysTime.wDay, debugstr_month(sysTime.wMonth), sysTime.wYear,
- sysTime.wHour, sysTime.wMinute, sysTime.wSecond);
-}
-
-/* returns name of given GUID */
-const char *debugstr_dmguid (const GUID *id) {
- static const guid_info guids[] = {
- /* CLSIDs */
- GE(CLSID_AudioVBScript),
- GE(CLSID_DirectMusic),
- GE(CLSID_DirectMusicAudioPathConfig),
- GE(CLSID_DirectMusicAuditionTrack),
- GE(CLSID_DirectMusicBand),
- GE(CLSID_DirectMusicBandTrack),
- GE(CLSID_DirectMusicChordMapTrack),
- GE(CLSID_DirectMusicChordMap),
- GE(CLSID_DirectMusicChordTrack),
- GE(CLSID_DirectMusicCollection),
- GE(CLSID_DirectMusicCommandTrack),
- GE(CLSID_DirectMusicComposer),
- GE(CLSID_DirectMusicContainer),
- GE(CLSID_DirectMusicGraph),
- GE(CLSID_DirectMusicLoader),
- GE(CLSID_DirectMusicLyricsTrack),
- GE(CLSID_DirectMusicMarkerTrack),
- GE(CLSID_DirectMusicMelodyFormulationTrack),
- GE(CLSID_DirectMusicMotifTrack),
- GE(CLSID_DirectMusicMuteTrack),
- GE(CLSID_DirectMusicParamControlTrack),
- GE(CLSID_DirectMusicPatternTrack),
- GE(CLSID_DirectMusicPerformance),
- GE(CLSID_DirectMusicScript),
- GE(CLSID_DirectMusicScriptAutoImpSegment),
- GE(CLSID_DirectMusicScriptAutoImpPerformance),
- GE(CLSID_DirectMusicScriptAutoImpSegmentState),
- GE(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
- GE(CLSID_DirectMusicScriptAutoImpAudioPath),
- GE(CLSID_DirectMusicScriptAutoImpSong),
- GE(CLSID_DirectMusicScriptSourceCodeLoader),
- GE(CLSID_DirectMusicScriptTrack),
- GE(CLSID_DirectMusicSection),
- GE(CLSID_DirectMusicSegment),
- GE(CLSID_DirectMusicSegmentState),
- GE(CLSID_DirectMusicSegmentTriggerTrack),
- GE(CLSID_DirectMusicSegTriggerTrack),
- GE(CLSID_DirectMusicSeqTrack),
- GE(CLSID_DirectMusicSignPostTrack),
- GE(CLSID_DirectMusicSong),
- GE(CLSID_DirectMusicStyle),
- GE(CLSID_DirectMusicStyleTrack),
- GE(CLSID_DirectMusicSynth),
- GE(CLSID_DirectMusicSynthSink),
- GE(CLSID_DirectMusicSysExTrack),
- GE(CLSID_DirectMusicTemplate),
- GE(CLSID_DirectMusicTempoTrack),
- GE(CLSID_DirectMusicTimeSigTrack),
- GE(CLSID_DirectMusicWaveTrack),
- GE(CLSID_DirectSoundWave),
- /* IIDs */
- GE(IID_IDirectMusic),
- GE(IID_IDirectMusic2),
- GE(IID_IDirectMusic8),
- GE(IID_IDirectMusicAudioPath),
- GE(IID_IDirectMusicBand),
- GE(IID_IDirectMusicBuffer),
- GE(IID_IDirectMusicChordMap),
- GE(IID_IDirectMusicCollection),
- GE(IID_IDirectMusicComposer),
- GE(IID_IDirectMusicContainer),
- GE(IID_IDirectMusicDownload),
- GE(IID_IDirectMusicDownloadedInstrument),
- GE(IID_IDirectMusicGetLoader),
- GE(IID_IDirectMusicGraph),
- GE(IID_IDirectMusicInstrument),
- GE(IID_IDirectMusicLoader),
- GE(IID_IDirectMusicLoader8),
- GE(IID_IDirectMusicObject),
- GE(IID_IDirectMusicPatternTrack),
- GE(IID_IDirectMusicPerformance),
- GE(IID_IDirectMusicPerformance2),
- GE(IID_IDirectMusicPerformance8),
- GE(IID_IDirectMusicPort),
- GE(IID_IDirectMusicPortDownload),
- GE(IID_IDirectMusicScript),
- GE(IID_IDirectMusicSegment),
- GE(IID_IDirectMusicSegment2),
- GE(IID_IDirectMusicSegment8),
- GE(IID_IDirectMusicSegmentState),
- GE(IID_IDirectMusicSegmentState8),
- GE(IID_IDirectMusicStyle),
- GE(IID_IDirectMusicStyle8),
- GE(IID_IDirectMusicSynth),
- GE(IID_IDirectMusicSynth8),
- GE(IID_IDirectMusicSynthSink),
- GE(IID_IDirectMusicThru),
- GE(IID_IDirectMusicTool),
- GE(IID_IDirectMusicTool8),
- GE(IID_IDirectMusicTrack),
- GE(IID_IDirectMusicTrack8),
- GE(IID_IUnknown),
- GE(IID_IPersistStream),
- GE(IID_IStream),
- GE(IID_IClassFactory),
- /* GUIDs */
- GE(GUID_DirectMusicAllTypes),
- GE(GUID_NOTIFICATION_CHORD),
- GE(GUID_NOTIFICATION_COMMAND),
- GE(GUID_NOTIFICATION_MEASUREANDBEAT),
- GE(GUID_NOTIFICATION_PERFORMANCE),
- GE(GUID_NOTIFICATION_RECOMPOSE),
- GE(GUID_NOTIFICATION_SEGMENT),
- GE(GUID_BandParam),
- GE(GUID_ChordParam),
- GE(GUID_CommandParam),
- GE(GUID_CommandParam2),
- GE(GUID_CommandParamNext),
- GE(GUID_IDirectMusicBand),
- GE(GUID_IDirectMusicChordMap),
- GE(GUID_IDirectMusicStyle),
- GE(GUID_MuteParam),
- GE(GUID_Play_Marker),
- GE(GUID_RhythmParam),
- GE(GUID_TempoParam),
- GE(GUID_TimeSignature),
- GE(GUID_Valid_Start_Time),
- GE(GUID_Clear_All_Bands),
- GE(GUID_ConnectToDLSCollection),
- GE(GUID_Disable_Auto_Download),
- GE(GUID_DisableTempo),
- GE(GUID_DisableTimeSig),
- GE(GUID_Download),
- GE(GUID_DownloadToAudioPath),
- GE(GUID_Enable_Auto_Download),
- GE(GUID_EnableTempo),
- GE(GUID_EnableTimeSig),
- GE(GUID_IgnoreBankSelectForGM),
- GE(GUID_SeedVariations),
- GE(GUID_StandardMIDIFile),
- GE(GUID_Unload),
- GE(GUID_UnloadFromAudioPath),
- GE(GUID_Variations),
- GE(GUID_PerfMasterTempo),
- GE(GUID_PerfMasterVolume),
- GE(GUID_PerfMasterGrooveLevel),
- GE(GUID_PerfAutoDownload),
- GE(GUID_DefaultGMCollection),
- GE(GUID_Synth_Default),
- GE(GUID_Buffer_Reverb),
- GE(GUID_Buffer_EnvReverb),
- GE(GUID_Buffer_Stereo),
- GE(GUID_Buffer_3D_Dry),
- GE(GUID_Buffer_Mono),
- GE(GUID_DMUS_PROP_GM_Hardware),
- GE(GUID_DMUS_PROP_GS_Capable),
- GE(GUID_DMUS_PROP_GS_Hardware),
- GE(GUID_DMUS_PROP_DLS1),
- GE(GUID_DMUS_PROP_DLS2),
- GE(GUID_DMUS_PROP_Effects),
- GE(GUID_DMUS_PROP_INSTRUMENT2),
- GE(GUID_DMUS_PROP_LegacyCaps),
- GE(GUID_DMUS_PROP_MemorySize),
- GE(GUID_DMUS_PROP_SampleMemorySize),
- GE(GUID_DMUS_PROP_SamplePlaybackRate),
- GE(GUID_DMUS_PROP_SetSynthSink),
- GE(GUID_DMUS_PROP_SinkUsesDSound),
- GE(GUID_DMUS_PROP_SynthSink_DSOUND),
- GE(GUID_DMUS_PROP_SynthSink_WAVE),
- GE(GUID_DMUS_PROP_Volume),
- GE(GUID_DMUS_PROP_WavesReverb),
- GE(GUID_DMUS_PROP_WriteLatency),
- GE(GUID_DMUS_PROP_WritePeriod),
- GE(GUID_DMUS_PROP_XG_Capable),
- GE(GUID_DMUS_PROP_XG_Hardware)
- };
-
- unsigned int i;
-
- if (!id) return "(null)";
- for (i = 0; i < ARRAY_SIZE(guids); i++) {
- if (IsEqualGUID(id, guids[i].guid))
- return guids[i].name;
- }
-
- /* if we didn't find it, act like standard debugstr_guid */
- return debugstr_guid(id);
-}
-
/* returns name of given error code */
const char *debugstr_dmreturn (DWORD code) {
static const flag_info codes[] = {
@@ -443,25 +210,6 @@ static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t n
return ptr;
}
-/* dump DMUS_OBJ flags */
-static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) {
- static const flag_info flags[] = {
- FE(DMUS_OBJ_OBJECT),
- FE(DMUS_OBJ_CLASS),
- FE(DMUS_OBJ_NAME),
- FE(DMUS_OBJ_CATEGORY),
- FE(DMUS_OBJ_FILENAME),
- FE(DMUS_OBJ_FULLPATH),
- FE(DMUS_OBJ_URL),
- FE(DMUS_OBJ_VERSION),
- FE(DMUS_OBJ_DATE),
- FE(DMUS_OBJ_LOADED),
- FE(DMUS_OBJ_MEMORY),
- FE(DMUS_OBJ_STREAM)
- };
- return debugstr_flags(flagmask, flags, ARRAY_SIZE(flags));
-}
-
/* dump DMUS_CONTAINER flags */
static const char *debugstr_DMUS_CONTAINER_FLAGS (DWORD flagmask) {
static const flag_info flags[] = {
@@ -478,24 +226,6 @@ static const char *debugstr_DMUS_CONTAINED_OBJF_FLAGS (DWORD flagmask) {
return debugstr_flags(flagmask, flags, ARRAY_SIZE(flags));
}
-/* Dump whole DMUS_OBJECTDESC struct */
-void dump_DMUS_OBJECTDESC(LPDMUS_OBJECTDESC desc)
-{
- TRACE("DMUS_OBJECTDESC (%p):\n", desc);
- TRACE(" - dwSize = %d\n", desc->dwSize);
- TRACE(" - dwValidData = %s\n", debugstr_DMUS_OBJ_FLAGS (desc->dwValidData));
- if (desc->dwValidData & DMUS_OBJ_CLASS) TRACE(" - guidClass = %s\n", debugstr_dmguid(&desc->guidClass));
- if (desc->dwValidData & DMUS_OBJ_OBJECT) TRACE(" - guidObject = %s\n", debugstr_guid(&desc->guidObject));
- if (desc->dwValidData & DMUS_OBJ_DATE) TRACE(" - ftDate = %s\n", debugstr_filetime (&desc->ftDate));
- if (desc->dwValidData & DMUS_OBJ_VERSION) TRACE(" - vVersion = %s\n", debugstr_dmversion(&desc->vVersion));
- if (desc->dwValidData & DMUS_OBJ_NAME) TRACE(" - wszName = %s\n", debugstr_w(desc->wszName));
- if (desc->dwValidData & DMUS_OBJ_CATEGORY) TRACE(" - wszCategory = %s\n", debugstr_w(desc->wszCategory));
- if (desc->dwValidData & DMUS_OBJ_FILENAME) TRACE(" - wszFileName = %s\n", debugstr_w(desc->wszFileName));
- if (desc->dwValidData & DMUS_OBJ_MEMORY) TRACE(" - llMemLength = 0x%s - pbMemData = %p\n",
- wine_dbgstr_longlong(desc->llMemLength), desc->pbMemData);
- if (desc->dwValidData & DMUS_OBJ_STREAM) TRACE(" - pStream = %p\n", desc->pStream);
-}
-
const char *debugstr_DMUS_IO_CONTAINER_HEADER (LPDMUS_IO_CONTAINER_HEADER pHeader) {
if (pHeader) {
char buffer[1024], *ptr = buffer;
diff --git a/dlls/dmloader/debug.h b/dlls/dmloader/debug.h
index 40af340ccf..fec35cfbff 100644
--- a/dlls/dmloader/debug.h
+++ b/dlls/dmloader/debug.h
@@ -26,11 +26,6 @@ typedef struct {
const char* name;
} flag_info;
-typedef struct {
- const GUID *guid;
- const char* name;
-} guid_info;
-
/* used for initialising structs */
#define DM_STRUCT_INIT(x) \
do { \
@@ -39,25 +34,14 @@ typedef struct {
} while (0)
#define FE(x) { x, #x }
-#define GE(x) { &x, #x }
/* check whether chunkID is valid dmobject form chunk */
extern BOOL IS_VALID_DMFORM (FOURCC chunkID) DECLSPEC_HIDDEN;
/* translate STREAM_SEEK flag to string */
extern const char *resolve_STREAM_SEEK (DWORD flag) DECLSPEC_HIDDEN;
-/* FOURCC to string conversion for debug messages */
-extern const char *debugstr_fourcc (DWORD fourcc) DECLSPEC_HIDDEN;
-/* DMUS_VERSION struct to string conversion for debug messages */
-extern const char *debugstr_dmversion (const DMUS_VERSION *version) DECLSPEC_HIDDEN;
-/* FILETIME struct to string conversion for debug messages */
-extern const char *debugstr_filetime (const FILETIME *time) DECLSPEC_HIDDEN;
-/* returns name of given GUID */
-extern const char *debugstr_dmguid (const GUID *id) DECLSPEC_HIDDEN;
/* returns name of given error code */
extern const char *debugstr_dmreturn (DWORD code) DECLSPEC_HIDDEN;
-/* dump whole DMUS_OBJECTDESC struct */
-extern void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN;
extern const char *debugstr_DMUS_IO_CONTAINER_HEADER (LPDMUS_IO_CONTAINER_HEADER pHeader) DECLSPEC_HIDDEN;
extern const char *debugstr_DMUS_IO_CONTAINED_OBJECT_HEADER (LPDMUS_IO_CONTAINED_OBJECT_HEADER pHeader) DECLSPEC_HIDDEN;
diff --git a/dlls/dmloader/dmloader_private.h b/dlls/dmloader/dmloader_private.h
index a8505003c7..94bb9ddf1b 100644
--- a/dlls/dmloader/dmloader_private.h
+++ b/dlls/dmloader/dmloader_private.h
@@ -40,6 +40,7 @@
#include "dmusici.h"
#include "dmusicf.h"
#include "dmusics.h"
+#include "dmobject.h"
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
diff --git a/dlls/dmloader/dmobject.c b/dlls/dmloader/dmobject.c
index 25f3198d2b..9ea31ab32a 100644
--- a/dlls/dmloader/dmobject.c
+++ b/dlls/dmloader/dmobject.c
@@ -25,22 +25,257 @@
#include "objbase.h"
#include "dmusici.h"
#include "dmusicf.h"
+#include "dmusics.h"
#include "dmobject.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmobj);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
-/* RIFF format parsing */
-#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+/* Debugging helpers */
+const char *debugstr_dmguid(const GUID *id) {
+ unsigned int i;
+#define X(guid) { &guid, #guid }
+ static const struct {
+ const GUID *guid;
+ const char *name;
+ } guids[] = {
+ /* CLSIDs */
+ X(CLSID_AudioVBScript),
+ X(CLSID_DirectMusic),
+ X(CLSID_DirectMusicAudioPathConfig),
+ X(CLSID_DirectMusicAuditionTrack),
+ X(CLSID_DirectMusicBand),
+ X(CLSID_DirectMusicBandTrack),
+ X(CLSID_DirectMusicChordMapTrack),
+ X(CLSID_DirectMusicChordMap),
+ X(CLSID_DirectMusicChordTrack),
+ X(CLSID_DirectMusicCollection),
+ X(CLSID_DirectMusicCommandTrack),
+ X(CLSID_DirectMusicComposer),
+ X(CLSID_DirectMusicContainer),
+ X(CLSID_DirectMusicGraph),
+ X(CLSID_DirectMusicLoader),
+ X(CLSID_DirectMusicLyricsTrack),
+ X(CLSID_DirectMusicMarkerTrack),
+ X(CLSID_DirectMusicMelodyFormulationTrack),
+ X(CLSID_DirectMusicMotifTrack),
+ X(CLSID_DirectMusicMuteTrack),
+ X(CLSID_DirectMusicParamControlTrack),
+ X(CLSID_DirectMusicPatternTrack),
+ X(CLSID_DirectMusicPerformance),
+ X(CLSID_DirectMusicScript),
+ X(CLSID_DirectMusicScriptAutoImpSegment),
+ X(CLSID_DirectMusicScriptAutoImpPerformance),
+ X(CLSID_DirectMusicScriptAutoImpSegmentState),
+ X(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
+ X(CLSID_DirectMusicScriptAutoImpAudioPath),
+ X(CLSID_DirectMusicScriptAutoImpSong),
+ X(CLSID_DirectMusicScriptSourceCodeLoader),
+ X(CLSID_DirectMusicScriptTrack),
+ X(CLSID_DirectMusicSection),
+ X(CLSID_DirectMusicSegment),
+ X(CLSID_DirectMusicSegmentState),
+ X(CLSID_DirectMusicSegmentTriggerTrack),
+ X(CLSID_DirectMusicSegTriggerTrack),
+ X(CLSID_DirectMusicSeqTrack),
+ X(CLSID_DirectMusicSignPostTrack),
+ X(CLSID_DirectMusicSong),
+ X(CLSID_DirectMusicStyle),
+ X(CLSID_DirectMusicStyleTrack),
+ X(CLSID_DirectMusicSynth),
+ X(CLSID_DirectMusicSynthSink),
+ X(CLSID_DirectMusicSysExTrack),
+ X(CLSID_DirectMusicTemplate),
+ X(CLSID_DirectMusicTempoTrack),
+ X(CLSID_DirectMusicTimeSigTrack),
+ X(CLSID_DirectMusicWaveTrack),
+ X(CLSID_DirectSoundWave),
+ /* IIDs */
+ X(IID_IDirectMusic),
+ X(IID_IDirectMusic2),
+ X(IID_IDirectMusic8),
+ X(IID_IDirectMusicAudioPath),
+ X(IID_IDirectMusicBand),
+ X(IID_IDirectMusicBuffer),
+ X(IID_IDirectMusicChordMap),
+ X(IID_IDirectMusicCollection),
+ X(IID_IDirectMusicComposer),
+ X(IID_IDirectMusicContainer),
+ X(IID_IDirectMusicDownload),
+ X(IID_IDirectMusicDownloadedInstrument),
+ X(IID_IDirectMusicGetLoader),
+ X(IID_IDirectMusicGraph),
+ X(IID_IDirectMusicInstrument),
+ X(IID_IDirectMusicLoader),
+ X(IID_IDirectMusicLoader8),
+ X(IID_IDirectMusicObject),
+ X(IID_IDirectMusicPatternTrack),
+ X(IID_IDirectMusicPerformance),
+ X(IID_IDirectMusicPerformance2),
+ X(IID_IDirectMusicPerformance8),
+ X(IID_IDirectMusicPort),
+ X(IID_IDirectMusicPortDownload),
+ X(IID_IDirectMusicScript),
+ X(IID_IDirectMusicSegment),
+ X(IID_IDirectMusicSegment2),
+ X(IID_IDirectMusicSegment8),
+ X(IID_IDirectMusicSegmentState),
+ X(IID_IDirectMusicSegmentState8),
+ X(IID_IDirectMusicStyle),
+ X(IID_IDirectMusicStyle8),
+ X(IID_IDirectMusicSynth),
+ X(IID_IDirectMusicSynth8),
+ X(IID_IDirectMusicSynthSink),
+ X(IID_IDirectMusicThru),
+ X(IID_IDirectMusicTool),
+ X(IID_IDirectMusicTool8),
+ X(IID_IDirectMusicTrack),
+ X(IID_IDirectMusicTrack8),
+ X(IID_IUnknown),
+ X(IID_IPersistStream),
+ X(IID_IStream),
+ X(IID_IClassFactory),
+ /* GUIDs */
+ X(GUID_DirectMusicAllTypes),
+ X(GUID_NOTIFICATION_CHORD),
+ X(GUID_NOTIFICATION_COMMAND),
+ X(GUID_NOTIFICATION_MEASUREANDBEAT),
+ X(GUID_NOTIFICATION_PERFORMANCE),
+ X(GUID_NOTIFICATION_RECOMPOSE),
+ X(GUID_NOTIFICATION_SEGMENT),
+ X(GUID_BandParam),
+ X(GUID_ChordParam),
+ X(GUID_CommandParam),
+ X(GUID_CommandParam2),
+ X(GUID_CommandParamNext),
+ X(GUID_IDirectMusicBand),
+ X(GUID_IDirectMusicChordMap),
+ X(GUID_IDirectMusicStyle),
+ X(GUID_MuteParam),
+ X(GUID_Play_Marker),
+ X(GUID_RhythmParam),
+ X(GUID_TempoParam),
+ X(GUID_TimeSignature),
+ X(GUID_Valid_Start_Time),
+ X(GUID_Clear_All_Bands),
+ X(GUID_ConnectToDLSCollection),
+ X(GUID_Disable_Auto_Download),
+ X(GUID_DisableTempo),
+ X(GUID_DisableTimeSig),
+ X(GUID_Download),
+ X(GUID_DownloadToAudioPath),
+ X(GUID_Enable_Auto_Download),
+ X(GUID_EnableTempo),
+ X(GUID_EnableTimeSig),
+ X(GUID_IgnoreBankSelectForGM),
+ X(GUID_SeedVariations),
+ X(GUID_StandardMIDIFile),
+ X(GUID_Unload),
+ X(GUID_UnloadFromAudioPath),
+ X(GUID_Variations),
+ X(GUID_PerfMasterTempo),
+ X(GUID_PerfMasterVolume),
+ X(GUID_PerfMasterGrooveLevel),
+ X(GUID_PerfAutoDownload),
+ X(GUID_DefaultGMCollection),
+ X(GUID_Synth_Default),
+ X(GUID_Buffer_Reverb),
+ X(GUID_Buffer_EnvReverb),
+ X(GUID_Buffer_Stereo),
+ X(GUID_Buffer_3D_Dry),
+ X(GUID_Buffer_Mono),
+ X(GUID_DMUS_PROP_GM_Hardware),
+ X(GUID_DMUS_PROP_GS_Capable),
+ X(GUID_DMUS_PROP_GS_Hardware),
+ X(GUID_DMUS_PROP_DLS1),
+ X(GUID_DMUS_PROP_DLS2),
+ X(GUID_DMUS_PROP_Effects),
+ X(GUID_DMUS_PROP_INSTRUMENT2),
+ X(GUID_DMUS_PROP_LegacyCaps),
+ X(GUID_DMUS_PROP_MemorySize),
+ X(GUID_DMUS_PROP_SampleMemorySize),
+ X(GUID_DMUS_PROP_SamplePlaybackRate),
+ X(GUID_DMUS_PROP_SetSynthSink),
+ X(GUID_DMUS_PROP_SinkUsesDSound),
+ X(GUID_DMUS_PROP_SynthSink_DSOUND),
+ X(GUID_DMUS_PROP_SynthSink_WAVE),
+ X(GUID_DMUS_PROP_Volume),
+ X(GUID_DMUS_PROP_WavesReverb),
+ X(GUID_DMUS_PROP_WriteLatency),
+ X(GUID_DMUS_PROP_WritePeriod),
+ X(GUID_DMUS_PROP_XG_Capable),
+ X(GUID_DMUS_PROP_XG_Hardware)
+ };
+#undef X
+
+ if (!id)
+ return "(null)";
+
+ for (i = 0; i < ARRAY_SIZE(guids); i++)
+ if (IsEqualGUID(id, guids[i].guid))
+ return guids[i].name;
+
+ return debugstr_guid(id);
+}
-static inline const char *debugstr_fourcc(DWORD fourcc)
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc)
{
- if (!fourcc) return "''";
- return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
+ if (!desc || !TRACE_ON(dmfile))
+ return;
+
+ TRACE_(dmfile)("DMUS_OBJECTDESC (%p):", desc);
+ TRACE_(dmfile)(" - dwSize = %u\n", desc->dwSize);
+
+#define X(flag) if (desc->dwValidData & flag) TRACE_(dmfile)(#flag " ")
+ TRACE_(dmfile)(" - dwValidData = %#08x ( ", desc->dwValidData);
+ X(DMUS_OBJ_OBJECT);
+ X(DMUS_OBJ_CLASS);
+ X(DMUS_OBJ_NAME);
+ X(DMUS_OBJ_CATEGORY);
+ X(DMUS_OBJ_FILENAME);
+ X(DMUS_OBJ_FULLPATH);
+ X(DMUS_OBJ_URL);
+ X(DMUS_OBJ_VERSION);
+ X(DMUS_OBJ_DATE);
+ X(DMUS_OBJ_LOADED);
+ X(DMUS_OBJ_MEMORY);
+ X(DMUS_OBJ_STREAM);
+ TRACE_(dmfile)(")\n");
+#undef X
+
+ if (desc->dwValidData & DMUS_OBJ_CLASS)
+ TRACE_(dmfile)(" - guidClass = %s\n", debugstr_dmguid(&desc->guidClass));
+ if (desc->dwValidData & DMUS_OBJ_OBJECT)
+ TRACE_(dmfile)(" - guidObject = %s\n", debugstr_guid(&desc->guidObject));
+
+ if (desc->dwValidData & DMUS_OBJ_DATE) {
+ SYSTEMTIME time;
+ FileTimeToSystemTime(&desc->ftDate, &time);
+ TRACE_(dmfile)(" - ftDate = \'%04u-%02u-%02u %02u:%02u:%02u\'\n",
+ time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond);
+ }
+ if (desc->dwValidData & DMUS_OBJ_VERSION)
+ TRACE_(dmfile)(" - vVersion = \'%u,%u,%u,%u\'\n",
+ HIWORD(desc->vVersion.dwVersionMS), LOWORD(desc->vVersion.dwVersionMS),
+ HIWORD(desc->vVersion.dwVersionLS), LOWORD(desc->vVersion.dwVersionLS));
+ if (desc->dwValidData & DMUS_OBJ_NAME)
+ TRACE_(dmfile)(" - wszName = %s\n", debugstr_w(desc->wszName));
+ if (desc->dwValidData & DMUS_OBJ_CATEGORY)
+ TRACE_(dmfile)(" - wszCategory = %s\n", debugstr_w(desc->wszCategory));
+ if (desc->dwValidData & DMUS_OBJ_FILENAME)
+ TRACE_(dmfile)(" - wszFileName = %s\n", debugstr_w(desc->wszFileName));
+ if (desc->dwValidData & DMUS_OBJ_MEMORY)
+ TRACE_(dmfile)(" - llMemLength = 0x%s - pbMemData = %p\n",
+ wine_dbgstr_longlong(desc->llMemLength), desc->pbMemData);
+ if (desc->dwValidData & DMUS_OBJ_STREAM)
+ TRACE_(dmfile)(" - pStream = %p\n", desc->pStream);
}
+
+/* RIFF format parsing */
+#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
+
const char *debugstr_chunk(const struct chunk_entry *chunk)
{
const char *type = "";
diff --git a/dlls/dmloader/dmobject.h b/dlls/dmloader/dmobject.h
index 4a721cc152..d347020691 100644
--- a/dlls/dmloader/dmobject.h
+++ b/dlls/dmloader/dmobject.h
@@ -60,8 +60,6 @@ static inline HRESULT stream_reset_chunk_start(IStream *stream, const struct chu
return IStream_Seek(stream, offset, STREAM_SEEK_SET, NULL);
}
-const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
-
/* IDirectMusicObject base object */
struct dmobject {
@@ -106,3 +104,15 @@ HRESULT WINAPI unimpl_IPersistStream_Save(IPersistStream *iface, IStream *stream
BOOL clear_dirty) DECLSPEC_HIDDEN;
HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface,
ULARGE_INTEGER *size) DECLSPEC_HIDDEN;
+
+/* Debugging helpers */
+const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+const char *debugstr_dmguid(const GUID *id) DECLSPEC_HIDDEN;
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN;
+
+static inline const char *debugstr_fourcc(DWORD fourcc)
+{
+ if (!fourcc) return "''";
+ return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
+ (char)(fourcc >> 16), (char)(fourcc >> 24));
+}
--
2.23.0
1
0
12 Dec '19
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmloader/container.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/dlls/dmloader/container.c b/dlls/dmloader/container.c
index f7c7f3e951..075843ad32 100644
--- a/dlls/dmloader/container.c
+++ b/dlls/dmloader/container.c
@@ -22,7 +22,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmloader);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
-WINE_DECLARE_DEBUG_CHANNEL(dmdump);
#define DMUS_MAX_CATEGORY_SIZE DMUS_MAX_CATEGORY*sizeof(WCHAR)
#define DMUS_MAX_NAME_SIZE DMUS_MAX_NAME*sizeof(WCHAR)
@@ -298,9 +297,8 @@ static HRESULT WINAPI IPersistStreamImpl_Load(IPersistStream *iface, IStream *pS
TRACE_(dmfile)(": %s chunk (size = 0x%08X)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case DMUS_FOURCC_CONTAINER_CHUNK: {
- TRACE_(dmfile)(": container header chunk\n");
IStream_Read (pStm, &This->Header, Chunk.dwSize, NULL);
- TRACE_(dmdump)(": container header chunk:\n%s\n", debugstr_DMUS_IO_CONTAINER_HEADER(&This->Header));
+ TRACE_(dmfile)(": container header chunk:\n%s\n", debugstr_DMUS_IO_CONTAINER_HEADER(&This->Header));
break;
}
case DMUS_FOURCC_GUID_CHUNK: {
@@ -403,14 +401,13 @@ static HRESULT WINAPI IPersistStreamImpl_Load(IPersistStream *iface, IStream *pS
TRACE_(dmfile)(": alias chunk\n");
pNewEntry->wszAlias = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, Chunk.dwSize);
IStream_Read (pStm, pNewEntry->wszAlias, Chunk.dwSize, NULL);
- TRACE_(dmdump)(": alias: %s\n", debugstr_w(pNewEntry->wszAlias));
+ TRACE_(dmfile)(": alias: %s\n", debugstr_w(pNewEntry->wszAlias));
break;
}
case DMUS_FOURCC_CONTAINED_OBJECT_CHUNK: {
DMUS_IO_CONTAINED_OBJECT_HEADER tmpObjectHeader;
- TRACE_(dmfile)(": contained object header chunk\n");
IStream_Read (pStm, &tmpObjectHeader, Chunk.dwSize, NULL);
- TRACE_(dmdump)(": contained object header:\n%s\n", debugstr_DMUS_IO_CONTAINED_OBJECT_HEADER(&tmpObjectHeader));
+ TRACE_(dmfile)(": contained object header:\n%s\n", debugstr_DMUS_IO_CONTAINED_OBJECT_HEADER(&tmpObjectHeader));
/* copy guidClass */
pNewEntry->Desc.dwValidData |= DMUS_OBJ_CLASS;
pNewEntry->Desc.guidClass = tmpObjectHeader.guidClassID;
--
2.23.0
1
0
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmloader/container.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/dlls/dmloader/container.c b/dlls/dmloader/container.c
index 39b105a159..f7c7f3e951 100644
--- a/dlls/dmloader/container.c
+++ b/dlls/dmloader/container.c
@@ -307,23 +307,20 @@ static HRESULT WINAPI IPersistStreamImpl_Load(IPersistStream *iface, IStream *pS
TRACE_(dmfile)(": GUID chunk\n");
IStream_Read (pStm, &This->dmobj.desc.guidObject, Chunk.dwSize, NULL);
This->dmobj.desc.dwValidData |= DMUS_OBJ_OBJECT;
- TRACE_(dmdump)(": GUID: %s\n", debugstr_guid(&This->dmobj.desc.guidObject));
break;
}
case DMUS_FOURCC_VERSION_CHUNK: {
TRACE_(dmfile)(": version chunk\n");
IStream_Read (pStm, &This->dmobj.desc.vVersion, Chunk.dwSize, NULL);
This->dmobj.desc.dwValidData |= DMUS_OBJ_VERSION;
- TRACE_(dmdump)(": version: %s\n", debugstr_dmversion(&This->dmobj.desc.vVersion));
break;
}
case DMUS_FOURCC_DATE_CHUNK: {
TRACE_(dmfile)(": date chunk\n");
IStream_Read (pStm, &This->dmobj.desc.ftDate, Chunk.dwSize, NULL);
This->dmobj.desc.dwValidData |= DMUS_OBJ_DATE;
- TRACE_(dmdump)(": date: %s\n", debugstr_filetime(&This->dmobj.desc.ftDate));
break;
- }
+ }
case DMUS_FOURCC_CATEGORY_CHUNK: {
TRACE_(dmfile)(": category chunk\n");
/* if it happens that string is too long,
@@ -336,7 +333,6 @@ static HRESULT WINAPI IPersistStreamImpl_Load(IPersistStream *iface, IStream *pS
IStream_Read (pStm, This->dmobj.desc.wszCategory, Chunk.dwSize, NULL);
}
This->dmobj.desc.dwValidData |= DMUS_OBJ_CATEGORY;
- TRACE_(dmdump)(": category: %s\n", debugstr_w(This->dmobj.desc.wszCategory));
break;
}
case FOURCC_LIST: {
@@ -367,7 +363,6 @@ static HRESULT WINAPI IPersistStreamImpl_Load(IPersistStream *iface, IStream *pS
IStream_Read (pStm, This->dmobj.desc.wszName, Chunk.dwSize, NULL);
}
This->dmobj.desc.dwValidData |= DMUS_OBJ_NAME;
- TRACE_(dmdump)(": name: %s\n", debugstr_w(This->dmobj.desc.wszName));
break;
}
default: {
@@ -606,6 +601,7 @@ static HRESULT WINAPI IPersistStreamImpl_Load(IPersistStream *iface, IStream *pS
}
TRACE_(dmfile)(": reading finished\n");
This->dmobj.desc.dwValidData |= DMUS_OBJ_LOADED;
+ dump_DMUS_OBJECTDESC(&This->dmobj.desc);
break;
}
default: {
--
2.23.0
1
0
[PATCH 4/9] dmband: Simplify dump_DMUS_OBJECTDESC() and move it to dmobject.c
by Michael Stefaniuc 12 Dec '19
by Michael Stefaniuc 12 Dec '19
12 Dec '19
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmband/band.c | 2 +-
dlls/dmband/dmobject.c | 53 ++++++++++++++++++++++
dlls/dmband/dmobject.h | 1 +
dlls/dmband/dmutils.c | 100 +----------------------------------------
dlls/dmband/dmutils.h | 14 ------
5 files changed, 56 insertions(+), 114 deletions(-)
diff --git a/dlls/dmband/band.c b/dlls/dmband/band.c
index 53f407c1a4..901f5a69ee 100644
--- a/dlls/dmband/band.c
+++ b/dlls/dmband/band.c
@@ -158,7 +158,7 @@ static HRESULT WINAPI band_IDirectMusicObject_ParseDescriptor(IDirectMusicObject
}
TRACE("returning descriptor:\n");
- debug_DMUS_OBJECTDESC(desc);
+ dump_DMUS_OBJECTDESC(desc);
return S_OK;
}
diff --git a/dlls/dmband/dmobject.c b/dlls/dmband/dmobject.c
index e0b7eafe25..9ea31ab32a 100644
--- a/dlls/dmband/dmobject.c
+++ b/dlls/dmband/dmobject.c
@@ -219,6 +219,59 @@ const char *debugstr_dmguid(const GUID *id) {
return debugstr_guid(id);
}
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc)
+{
+ if (!desc || !TRACE_ON(dmfile))
+ return;
+
+ TRACE_(dmfile)("DMUS_OBJECTDESC (%p):", desc);
+ TRACE_(dmfile)(" - dwSize = %u\n", desc->dwSize);
+
+#define X(flag) if (desc->dwValidData & flag) TRACE_(dmfile)(#flag " ")
+ TRACE_(dmfile)(" - dwValidData = %#08x ( ", desc->dwValidData);
+ X(DMUS_OBJ_OBJECT);
+ X(DMUS_OBJ_CLASS);
+ X(DMUS_OBJ_NAME);
+ X(DMUS_OBJ_CATEGORY);
+ X(DMUS_OBJ_FILENAME);
+ X(DMUS_OBJ_FULLPATH);
+ X(DMUS_OBJ_URL);
+ X(DMUS_OBJ_VERSION);
+ X(DMUS_OBJ_DATE);
+ X(DMUS_OBJ_LOADED);
+ X(DMUS_OBJ_MEMORY);
+ X(DMUS_OBJ_STREAM);
+ TRACE_(dmfile)(")\n");
+#undef X
+
+ if (desc->dwValidData & DMUS_OBJ_CLASS)
+ TRACE_(dmfile)(" - guidClass = %s\n", debugstr_dmguid(&desc->guidClass));
+ if (desc->dwValidData & DMUS_OBJ_OBJECT)
+ TRACE_(dmfile)(" - guidObject = %s\n", debugstr_guid(&desc->guidObject));
+
+ if (desc->dwValidData & DMUS_OBJ_DATE) {
+ SYSTEMTIME time;
+ FileTimeToSystemTime(&desc->ftDate, &time);
+ TRACE_(dmfile)(" - ftDate = \'%04u-%02u-%02u %02u:%02u:%02u\'\n",
+ time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond);
+ }
+ if (desc->dwValidData & DMUS_OBJ_VERSION)
+ TRACE_(dmfile)(" - vVersion = \'%u,%u,%u,%u\'\n",
+ HIWORD(desc->vVersion.dwVersionMS), LOWORD(desc->vVersion.dwVersionMS),
+ HIWORD(desc->vVersion.dwVersionLS), LOWORD(desc->vVersion.dwVersionLS));
+ if (desc->dwValidData & DMUS_OBJ_NAME)
+ TRACE_(dmfile)(" - wszName = %s\n", debugstr_w(desc->wszName));
+ if (desc->dwValidData & DMUS_OBJ_CATEGORY)
+ TRACE_(dmfile)(" - wszCategory = %s\n", debugstr_w(desc->wszCategory));
+ if (desc->dwValidData & DMUS_OBJ_FILENAME)
+ TRACE_(dmfile)(" - wszFileName = %s\n", debugstr_w(desc->wszFileName));
+ if (desc->dwValidData & DMUS_OBJ_MEMORY)
+ TRACE_(dmfile)(" - llMemLength = 0x%s - pbMemData = %p\n",
+ wine_dbgstr_longlong(desc->llMemLength), desc->pbMemData);
+ if (desc->dwValidData & DMUS_OBJ_STREAM)
+ TRACE_(dmfile)(" - pStream = %p\n", desc->pStream);
+}
+
/* RIFF format parsing */
#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
diff --git a/dlls/dmband/dmobject.h b/dlls/dmband/dmobject.h
index 1354553665..d347020691 100644
--- a/dlls/dmband/dmobject.h
+++ b/dlls/dmband/dmobject.h
@@ -108,6 +108,7 @@ HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface,
/* Debugging helpers */
const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
const char *debugstr_dmguid(const GUID *id) DECLSPEC_HIDDEN;
+void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN;
static inline const char *debugstr_fourcc(DWORD fourcc)
{
diff --git a/dlls/dmband/dmutils.c b/dlls/dmband/dmutils.c
index 39d6358211..c676775d35 100644
--- a/dlls/dmband/dmutils.c
+++ b/dlls/dmband/dmutils.c
@@ -44,84 +44,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmfile);
-/* generic flag-dumping function */
-static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){
- static char buffer[128] = "", *ptr = &buffer[0];
- unsigned int i;
- int size = sizeof(buffer);
-
- for (i=0; i < num_names; i++) {
- if ((flags & names[i].val)) {
- int cnt = snprintf(ptr, size, "%s ", names[i].name);
- if (cnt < 0 || cnt >= size) break;
- size -= cnt;
- ptr += cnt;
- }
- }
-
- ptr = &buffer[0];
- return ptr;
-}
-
-/* dump DMUS_OBJ flags */
-static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) {
- static const flag_info flags[] = {
- FE(DMUS_OBJ_OBJECT),
- FE(DMUS_OBJ_CLASS),
- FE(DMUS_OBJ_NAME),
- FE(DMUS_OBJ_CATEGORY),
- FE(DMUS_OBJ_FILENAME),
- FE(DMUS_OBJ_FULLPATH),
- FE(DMUS_OBJ_URL),
- FE(DMUS_OBJ_VERSION),
- FE(DMUS_OBJ_DATE),
- FE(DMUS_OBJ_LOADED),
- FE(DMUS_OBJ_MEMORY),
- FE(DMUS_OBJ_STREAM)
- };
- return debugstr_flags(flagmask, flags, ARRAY_SIZE(flags));
-}
-
-/* month number into month name (for debugstr_filetime) */
-static const char *debugstr_month (DWORD dwMonth) {
- switch (dwMonth) {
- case 1: return "January";
- case 2: return "February";
- case 3: return "March";
- case 4: return "April";
- case 5: return "May";
- case 6: return "June";
- case 7: return "July";
- case 8: return "August";
- case 9: return "September";
- case 10: return "October";
- case 11: return "November";
- case 12: return "December";
- default: return "Invalid";
- }
-}
-
-/* FILETIME struct to string conversion for debug messages */
-static const char *debugstr_filetime (const FILETIME *time) {
- SYSTEMTIME sysTime;
-
- if (!time) return "'null'";
-
- FileTimeToSystemTime (time, &sysTime);
-
- return wine_dbg_sprintf ("\'%02i. %s %04i %02i:%02i:%02i\'",
- sysTime.wDay, debugstr_month(sysTime.wMonth), sysTime.wYear,
- sysTime.wHour, sysTime.wMinute, sysTime.wSecond);
-}
-
-/* DMUS_VERSION struct to string conversion for debug messages */
-static const char *debugstr_dmversion (const DMUS_VERSION *version) {
- if (!version) return "'null'";
- return wine_dbg_sprintf ("\'%i,%i,%i,%i\'",
- HIWORD(version->dwVersionMS),LOWORD(version->dwVersionMS),
- HIWORD(version->dwVersionLS), LOWORD(version->dwVersionLS));
-}
-
HRESULT IDirectMusicUtils_IPersistStream_ParseDescGeneric (DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, LPDMUS_OBJECTDESC pDesc) {
switch (pChunk->fccID) {
@@ -278,7 +200,7 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface,
TRACE("** DM Reference Begin of Load ***\n");
TRACE("With Desc:\n");
- debug_DMUS_OBJECTDESC(&ref_desc);
+ dump_DMUS_OBJECTDESC(&ref_desc);
{
LPDIRECTMUSICGETLOADER pGetLoader = NULL;
@@ -295,23 +217,3 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface,
return hr;
}
-
-void debug_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) {
- if (pDesc) {
- TRACE("DMUS_OBJECTDESC (%p):\n", pDesc);
- TRACE(" - dwSize = %d\n", pDesc->dwSize);
- TRACE(" - dwValidData = %s\n", debugstr_DMUS_OBJ_FLAGS (pDesc->dwValidData));
- if (pDesc->dwValidData & DMUS_OBJ_NAME) TRACE(" - wszName = %s\n", debugstr_w(pDesc->wszName));
- if (pDesc->dwValidData & DMUS_OBJ_CLASS) TRACE(" - guidClass = %s\n", debugstr_dmguid(&pDesc->guidClass));
- if (pDesc->dwValidData & DMUS_OBJ_OBJECT) TRACE(" - guidObject = %s\n", debugstr_guid(&pDesc->guidObject));
- if (pDesc->dwValidData & DMUS_OBJ_DATE) TRACE(" - ftDate = %s\n", debugstr_filetime(&pDesc->ftDate));
- if (pDesc->dwValidData & DMUS_OBJ_VERSION) TRACE(" - vVersion = %s\n", debugstr_dmversion(&pDesc->vVersion));
- if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) TRACE(" - wszCategory = %s\n", debugstr_w(pDesc->wszCategory));
- if (pDesc->dwValidData & DMUS_OBJ_FILENAME) TRACE(" - wszFileName = %s\n", debugstr_w(pDesc->wszFileName));
- if (pDesc->dwValidData & DMUS_OBJ_MEMORY) TRACE(" - llMemLength = 0x%s - pbMemData = %p\n",
- wine_dbgstr_longlong(pDesc->llMemLength), pDesc->pbMemData);
- if (pDesc->dwValidData & DMUS_OBJ_STREAM) TRACE(" - pStream = %p\n", pDesc->pStream);
- } else {
- TRACE("(NULL)\n");
- }
-}
diff --git a/dlls/dmband/dmutils.h b/dlls/dmband/dmutils.h
index dfa8ac46d6..2f13c4b1f4 100644
--- a/dlls/dmband/dmutils.h
+++ b/dlls/dmband/dmutils.h
@@ -34,18 +34,4 @@ extern HRESULT IDirectMusicUtils_IPersistStream_ParseDescGeneric (DMUS_PRIVATE_C
extern HRESULT IDirectMusicUtils_IPersistStream_ParseUNFOGeneric (DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, LPDMUS_OBJECTDESC pDesc) DECLSPEC_HIDDEN;
extern HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface, DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, IDirectMusicObject** ppObject) DECLSPEC_HIDDEN;
-/**
- * Debug utilities
- */
-/* used for generic dumping (copied from ddraw) */
-typedef struct {
- DWORD val;
- const char* name;
-} flag_info;
-
-/* used for initialising structs */
-#define FE(x) { x, #x }
-
-extern void debug_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) DECLSPEC_HIDDEN;
-
#endif /* __WINE_DMUTILS_H */
--
2.23.0
1
0
[PATCH 3/9] dmband: Use only the 'dmfile' debug channel in dmutils.c
by Michael Stefaniuc 12 Dec '19
by Michael Stefaniuc 12 Dec '19
12 Dec '19
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmband/dmutils.c | 45 +++++++++++++++++++++----------------------
1 file changed, 22 insertions(+), 23 deletions(-)
diff --git a/dlls/dmband/dmutils.c b/dlls/dmband/dmutils.c
index 1309c7c318..39d6358211 100644
--- a/dlls/dmband/dmutils.c
+++ b/dlls/dmband/dmutils.c
@@ -42,8 +42,7 @@
#include "dmutils.h"
#include "dmobject.h"
-WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
-WINE_DECLARE_DEBUG_CHANNEL(dmfile);
+WINE_DEFAULT_DEBUG_CHANNEL(dmfile);
/* generic flag-dumping function */
static const char* debugstr_flags (DWORD flags, const flag_info* names, size_t num_names){
@@ -127,37 +126,37 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseDescGeneric (DMUS_PRIVATE_CHUNK* p
switch (pChunk->fccID) {
case DMUS_FOURCC_GUID_CHUNK: {
- TRACE_(dmfile)(": GUID chunk\n");
+ TRACE(": GUID chunk\n");
pDesc->dwValidData |= DMUS_OBJ_OBJECT;
IStream_Read (pStm, &pDesc->guidObject, pChunk->dwSize, NULL);
break;
}
case DMUS_FOURCC_DATE_CHUNK: {
- TRACE_(dmfile)(": file date chunk\n");
+ TRACE(": file date chunk\n");
pDesc->dwValidData |= DMUS_OBJ_DATE;
IStream_Read (pStm, &pDesc->ftDate, pChunk->dwSize, NULL);
break;
}
case DMUS_FOURCC_NAME_CHUNK: {
- TRACE_(dmfile)(": name chunk\n");
+ TRACE(": name chunk\n");
pDesc->dwValidData |= DMUS_OBJ_NAME;
IStream_Read (pStm, pDesc->wszName, pChunk->dwSize, NULL);
break;
}
case DMUS_FOURCC_FILE_CHUNK: {
- TRACE_(dmfile)(": file name chunk\n");
+ TRACE(": file name chunk\n");
pDesc->dwValidData |= DMUS_OBJ_FILENAME;
IStream_Read (pStm, pDesc->wszFileName, pChunk->dwSize, NULL);
break;
}
case DMUS_FOURCC_VERSION_CHUNK: {
- TRACE_(dmfile)(": version chunk\n");
+ TRACE(": version chunk\n");
pDesc->dwValidData |= DMUS_OBJ_VERSION;
IStream_Read (pStm, &pDesc->vVersion, pChunk->dwSize, NULL);
break;
}
case DMUS_FOURCC_CATEGORY_CHUNK: {
- TRACE_(dmfile)(": category chunk\n");
+ TRACE(": category chunk\n");
pDesc->dwValidData |= DMUS_OBJ_CATEGORY;
IStream_Read (pStm, pDesc->wszCategory, pChunk->dwSize, NULL);
break;
@@ -182,37 +181,37 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseUNFOGeneric (DMUS_PRIVATE_CHUNK* p
case mmioFOURCC('I','N','A','M'):
case DMUS_FOURCC_UNAM_CHUNK: {
- TRACE_(dmfile)(": name chunk\n");
+ TRACE(": name chunk\n");
pDesc->dwValidData |= DMUS_OBJ_NAME;
IStream_Read (pStm, pDesc->wszName, pChunk->dwSize, NULL);
- TRACE_(dmfile)(" - wszName: %s\n", debugstr_w(pDesc->wszName));
+ TRACE(" - wszName: %s\n", debugstr_w(pDesc->wszName));
break;
}
case mmioFOURCC('I','A','R','T'):
case DMUS_FOURCC_UART_CHUNK: {
- TRACE_(dmfile)(": artist chunk (ignored)\n");
+ TRACE(": artist chunk (ignored)\n");
liMove.QuadPart = pChunk->dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','O','P'):
case DMUS_FOURCC_UCOP_CHUNK: {
- TRACE_(dmfile)(": copyright chunk (ignored)\n");
+ TRACE(": copyright chunk (ignored)\n");
liMove.QuadPart = pChunk->dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','S','B','J'):
case DMUS_FOURCC_USBJ_CHUNK: {
- TRACE_(dmfile)(": subject chunk (ignored)\n");
+ TRACE(": subject chunk (ignored)\n");
liMove.QuadPart = pChunk->dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
case mmioFOURCC('I','C','M','T'):
case DMUS_FOURCC_UCMT_CHUNK: {
- TRACE_(dmfile)(": comment chunk (ignored)\n");
+ TRACE(": comment chunk (ignored)\n");
liMove.QuadPart = pChunk->dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
@@ -248,7 +247,7 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface,
do {
IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
- TRACE_(dmfile)(": %s chunk (size = %d)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
+ TRACE(": %s chunk (size = %d)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
hr = IDirectMusicUtils_IPersistStream_ParseDescGeneric(&Chunk, pStm, &ref_desc);
if (FAILED(hr)) return hr;
@@ -256,29 +255,29 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface,
if (hr == S_FALSE) {
switch (Chunk.fccID) {
case DMUS_FOURCC_REF_CHUNK: {
- TRACE_(dmfile)(": Reference chunk\n");
+ TRACE(": Reference chunk\n");
if (Chunk.dwSize != sizeof(DMUS_IO_REFERENCE)) return E_FAIL;
IStream_Read (pStm, &ref, sizeof(DMUS_IO_REFERENCE), NULL);
- TRACE_(dmfile)(" - guidClassID: %s\n", debugstr_dmguid(&ref.guidClassID));
- TRACE_(dmfile)(" - dwValidData: %u\n", ref.dwValidData);
+ TRACE(" - guidClassID: %s\n", debugstr_dmguid(&ref.guidClassID));
+ TRACE(" - dwValidData: %u\n", ref.dwValidData);
break;
}
default: {
- TRACE_(dmfile)(": unknown chunk (irrelevant & skipping)\n");
+ TRACE(": unknown chunk (irrelevant & skipping)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
}
- TRACE_(dmfile)(": ListCount[0] = %d < ListSize[0] = %d\n", ListCount[0], ListSize[0]);
+ TRACE(": ListCount[0] = %d < ListSize[0] = %d\n", ListCount[0], ListSize[0]);
} while (ListCount[0] < ListSize[0]);
ref_desc.dwValidData |= DMUS_OBJ_CLASS;
ref_desc.guidClass = ref.guidClassID;
- TRACE_(dmfile)("** DM Reference Begin of Load ***\n");
- TRACE_(dmfile)("With Desc:\n");
+ TRACE("** DM Reference Begin of Load ***\n");
+ TRACE("With Desc:\n");
debug_DMUS_OBJECTDESC(&ref_desc);
{
@@ -292,7 +291,7 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface,
hr = IDirectMusicLoader_GetObject (pLoader, &ref_desc, &IID_IDirectMusicObject, (LPVOID*)ppObject);
IDirectMusicLoader_Release (pLoader); /* release loader */
}
- TRACE_(dmfile)("** DM Reference End of Load ***\n");
+ TRACE("** DM Reference End of Load ***\n");
return hr;
}
--
2.23.0
1
0
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmband/dmband_main.c | 1 +
dlls/dmband/dmobject.c | 189 ++++++++++++++++++++++++++++++++++++++
dlls/dmband/dmobject.h | 1 +
dlls/dmband/dmutils.c | 184 -------------------------------------
dlls/dmband/dmutils.h | 9 --
5 files changed, 191 insertions(+), 193 deletions(-)
diff --git a/dlls/dmband/dmband_main.c b/dlls/dmband/dmband_main.c
index e63678c831..baf36a3d6a 100644
--- a/dlls/dmband/dmband_main.c
+++ b/dlls/dmband/dmband_main.c
@@ -19,6 +19,7 @@
#include "dmband_private.h"
#include "rpcproxy.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmband);
diff --git a/dlls/dmband/dmobject.c b/dlls/dmband/dmobject.c
index 3b71a2719c..e0b7eafe25 100644
--- a/dlls/dmband/dmobject.c
+++ b/dlls/dmband/dmobject.c
@@ -25,12 +25,201 @@
#include "objbase.h"
#include "dmusici.h"
#include "dmusicf.h"
+#include "dmusics.h"
#include "dmobject.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmobj);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
+/* Debugging helpers */
+const char *debugstr_dmguid(const GUID *id) {
+ unsigned int i;
+#define X(guid) { &guid, #guid }
+ static const struct {
+ const GUID *guid;
+ const char *name;
+ } guids[] = {
+ /* CLSIDs */
+ X(CLSID_AudioVBScript),
+ X(CLSID_DirectMusic),
+ X(CLSID_DirectMusicAudioPathConfig),
+ X(CLSID_DirectMusicAuditionTrack),
+ X(CLSID_DirectMusicBand),
+ X(CLSID_DirectMusicBandTrack),
+ X(CLSID_DirectMusicChordMapTrack),
+ X(CLSID_DirectMusicChordMap),
+ X(CLSID_DirectMusicChordTrack),
+ X(CLSID_DirectMusicCollection),
+ X(CLSID_DirectMusicCommandTrack),
+ X(CLSID_DirectMusicComposer),
+ X(CLSID_DirectMusicContainer),
+ X(CLSID_DirectMusicGraph),
+ X(CLSID_DirectMusicLoader),
+ X(CLSID_DirectMusicLyricsTrack),
+ X(CLSID_DirectMusicMarkerTrack),
+ X(CLSID_DirectMusicMelodyFormulationTrack),
+ X(CLSID_DirectMusicMotifTrack),
+ X(CLSID_DirectMusicMuteTrack),
+ X(CLSID_DirectMusicParamControlTrack),
+ X(CLSID_DirectMusicPatternTrack),
+ X(CLSID_DirectMusicPerformance),
+ X(CLSID_DirectMusicScript),
+ X(CLSID_DirectMusicScriptAutoImpSegment),
+ X(CLSID_DirectMusicScriptAutoImpPerformance),
+ X(CLSID_DirectMusicScriptAutoImpSegmentState),
+ X(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
+ X(CLSID_DirectMusicScriptAutoImpAudioPath),
+ X(CLSID_DirectMusicScriptAutoImpSong),
+ X(CLSID_DirectMusicScriptSourceCodeLoader),
+ X(CLSID_DirectMusicScriptTrack),
+ X(CLSID_DirectMusicSection),
+ X(CLSID_DirectMusicSegment),
+ X(CLSID_DirectMusicSegmentState),
+ X(CLSID_DirectMusicSegmentTriggerTrack),
+ X(CLSID_DirectMusicSegTriggerTrack),
+ X(CLSID_DirectMusicSeqTrack),
+ X(CLSID_DirectMusicSignPostTrack),
+ X(CLSID_DirectMusicSong),
+ X(CLSID_DirectMusicStyle),
+ X(CLSID_DirectMusicStyleTrack),
+ X(CLSID_DirectMusicSynth),
+ X(CLSID_DirectMusicSynthSink),
+ X(CLSID_DirectMusicSysExTrack),
+ X(CLSID_DirectMusicTemplate),
+ X(CLSID_DirectMusicTempoTrack),
+ X(CLSID_DirectMusicTimeSigTrack),
+ X(CLSID_DirectMusicWaveTrack),
+ X(CLSID_DirectSoundWave),
+ /* IIDs */
+ X(IID_IDirectMusic),
+ X(IID_IDirectMusic2),
+ X(IID_IDirectMusic8),
+ X(IID_IDirectMusicAudioPath),
+ X(IID_IDirectMusicBand),
+ X(IID_IDirectMusicBuffer),
+ X(IID_IDirectMusicChordMap),
+ X(IID_IDirectMusicCollection),
+ X(IID_IDirectMusicComposer),
+ X(IID_IDirectMusicContainer),
+ X(IID_IDirectMusicDownload),
+ X(IID_IDirectMusicDownloadedInstrument),
+ X(IID_IDirectMusicGetLoader),
+ X(IID_IDirectMusicGraph),
+ X(IID_IDirectMusicInstrument),
+ X(IID_IDirectMusicLoader),
+ X(IID_IDirectMusicLoader8),
+ X(IID_IDirectMusicObject),
+ X(IID_IDirectMusicPatternTrack),
+ X(IID_IDirectMusicPerformance),
+ X(IID_IDirectMusicPerformance2),
+ X(IID_IDirectMusicPerformance8),
+ X(IID_IDirectMusicPort),
+ X(IID_IDirectMusicPortDownload),
+ X(IID_IDirectMusicScript),
+ X(IID_IDirectMusicSegment),
+ X(IID_IDirectMusicSegment2),
+ X(IID_IDirectMusicSegment8),
+ X(IID_IDirectMusicSegmentState),
+ X(IID_IDirectMusicSegmentState8),
+ X(IID_IDirectMusicStyle),
+ X(IID_IDirectMusicStyle8),
+ X(IID_IDirectMusicSynth),
+ X(IID_IDirectMusicSynth8),
+ X(IID_IDirectMusicSynthSink),
+ X(IID_IDirectMusicThru),
+ X(IID_IDirectMusicTool),
+ X(IID_IDirectMusicTool8),
+ X(IID_IDirectMusicTrack),
+ X(IID_IDirectMusicTrack8),
+ X(IID_IUnknown),
+ X(IID_IPersistStream),
+ X(IID_IStream),
+ X(IID_IClassFactory),
+ /* GUIDs */
+ X(GUID_DirectMusicAllTypes),
+ X(GUID_NOTIFICATION_CHORD),
+ X(GUID_NOTIFICATION_COMMAND),
+ X(GUID_NOTIFICATION_MEASUREANDBEAT),
+ X(GUID_NOTIFICATION_PERFORMANCE),
+ X(GUID_NOTIFICATION_RECOMPOSE),
+ X(GUID_NOTIFICATION_SEGMENT),
+ X(GUID_BandParam),
+ X(GUID_ChordParam),
+ X(GUID_CommandParam),
+ X(GUID_CommandParam2),
+ X(GUID_CommandParamNext),
+ X(GUID_IDirectMusicBand),
+ X(GUID_IDirectMusicChordMap),
+ X(GUID_IDirectMusicStyle),
+ X(GUID_MuteParam),
+ X(GUID_Play_Marker),
+ X(GUID_RhythmParam),
+ X(GUID_TempoParam),
+ X(GUID_TimeSignature),
+ X(GUID_Valid_Start_Time),
+ X(GUID_Clear_All_Bands),
+ X(GUID_ConnectToDLSCollection),
+ X(GUID_Disable_Auto_Download),
+ X(GUID_DisableTempo),
+ X(GUID_DisableTimeSig),
+ X(GUID_Download),
+ X(GUID_DownloadToAudioPath),
+ X(GUID_Enable_Auto_Download),
+ X(GUID_EnableTempo),
+ X(GUID_EnableTimeSig),
+ X(GUID_IgnoreBankSelectForGM),
+ X(GUID_SeedVariations),
+ X(GUID_StandardMIDIFile),
+ X(GUID_Unload),
+ X(GUID_UnloadFromAudioPath),
+ X(GUID_Variations),
+ X(GUID_PerfMasterTempo),
+ X(GUID_PerfMasterVolume),
+ X(GUID_PerfMasterGrooveLevel),
+ X(GUID_PerfAutoDownload),
+ X(GUID_DefaultGMCollection),
+ X(GUID_Synth_Default),
+ X(GUID_Buffer_Reverb),
+ X(GUID_Buffer_EnvReverb),
+ X(GUID_Buffer_Stereo),
+ X(GUID_Buffer_3D_Dry),
+ X(GUID_Buffer_Mono),
+ X(GUID_DMUS_PROP_GM_Hardware),
+ X(GUID_DMUS_PROP_GS_Capable),
+ X(GUID_DMUS_PROP_GS_Hardware),
+ X(GUID_DMUS_PROP_DLS1),
+ X(GUID_DMUS_PROP_DLS2),
+ X(GUID_DMUS_PROP_Effects),
+ X(GUID_DMUS_PROP_INSTRUMENT2),
+ X(GUID_DMUS_PROP_LegacyCaps),
+ X(GUID_DMUS_PROP_MemorySize),
+ X(GUID_DMUS_PROP_SampleMemorySize),
+ X(GUID_DMUS_PROP_SamplePlaybackRate),
+ X(GUID_DMUS_PROP_SetSynthSink),
+ X(GUID_DMUS_PROP_SinkUsesDSound),
+ X(GUID_DMUS_PROP_SynthSink_DSOUND),
+ X(GUID_DMUS_PROP_SynthSink_WAVE),
+ X(GUID_DMUS_PROP_Volume),
+ X(GUID_DMUS_PROP_WavesReverb),
+ X(GUID_DMUS_PROP_WriteLatency),
+ X(GUID_DMUS_PROP_WritePeriod),
+ X(GUID_DMUS_PROP_XG_Capable),
+ X(GUID_DMUS_PROP_XG_Hardware)
+ };
+#undef X
+
+ if (!id)
+ return "(null)";
+
+ for (i = 0; i < ARRAY_SIZE(guids); i++)
+ if (IsEqualGUID(id, guids[i].guid))
+ return guids[i].name;
+
+ return debugstr_guid(id);
+}
+
+
/* RIFF format parsing */
#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
diff --git a/dlls/dmband/dmobject.h b/dlls/dmband/dmobject.h
index 9e287a4126..1354553665 100644
--- a/dlls/dmband/dmobject.h
+++ b/dlls/dmband/dmobject.h
@@ -107,6 +107,7 @@ HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface,
/* Debugging helpers */
const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+const char *debugstr_dmguid(const GUID *id) DECLSPEC_HIDDEN;
static inline const char *debugstr_fourcc(DWORD fourcc)
{
diff --git a/dlls/dmband/dmutils.c b/dlls/dmband/dmutils.c
index 2401b20a60..1309c7c318 100644
--- a/dlls/dmband/dmutils.c
+++ b/dlls/dmband/dmutils.c
@@ -297,190 +297,6 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface,
return hr;
}
-/* returns name of given GUID */
-const char *debugstr_dmguid (const GUID *id) {
- static const guid_info guids[] = {
- /* CLSIDs */
- GE(CLSID_AudioVBScript),
- GE(CLSID_DirectMusic),
- GE(CLSID_DirectMusicAudioPathConfig),
- GE(CLSID_DirectMusicAuditionTrack),
- GE(CLSID_DirectMusicBand),
- GE(CLSID_DirectMusicBandTrack),
- GE(CLSID_DirectMusicChordMapTrack),
- GE(CLSID_DirectMusicChordMap),
- GE(CLSID_DirectMusicChordTrack),
- GE(CLSID_DirectMusicCollection),
- GE(CLSID_DirectMusicCommandTrack),
- GE(CLSID_DirectMusicComposer),
- GE(CLSID_DirectMusicContainer),
- GE(CLSID_DirectMusicGraph),
- GE(CLSID_DirectMusicLoader),
- GE(CLSID_DirectMusicLyricsTrack),
- GE(CLSID_DirectMusicMarkerTrack),
- GE(CLSID_DirectMusicMelodyFormulationTrack),
- GE(CLSID_DirectMusicMotifTrack),
- GE(CLSID_DirectMusicMuteTrack),
- GE(CLSID_DirectMusicParamControlTrack),
- GE(CLSID_DirectMusicPatternTrack),
- GE(CLSID_DirectMusicPerformance),
- GE(CLSID_DirectMusicScript),
- GE(CLSID_DirectMusicScriptAutoImpSegment),
- GE(CLSID_DirectMusicScriptAutoImpPerformance),
- GE(CLSID_DirectMusicScriptAutoImpSegmentState),
- GE(CLSID_DirectMusicScriptAutoImpAudioPathConfig),
- GE(CLSID_DirectMusicScriptAutoImpAudioPath),
- GE(CLSID_DirectMusicScriptAutoImpSong),
- GE(CLSID_DirectMusicScriptSourceCodeLoader),
- GE(CLSID_DirectMusicScriptTrack),
- GE(CLSID_DirectMusicSection),
- GE(CLSID_DirectMusicSegment),
- GE(CLSID_DirectMusicSegmentState),
- GE(CLSID_DirectMusicSegmentTriggerTrack),
- GE(CLSID_DirectMusicSegTriggerTrack),
- GE(CLSID_DirectMusicSeqTrack),
- GE(CLSID_DirectMusicSignPostTrack),
- GE(CLSID_DirectMusicSong),
- GE(CLSID_DirectMusicStyle),
- GE(CLSID_DirectMusicStyleTrack),
- GE(CLSID_DirectMusicSynth),
- GE(CLSID_DirectMusicSynthSink),
- GE(CLSID_DirectMusicSysExTrack),
- GE(CLSID_DirectMusicTemplate),
- GE(CLSID_DirectMusicTempoTrack),
- GE(CLSID_DirectMusicTimeSigTrack),
- GE(CLSID_DirectMusicWaveTrack),
- GE(CLSID_DirectSoundWave),
- /* IIDs */
- GE(IID_IDirectMusic),
- GE(IID_IDirectMusic2),
- GE(IID_IDirectMusic8),
- GE(IID_IDirectMusicAudioPath),
- GE(IID_IDirectMusicBand),
- GE(IID_IDirectMusicBuffer),
- GE(IID_IDirectMusicChordMap),
- GE(IID_IDirectMusicCollection),
- GE(IID_IDirectMusicComposer),
- GE(IID_IDirectMusicContainer),
- GE(IID_IDirectMusicDownload),
- GE(IID_IDirectMusicDownloadedInstrument),
- GE(IID_IDirectMusicGetLoader),
- GE(IID_IDirectMusicGraph),
- GE(IID_IDirectMusicInstrument),
- GE(IID_IDirectMusicLoader),
- GE(IID_IDirectMusicLoader8),
- GE(IID_IDirectMusicObject),
- GE(IID_IDirectMusicPatternTrack),
- GE(IID_IDirectMusicPerformance),
- GE(IID_IDirectMusicPerformance2),
- GE(IID_IDirectMusicPerformance8),
- GE(IID_IDirectMusicPort),
- GE(IID_IDirectMusicPortDownload),
- GE(IID_IDirectMusicScript),
- GE(IID_IDirectMusicSegment),
- GE(IID_IDirectMusicSegment2),
- GE(IID_IDirectMusicSegment8),
- GE(IID_IDirectMusicSegmentState),
- GE(IID_IDirectMusicSegmentState8),
- GE(IID_IDirectMusicStyle),
- GE(IID_IDirectMusicStyle8),
- GE(IID_IDirectMusicSynth),
- GE(IID_IDirectMusicSynth8),
- GE(IID_IDirectMusicSynthSink),
- GE(IID_IDirectMusicThru),
- GE(IID_IDirectMusicTool),
- GE(IID_IDirectMusicTool8),
- GE(IID_IDirectMusicTrack),
- GE(IID_IDirectMusicTrack8),
- GE(IID_IUnknown),
- GE(IID_IPersistStream),
- GE(IID_IStream),
- GE(IID_IClassFactory),
- /* GUIDs */
- GE(GUID_DirectMusicAllTypes),
- GE(GUID_NOTIFICATION_CHORD),
- GE(GUID_NOTIFICATION_COMMAND),
- GE(GUID_NOTIFICATION_MEASUREANDBEAT),
- GE(GUID_NOTIFICATION_PERFORMANCE),
- GE(GUID_NOTIFICATION_RECOMPOSE),
- GE(GUID_NOTIFICATION_SEGMENT),
- GE(GUID_BandParam),
- GE(GUID_ChordParam),
- GE(GUID_CommandParam),
- GE(GUID_CommandParam2),
- GE(GUID_CommandParamNext),
- GE(GUID_IDirectMusicBand),
- GE(GUID_IDirectMusicChordMap),
- GE(GUID_IDirectMusicStyle),
- GE(GUID_MuteParam),
- GE(GUID_Play_Marker),
- GE(GUID_RhythmParam),
- GE(GUID_TempoParam),
- GE(GUID_TimeSignature),
- GE(GUID_Valid_Start_Time),
- GE(GUID_Clear_All_Bands),
- GE(GUID_ConnectToDLSCollection),
- GE(GUID_Disable_Auto_Download),
- GE(GUID_DisableTempo),
- GE(GUID_DisableTimeSig),
- GE(GUID_Download),
- GE(GUID_DownloadToAudioPath),
- GE(GUID_Enable_Auto_Download),
- GE(GUID_EnableTempo),
- GE(GUID_EnableTimeSig),
- GE(GUID_IgnoreBankSelectForGM),
- GE(GUID_SeedVariations),
- GE(GUID_StandardMIDIFile),
- GE(GUID_Unload),
- GE(GUID_UnloadFromAudioPath),
- GE(GUID_Variations),
- GE(GUID_PerfMasterTempo),
- GE(GUID_PerfMasterVolume),
- GE(GUID_PerfMasterGrooveLevel),
- GE(GUID_PerfAutoDownload),
- GE(GUID_DefaultGMCollection),
- GE(GUID_Synth_Default),
- GE(GUID_Buffer_Reverb),
- GE(GUID_Buffer_EnvReverb),
- GE(GUID_Buffer_Stereo),
- GE(GUID_Buffer_3D_Dry),
- GE(GUID_Buffer_Mono),
- GE(GUID_DMUS_PROP_GM_Hardware),
- GE(GUID_DMUS_PROP_GS_Capable),
- GE(GUID_DMUS_PROP_GS_Hardware),
- GE(GUID_DMUS_PROP_DLS1),
- GE(GUID_DMUS_PROP_DLS2),
- GE(GUID_DMUS_PROP_Effects),
- GE(GUID_DMUS_PROP_INSTRUMENT2),
- GE(GUID_DMUS_PROP_LegacyCaps),
- GE(GUID_DMUS_PROP_MemorySize),
- GE(GUID_DMUS_PROP_SampleMemorySize),
- GE(GUID_DMUS_PROP_SamplePlaybackRate),
- GE(GUID_DMUS_PROP_SetSynthSink),
- GE(GUID_DMUS_PROP_SinkUsesDSound),
- GE(GUID_DMUS_PROP_SynthSink_DSOUND),
- GE(GUID_DMUS_PROP_SynthSink_WAVE),
- GE(GUID_DMUS_PROP_Volume),
- GE(GUID_DMUS_PROP_WavesReverb),
- GE(GUID_DMUS_PROP_WriteLatency),
- GE(GUID_DMUS_PROP_WritePeriod),
- GE(GUID_DMUS_PROP_XG_Capable),
- GE(GUID_DMUS_PROP_XG_Hardware)
- };
-
- unsigned int i;
-
- if (!id) return "(null)";
- for (i = 0; i < ARRAY_SIZE(guids); i++) {
- if (IsEqualGUID(id, guids[i].guid))
- return guids[i].name;
- }
-
- /* if we didn't find it, act like standard debugstr_guid */
- return debugstr_guid(id);
-}
-
-
void debug_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) {
if (pDesc) {
TRACE("DMUS_OBJECTDESC (%p):\n", pDesc);
diff --git a/dlls/dmband/dmutils.h b/dlls/dmband/dmutils.h
index 5a845a81a8..dfa8ac46d6 100644
--- a/dlls/dmband/dmutils.h
+++ b/dlls/dmband/dmutils.h
@@ -43,17 +43,8 @@ typedef struct {
const char* name;
} flag_info;
-typedef struct {
- const GUID *guid;
- const char* name;
-} guid_info;
-
/* used for initialising structs */
#define FE(x) { x, #x }
-#define GE(x) { &x, #x }
-
-/* returns name of given GUID */
-extern const char *debugstr_dmguid (const GUID *id) DECLSPEC_HIDDEN;
extern void debug_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) DECLSPEC_HIDDEN;
--
2.23.0
1
0
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/dmband/dmobject.c | 7 -------
dlls/dmband/dmobject.h | 12 ++++++++++--
dlls/dmband/dmutils.c | 9 +--------
dlls/dmband/dmutils.h | 2 --
4 files changed, 11 insertions(+), 19 deletions(-)
diff --git a/dlls/dmband/dmobject.c b/dlls/dmband/dmobject.c
index 25f3198d2b..3b71a2719c 100644
--- a/dlls/dmband/dmobject.c
+++ b/dlls/dmband/dmobject.c
@@ -34,13 +34,6 @@ WINE_DECLARE_DEBUG_CHANNEL(dmfile);
/* RIFF format parsing */
#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD))
-static inline const char *debugstr_fourcc(DWORD fourcc)
-{
- if (!fourcc) return "''";
- return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
-}
-
const char *debugstr_chunk(const struct chunk_entry *chunk)
{
const char *type = "";
diff --git a/dlls/dmband/dmobject.h b/dlls/dmband/dmobject.h
index 4a721cc152..9e287a4126 100644
--- a/dlls/dmband/dmobject.h
+++ b/dlls/dmband/dmobject.h
@@ -60,8 +60,6 @@ static inline HRESULT stream_reset_chunk_start(IStream *stream, const struct chu
return IStream_Seek(stream, offset, STREAM_SEEK_SET, NULL);
}
-const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
-
/* IDirectMusicObject base object */
struct dmobject {
@@ -106,3 +104,13 @@ HRESULT WINAPI unimpl_IPersistStream_Save(IPersistStream *iface, IStream *stream
BOOL clear_dirty) DECLSPEC_HIDDEN;
HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface,
ULARGE_INTEGER *size) DECLSPEC_HIDDEN;
+
+/* Debugging helpers */
+const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN;
+
+static inline const char *debugstr_fourcc(DWORD fourcc)
+{
+ if (!fourcc) return "''";
+ return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
+ (char)(fourcc >> 16), (char)(fourcc >> 24));
+}
diff --git a/dlls/dmband/dmutils.c b/dlls/dmband/dmutils.c
index af24054bf4..2401b20a60 100644
--- a/dlls/dmband/dmutils.c
+++ b/dlls/dmband/dmutils.c
@@ -40,6 +40,7 @@
#include "dmusics.h"
#include "dmutils.h"
+#include "dmobject.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
WINE_DECLARE_DEBUG_CHANNEL(dmfile);
@@ -296,14 +297,6 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface,
return hr;
}
-/* FOURCC to string conversion for debug messages */
-const char *debugstr_fourcc (DWORD fourcc) {
- if (!fourcc) return "'null'";
- return wine_dbg_sprintf ("\'%c%c%c%c\'",
- (char)(fourcc), (char)(fourcc >> 8),
- (char)(fourcc >> 16), (char)(fourcc >> 24));
-}
-
/* returns name of given GUID */
const char *debugstr_dmguid (const GUID *id) {
static const guid_info guids[] = {
diff --git a/dlls/dmband/dmutils.h b/dlls/dmband/dmutils.h
index bb93e05c2b..5a845a81a8 100644
--- a/dlls/dmband/dmutils.h
+++ b/dlls/dmband/dmutils.h
@@ -52,8 +52,6 @@ typedef struct {
#define FE(x) { x, #x }
#define GE(x) { &x, #x }
-/* FOURCC to string conversion for debug messages */
-extern const char *debugstr_fourcc (DWORD fourcc) DECLSPEC_HIDDEN;
/* returns name of given GUID */
extern const char *debugstr_dmguid (const GUID *id) DECLSPEC_HIDDEN;
--
2.23.0
1
0