From: Alex Henrie alexhenrie24@gmail.com
These will replace Wine's 14 copies of debugstr_hstring. --- include/wine/debug.h | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/include/wine/debug.h b/include/wine/debug.h index c20924818dd..5581c3e1979 100644 --- a/include/wine/debug.h +++ b/include/wine/debug.h @@ -38,6 +38,9 @@ extern "C" { #endif
struct _GUID; +struct HSTRING__; + +const WCHAR * WINAPI WindowsGetStringRawBuffer(struct HSTRING__ *str, UINT32 *len);
/* * Internal definitions (do not use these directly) @@ -305,6 +308,15 @@ static inline const char *wine_dbgstr_w( const WCHAR *s ) return wine_dbgstr_wn( s, -1 ); }
+static inline const char *wine_dbgstr_h( struct HSTRING__ *hstr ) +{ + const WCHAR *str; + UINT32 len; + if (hstr && !((ULONG_PTR)hstr >> 16)) return "(invalid)"; + str = WindowsGetStringRawBuffer( hstr, &len ); + return wine_dbgstr_wn( str, len ); +} + static inline const char *wine_dbgstr_guid( const GUID *id ) { if (!id) return "(null)"; @@ -497,6 +509,7 @@ static inline const char *debugstr_wn( const WCHAR *s, int n ) { return wine_dbg static inline const char *debugstr_guid( const struct _GUID *id ) { return wine_dbgstr_guid(id); } static inline const char *debugstr_a( const char *s ) { return wine_dbgstr_an( s, -1 ); } static inline const char *debugstr_w( const WCHAR *s ) { return wine_dbgstr_wn( s, -1 ); } +static inline const char *debugstr_h( struct HSTRING__ *s ) { return wine_dbgstr_h( s ); }
#if defined(__oaidl_h__) && defined(V_VT) static inline const char *debugstr_vt( VARTYPE vt ) { return wine_dbgstr_vt( vt ); }