include: Introduce wine_dbgstr_hstring and debugstr_hstring.

This commit is contained in:
Alex Henrie 2023-07-04 12:33:55 -06:00 committed by Alexandre Julliard
parent 7e366d46b2
commit f4a8ad89d4
21 changed files with 13 additions and 153 deletions

View file

@ -28,15 +28,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(combase);
static const char *debugstr_hstring(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);
}
struct activatable_class_data
{
ULONG size;

View file

@ -31,15 +31,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(crypto);
const char *debugstr_hstring(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);
}
struct cryptobuffer_factory
{
IActivationFactory IActivationFactory_iface;

View file

@ -39,8 +39,6 @@
#include "provider.h"
extern const char *debugstr_hstring( HSTRING hstr );
extern IActivationFactory *credentials_activation_factory;
typedef HRESULT (WINAPI *async_operation_callback)( IUnknown *invoker, IUnknown *param, PROPVARIANT *result );

View file

@ -24,15 +24,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(graphicscapture);
static const char *debugstr_hstring( 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 );
}
HRESULT WINAPI DllGetActivationFactory( HSTRING classid, IActivationFactory **factory )
{
const WCHAR *buffer = WindowsGetStringRawBuffer( classid, NULL );

View file

@ -37,15 +37,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(threadpool);
static const char *debugstr_hstring(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);
}
struct threadpool_factory
{
IActivationFactory IActivationFactory_iface;

View file

@ -24,15 +24,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(bluetooth);
const char *debugstr_hstring( 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 );
}
HRESULT WINAPI DllGetClassObject( REFCLSID clsid, REFIID riid, void **out )
{
FIXME( "clsid %s, riid %s, out %p stub!\n", debugstr_guid(clsid), debugstr_guid(riid), out );

View file

@ -35,8 +35,6 @@
#define WIDL_using_Windows_Devices_Bluetooth
#include "windows.devices.bluetooth.h"
extern const char *debugstr_hstring( HSTRING hstr );
extern IActivationFactory *bluetoothadapter_factory;
#define DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from, iface_mem, expr ) \

View file

@ -34,15 +34,6 @@
#include "wine/test.h"
const char *debugstr_hstring( 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 );
}
#define check_interface( obj, iid ) check_interface_( __LINE__, obj, iid )
static void check_interface_( unsigned int line, void *obj, const IID *iid )
{

View file

@ -25,15 +25,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(enumeration);
const char *debugstr_hstring( 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 );
}
struct device_watcher
{
IDeviceWatcher IDeviceWatcher_iface;

View file

@ -41,8 +41,6 @@
extern IActivationFactory *device_access_factory;
extern const char *debugstr_hstring( HSTRING hstr );
HRESULT typed_event_handlers_append( struct list *list, ITypedEventHandler_IInspectable_IInspectable *handler, EventRegistrationToken *token );
HRESULT typed_event_handlers_remove( struct list *list, EventRegistrationToken *token );
HRESULT typed_event_handlers_notify( struct list *list, IInspectable *sender, IInspectable *args );

View file

@ -39,15 +39,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(locale);
static const char *debugstr_hstring(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);
}
struct hstring_vector
{
IVectorView_HSTRING IVectorView_HSTRING_iface;

View file

@ -39,15 +39,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(mmdevapi);
static const char *debugstr_hstring(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 ERole AudioDeviceRole_to_ERole(AudioDeviceRole role)
{
switch(role){

View file

@ -91,15 +91,6 @@ static void check_interface_(unsigned int line, void *obj, const IID *iid, BOOL
IUnknown_Release(unk);
}
static const char *debugstr_hstring(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);
}
struct completed_event_handler
{
IHandler_RecognitionCompleted IHandler_RecognitionCompleted_iface;

View file

@ -23,15 +23,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(media);
const char *debugstr_hstring( 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 );
}
struct captions_statics
{
IActivationFactory IActivationFactory_iface;

View file

@ -37,8 +37,6 @@
#define WIDL_using_Windows_Media_ClosedCaptioning
#include "windows.media.closedcaptioning.h"
extern const char *debugstr_hstring( HSTRING hstr );
extern IActivationFactory *captions_factory;
#define DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from, iface_mem, expr ) \

View file

@ -23,15 +23,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(winsock);
static const char *debugstr_hstring(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);
}
HRESULT WINAPI SetSocketMediaStreamingMode(BOOL value)
{
FIXME("value %d stub!\n", value);

View file

@ -24,15 +24,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(perception);
static const char *debugstr_hstring( 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 );
}
HRESULT WINAPI DllGetClassObject( REFCLSID clsid, REFIID riid, void **out )
{
FIXME( "clsid %s, riid %s, out %p stub!\n", debugstr_guid(clsid), debugstr_guid(riid), out );

View file

@ -24,15 +24,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(smbios);
static const char *debugstr_hstring( 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);
}
struct smbios_statics
{
IActivationFactory IActivationFactory_iface;

View file

@ -24,15 +24,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(ui);
static const char *debugstr_hstring( 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 );
}
HRESULT WINAPI DllGetClassObject( REFCLSID clsid, REFIID riid, void **out )
{
FIXME( "clsid %s, riid %s, out %p stub!\n", debugstr_guid(clsid), debugstr_guid(riid), out );

View file

@ -34,16 +34,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(wintypes);
static const char *debugstr_hstring(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);
}
struct wintypes
{
IActivationFactory IActivationFactory_iface;

View file

@ -305,6 +305,15 @@ static inline const char *wine_dbgstr_w( const WCHAR *s )
return wine_dbgstr_wn( s, -1 );
}
#if defined(__hstring_h__) && defined(__WINSTRING_H_)
static inline const char *wine_dbgstr_hstring( HSTRING hstr )
{
UINT32 len;
const WCHAR *str = WindowsGetStringRawBuffer( hstr, &len );
return wine_dbgstr_wn( str, len );
}
#endif
static inline const char *wine_dbgstr_guid( const GUID *id )
{
if (!id) return "(null)";
@ -498,6 +507,10 @@ static inline const char *debugstr_guid( const struct _GUID *id ) { return wine_
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 ); }
#if defined(__hstring_h__) && defined(__WINSTRING_H_)
static inline const char *debugstr_hstring( struct HSTRING__ *s ) { return wine_dbgstr_hstring( s ); }
#endif
#if defined(__oaidl_h__) && defined(V_VT)
static inline const char *debugstr_vt( VARTYPE vt ) { return wine_dbgstr_vt( vt ); }
static inline const char *debugstr_variant( const VARIANT *v ) { return wine_dbgstr_variant( v ); }