These replace Wine's 14 copies of debugstr_hstring.
-- v3: wintypes: Replace debugstr_hstring with debugstr_h. windows.ui: Replace debugstr_hstring with debugstr_h. windows.system.profile.systemmanufacturers: Replace debugstr_hstring with debugstr_h. windows.perception.stub: Replace debugstr_hstring with debugstr_h. windows.networking: Replace debugstr_hstring with debugstr_h. windows.media: Replace debugstr_hstring with debugstr_h. windows.media.speech/tests: Replace debugstr_hstring with debugstr_h. windows.media.speech: Replace debugstr_hstring with debugstr_h. windows.globalization: Replace debugstr_hstring with debugstr_h. windows.devices.enumeration: Replace debugstr_hstring with debugstr_h. threadpoolwinrt: Replace debugstr_hstring with debugstr_h. graphicscapture: Replace debugstr_hstring with debugstr_h. cryptowinrt: Replace debugstr_hstring with debugstr_h. combase: Replace debugstr_hstring with debugstr_h. include: Introduce wine_dbgstr_h and debugstr_h.
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 ); }
From: Alex Henrie alexhenrie24@gmail.com
--- dlls/combase/roapi.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-)
diff --git a/dlls/combase/roapi.c b/dlls/combase/roapi.c index 78f35de39d4..ded9a02037c 100644 --- a/dlls/combase/roapi.c +++ b/dlls/combase/roapi.c @@ -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; @@ -158,7 +149,7 @@ HRESULT WINAPI RoGetActivationFactory(HSTRING classid, REFIID iid, void **class_ HMODULE module; HRESULT hr;
- FIXME("(%s, %s, %p): semi-stub\n", debugstr_hstring(classid), debugstr_guid(iid), class_factory); + FIXME("(%s, %s, %p): semi-stub\n", debugstr_h(classid), debugstr_guid(iid), class_factory);
if (!iid || !class_factory) return E_INVALIDARG; @@ -166,7 +157,7 @@ HRESULT WINAPI RoGetActivationFactory(HSTRING classid, REFIID iid, void **class_ hr = get_library_for_classid(WindowsGetStringRawBuffer(classid, NULL), &library); if (FAILED(hr)) { - ERR("Failed to find library for %s\n", debugstr_hstring(classid)); + ERR("Failed to find library for %s\n", debugstr_h(classid)); return hr; }
@@ -184,7 +175,7 @@ HRESULT WINAPI RoGetActivationFactory(HSTRING classid, REFIID iid, void **class_ goto done; }
- TRACE("Found library %s for class %s\n", debugstr_w(library), debugstr_hstring(classid)); + TRACE("Found library %s for class %s\n", debugstr_w(library), debugstr_h(classid));
hr = pDllGetActivationFactory(classid, &factory); if (SUCCEEDED(hr)) @@ -307,7 +298,7 @@ HRESULT WINAPI GetRestrictedErrorInfo(IRestrictedErrorInfo **info) */ BOOL WINAPI RoOriginateLanguageException(HRESULT error, HSTRING message, IUnknown *language_exception) { - FIXME("%#lx, %s, %p: stub\n", error, debugstr_hstring(message), language_exception); + FIXME("%#lx, %s, %p: stub\n", error, debugstr_h(message), language_exception); return FALSE; }
@@ -316,7 +307,7 @@ BOOL WINAPI RoOriginateLanguageException(HRESULT error, HSTRING message, IUnknow */ BOOL WINAPI RoOriginateError(HRESULT error, HSTRING message) { - FIXME("%#lx, %s: stub\n", error, debugstr_hstring(message)); + FIXME("%#lx, %s: stub\n", error, debugstr_h(message)); return FALSE; }
@@ -342,7 +333,7 @@ void WINAPI CleanupTlsOleState(void *unknown) */ HRESULT WINAPI DllGetActivationFactory(HSTRING classid, IActivationFactory **factory) { - FIXME("(%s, %p): stub\n", debugstr_hstring(classid), factory); + FIXME("(%s, %p): stub\n", debugstr_h(classid), factory);
return REGDB_E_CLASSNOTREG; }
From: Alex Henrie alexhenrie24@gmail.com
--- dlls/cryptowinrt/credentials.c | 6 +++--- dlls/cryptowinrt/main.c | 11 +---------- dlls/cryptowinrt/private.h | 2 -- 3 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/dlls/cryptowinrt/credentials.c b/dlls/cryptowinrt/credentials.c index e23c5d94696..bed91505630 100644 --- a/dlls/cryptowinrt/credentials.c +++ b/dlls/cryptowinrt/credentials.c @@ -140,20 +140,20 @@ static HRESULT WINAPI credentials_statics_RenewAttestationAsync( IKeyCredentialM static HRESULT WINAPI credentials_statics_RequestCreateAsync( IKeyCredentialManagerStatics *iface, HSTRING name, KeyCredentialCreationOption option, IAsyncOperation_KeyCredentialRetrievalResult **value ) { - FIXME( "iface %p, name %s, %d option, %p value stub!\n", iface, debugstr_hstring(name), option, value ); + FIXME( "iface %p, name %s, %d option, %p value stub!\n", iface, debugstr_h(name), option, value ); return E_NOTIMPL; }
static HRESULT WINAPI credentials_statics_OpenAsync(IKeyCredentialManagerStatics *iface, HSTRING name, IAsyncOperation_KeyCredentialRetrievalResult **value) { - FIXME( "iface %p, name %s, %p value stub!\n", iface, debugstr_hstring(name), value ); + FIXME( "iface %p, name %s, %p value stub!\n", iface, debugstr_h(name), value ); return E_NOTIMPL; }
static HRESULT WINAPI credentials_statics_DeleteAsync( IKeyCredentialManagerStatics *iface, HSTRING name, IAsyncAction **operation ) { - FIXME( "iface %p, name %s, %p operation stub!\n", iface, debugstr_hstring(name), operation ); + FIXME( "iface %p, name %s, %p operation stub!\n", iface, debugstr_h(name), operation ); return E_NOTIMPL; }
diff --git a/dlls/cryptowinrt/main.c b/dlls/cryptowinrt/main.c index 5f28382eba9..5693e9f5694 100644 --- a/dlls/cryptowinrt/main.c +++ b/dlls/cryptowinrt/main.c @@ -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; @@ -276,7 +267,7 @@ HRESULT WINAPI DllGetActivationFactory(HSTRING classid, IActivationFactory **fac { const WCHAR *name = WindowsGetStringRawBuffer(classid, NULL);
- TRACE("classid %s, factory %p.\n", debugstr_hstring(classid), factory); + TRACE("classid %s, factory %p.\n", debugstr_h(classid), factory);
*factory = NULL;
diff --git a/dlls/cryptowinrt/private.h b/dlls/cryptowinrt/private.h index b1c195123f3..3ce3620118c 100644 --- a/dlls/cryptowinrt/private.h +++ b/dlls/cryptowinrt/private.h @@ -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 );
From: Alex Henrie alexhenrie24@gmail.com
--- dlls/graphicscapture/main.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/dlls/graphicscapture/main.c b/dlls/graphicscapture/main.c index 42584fef329..30cf1bae5ce 100644 --- a/dlls/graphicscapture/main.c +++ b/dlls/graphicscapture/main.c @@ -24,20 +24,11 @@
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 );
- TRACE( "class %s, factory %p.\n", debugstr_hstring(classid), factory ); + TRACE( "class %s, factory %p.\n", debugstr_h(classid), factory );
*factory = NULL;
From: Alex Henrie alexhenrie24@gmail.com
--- dlls/threadpoolwinrt/main.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/dlls/threadpoolwinrt/main.c b/dlls/threadpoolwinrt/main.c index fb59a777e30..0100893e582 100644 --- a/dlls/threadpoolwinrt/main.c +++ b/dlls/threadpoolwinrt/main.c @@ -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; @@ -625,7 +616,7 @@ HRESULT WINAPI DllGetActivationFactory(HSTRING classid, IActivationFactory **fac { const WCHAR *name = WindowsGetStringRawBuffer(classid, NULL);
- TRACE("classid %s, factory %p.\n", debugstr_hstring(classid), factory); + TRACE("classid %s, factory %p.\n", debugstr_h(classid), factory);
*factory = NULL;
From: Alex Henrie alexhenrie24@gmail.com
--- dlls/windows.devices.enumeration/access.c | 2 +- dlls/windows.devices.enumeration/main.c | 17 ++++------------- dlls/windows.devices.enumeration/private.h | 2 -- 3 files changed, 5 insertions(+), 16 deletions(-)
diff --git a/dlls/windows.devices.enumeration/access.c b/dlls/windows.devices.enumeration/access.c index 1056b734029..4435deef764 100644 --- a/dlls/windows.devices.enumeration/access.c +++ b/dlls/windows.devices.enumeration/access.c @@ -249,7 +249,7 @@ DEFINE_IINSPECTABLE( statics, IDeviceAccessInformationStatics, struct device_acc static HRESULT WINAPI statics_CreateFromId( IDeviceAccessInformationStatics *iface, HSTRING device_id, IDeviceAccessInformation **value) { - FIXME( "device_id %s, value %p stub.\n", debugstr_hstring( device_id ), value ); + FIXME( "device_id %s, value %p stub.\n", debugstr_h( device_id ), value );
return device_access_information_create( value ); } diff --git a/dlls/windows.devices.enumeration/main.c b/dlls/windows.devices.enumeration/main.c index 03bca4f0118..4d6bf92a6d8 100644 --- a/dlls/windows.devices.enumeration/main.c +++ b/dlls/windows.devices.enumeration/main.c @@ -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; @@ -330,7 +321,7 @@ static HRESULT WINAPI device_statics2_CreateFromIdAsync( IDeviceInformationStati IAsyncOperation_DeviceInformation **async_operation ) { FIXME( "iface %p, device_id %s, additional_properties %p, kind %u, async_operation %p stub!\n", - iface, debugstr_hstring( device_id ), additional_properties, kind, async_operation ); + iface, debugstr_h( device_id ), additional_properties, kind, async_operation ); return E_NOTIMPL; }
@@ -339,7 +330,7 @@ static HRESULT WINAPI device_statics2_FindAllAsync( IDeviceInformationStatics2 * IAsyncOperation_DeviceInformationCollection **async_operation ) { FIXME( "iface %p, filter %s, additional_properties %p, kind %u, async_operation %p stub!\n", - iface, debugstr_hstring( filter ), additional_properties, kind, async_operation ); + iface, debugstr_h( filter ), additional_properties, kind, async_operation ); return E_NOTIMPL; }
@@ -350,7 +341,7 @@ static HRESULT WINAPI device_statics2_CreateWatcher( IDeviceInformationStatics2 struct device_watcher *this;
FIXME( "iface %p, filter %s, additional_properties %p, kind %u, watcher %p semi-stub!\n", - iface, debugstr_hstring( filter ), additional_properties, kind, watcher ); + iface, debugstr_h( filter ), additional_properties, kind, watcher );
if (!(this = calloc( 1, sizeof(*this) ))) return E_OUTOFMEMORY; @@ -397,7 +388,7 @@ HRESULT WINAPI DllGetActivationFactory( HSTRING classid, IActivationFactory **fa { const WCHAR *buffer = WindowsGetStringRawBuffer( classid, NULL );
- TRACE( "classid %s, factory %p.\n", debugstr_hstring( classid ), factory ); + TRACE( "classid %s, factory %p.\n", debugstr_h( classid ), factory );
*factory = NULL;
diff --git a/dlls/windows.devices.enumeration/private.h b/dlls/windows.devices.enumeration/private.h index dd06b25926e..06234e984e0 100644 --- a/dlls/windows.devices.enumeration/private.h +++ b/dlls/windows.devices.enumeration/private.h @@ -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 );
From: Alex Henrie alexhenrie24@gmail.com
--- dlls/windows.globalization/main.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/dlls/windows.globalization/main.c b/dlls/windows.globalization/main.c index d5a5895938f..97d7259d62d 100644 --- a/dlls/windows.globalization/main.c +++ b/dlls/windows.globalization/main.c @@ -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; @@ -739,7 +730,7 @@ HRESULT WINAPI DllGetActivationFactory(HSTRING classid, IActivationFactory **fac { const WCHAR *name = WindowsGetStringRawBuffer(classid, NULL);
- TRACE("classid %s, factory %p.\n", debugstr_hstring(classid), factory); + TRACE("classid %s, factory %p.\n", debugstr_h(classid), factory);
*factory = NULL;
From: Alex Henrie alexhenrie24@gmail.com
--- dlls/windows.media.devices/main.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/dlls/windows.media.devices/main.c b/dlls/windows.media.devices/main.c index 0bec5f2ea46..6e06334f65b 100644 --- a/dlls/windows.media.devices/main.c +++ b/dlls/windows.media.devices/main.c @@ -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){ @@ -376,7 +367,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, void **out)
HRESULT WINAPI DllGetActivationFactory(HSTRING classid, IActivationFactory **factory) { - TRACE("classid %s, factory %p.\n", debugstr_hstring(classid), factory); + TRACE("classid %s, factory %p.\n", debugstr_h(classid), factory); *factory = &windows_media_devices.IActivationFactory_iface; IUnknown_AddRef(*factory); return S_OK;
From: Alex Henrie alexhenrie24@gmail.com
--- dlls/windows.media.speech/tests/speech.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index fb0fa9e3b4d..4e005bd2d05 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -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; @@ -909,7 +900,7 @@ static void test_SpeechSynthesizer(void) if (hr == S_OK) { IVoiceInformation_get_Description(voice, &str2); - trace("SpeechSynthesizer default voice %s.\n", debugstr_hstring(str2)); + trace("SpeechSynthesizer default voice %s.\n", debugstr_h(str2));
WindowsDeleteString(str2); ref = IVoiceInformation_Release(voice); @@ -1169,7 +1160,7 @@ static void test_SpeechRecognizer(void) hr = ILanguage_get_LanguageTag(language, &hstr_lang); ok(hr == S_OK, "ILanguage_get_LanguageTag failed, hr %#lx.\n", hr);
- trace("SpeechRecognizer default language %s.\n", debugstr_hstring(hstr_lang)); + trace("SpeechRecognizer default language %s.\n", debugstr_h(hstr_lang));
ILanguage_Release(language); }
From: Alex Henrie alexhenrie24@gmail.com
--- dlls/windows.media/captions.c | 9 --------- dlls/windows.media/main.c | 2 +- dlls/windows.media/private.h | 2 -- 3 files changed, 1 insertion(+), 12 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index b7e07710603..d48445690d8 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -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; diff --git a/dlls/windows.media/main.c b/dlls/windows.media/main.c index 7c0ea0e5b62..d0cc3ef204c 100644 --- a/dlls/windows.media/main.c +++ b/dlls/windows.media/main.c @@ -34,7 +34,7 @@ HRESULT WINAPI DllGetActivationFactory(HSTRING classid, IActivationFactory **fac { const WCHAR *buffer = WindowsGetStringRawBuffer( classid, NULL );
- TRACE( "class %s, factory %p.\n", debugstr_hstring(classid), factory ); + TRACE( "class %s, factory %p.\n", debugstr_h(classid), factory );
*factory = NULL;
diff --git a/dlls/windows.media/private.h b/dlls/windows.media/private.h index d6353dede56..f8756dadd47 100644 --- a/dlls/windows.media/private.h +++ b/dlls/windows.media/private.h @@ -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 ) \
From: Alex Henrie alexhenrie24@gmail.com
--- dlls/windows.networking/main.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/dlls/windows.networking/main.c b/dlls/windows.networking/main.c index 84097881b6b..85a3ef0d6cb 100644 --- a/dlls/windows.networking/main.c +++ b/dlls/windows.networking/main.c @@ -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); @@ -40,7 +31,7 @@ HRESULT WINAPI SetSocketMediaStreamingMode(BOOL value)
HRESULT WINAPI DllGetActivationFactory(HSTRING classid, void **factory) { - FIXME("class %s, factory %p.\n", debugstr_hstring(classid), factory); + FIXME("class %s, factory %p.\n", debugstr_h(classid), factory);
*factory = NULL;
From: Alex Henrie alexhenrie24@gmail.com
--- dlls/windows.perception.stub/main.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/dlls/windows.perception.stub/main.c b/dlls/windows.perception.stub/main.c index 4403c9cfb3f..23063148b61 100644 --- a/dlls/windows.perception.stub/main.c +++ b/dlls/windows.perception.stub/main.c @@ -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 ); @@ -43,7 +34,7 @@ HRESULT WINAPI DllGetActivationFactory( HSTRING classid, IActivationFactory **fa { const WCHAR *buffer = WindowsGetStringRawBuffer( classid, NULL );
- TRACE( "class %s, factory %p.\n", debugstr_hstring(classid), factory ); + TRACE( "class %s, factory %p.\n", debugstr_h(classid), factory );
*factory = NULL;
From: Alex Henrie alexhenrie24@gmail.com
--- .../windows.system.profile.systemmanufacturers/main.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/dlls/windows.system.profile.systemmanufacturers/main.c b/dlls/windows.system.profile.systemmanufacturers/main.c index d2feb32054e..ff9499cc829 100644 --- a/dlls/windows.system.profile.systemmanufacturers/main.c +++ b/dlls/windows.system.profile.systemmanufacturers/main.c @@ -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; @@ -224,7 +215,7 @@ HRESULT WINAPI DllGetActivationFactory( HSTRING classid, IActivationFactory **fa { const WCHAR *name = WindowsGetStringRawBuffer( classid, NULL );
- TRACE( "classid %s, factory %p.\n", debugstr_hstring(classid), factory ); + TRACE( "classid %s, factory %p.\n", debugstr_h(classid), factory );
*factory = NULL;
From: Alex Henrie alexhenrie24@gmail.com
--- dlls/windows.ui/main.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/dlls/windows.ui/main.c b/dlls/windows.ui/main.c index 8896e0d1e71..82753a1365b 100644 --- a/dlls/windows.ui/main.c +++ b/dlls/windows.ui/main.c @@ -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 ); @@ -43,7 +34,7 @@ HRESULT WINAPI DllGetActivationFactory( HSTRING classid, IActivationFactory **fa { const WCHAR *buffer = WindowsGetStringRawBuffer( classid, NULL );
- TRACE( "class %s, factory %p.\n", debugstr_hstring(classid), factory ); + TRACE( "class %s, factory %p.\n", debugstr_h(classid), factory );
*factory = NULL;
From: Alex Henrie alexhenrie24@gmail.com
--- dlls/wintypes/main.c | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-)
diff --git a/dlls/wintypes/main.c b/dlls/wintypes/main.c index e48a1b487a6..8feeb05578c 100644 --- a/dlls/wintypes/main.c +++ b/dlls/wintypes/main.c @@ -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; @@ -192,7 +182,7 @@ static HRESULT STDMETHODCALLTYPE api_information_statics_GetTrustLevel( static HRESULT STDMETHODCALLTYPE api_information_statics_IsTypePresent( IApiInformationStatics *iface, HSTRING type_name, BOOLEAN *value) { - FIXME("iface %p, type_name %s, value %p stub!\n", iface, debugstr_hstring(type_name), value); + FIXME("iface %p, type_name %s, value %p stub!\n", iface, debugstr_h(type_name), value);
if (!type_name) return E_INVALIDARG; @@ -204,7 +194,7 @@ static HRESULT STDMETHODCALLTYPE api_information_statics_IsMethodPresent( IApiInformationStatics *iface, HSTRING type_name, HSTRING method_name, BOOLEAN *value) { FIXME("iface %p, type_name %s, method_name %s, value %p stub!\n", iface, - debugstr_hstring(type_name), debugstr_hstring(method_name), value); + debugstr_h(type_name), debugstr_h(method_name), value);
if (!type_name) return E_INVALIDARG; @@ -217,7 +207,7 @@ static HRESULT STDMETHODCALLTYPE api_information_statics_IsMethodPresentWithArit UINT32 input_parameter_count, BOOLEAN *value) { FIXME("iface %p, type_name %s, method_name %s, input_parameter_count %u, value %p stub!\n", - iface, debugstr_hstring(type_name), debugstr_hstring(method_name), + iface, debugstr_h(type_name), debugstr_h(method_name), input_parameter_count, value);
if (!type_name) @@ -230,7 +220,7 @@ static HRESULT STDMETHODCALLTYPE api_information_statics_IsEventPresent( IApiInformationStatics *iface, HSTRING type_name, HSTRING event_name, BOOLEAN *value) { FIXME("iface %p, type_name %s, event_name %s, value %p stub!\n", iface, - debugstr_hstring(type_name), debugstr_hstring(event_name), value); + debugstr_h(type_name), debugstr_h(event_name), value);
if (!type_name) return E_INVALIDARG; @@ -242,7 +232,7 @@ static HRESULT STDMETHODCALLTYPE api_information_statics_IsPropertyPresent( IApiInformationStatics *iface, HSTRING type_name, HSTRING property_name, BOOLEAN *value) { FIXME("iface %p, type_name %s, property_name %s, value %p stub!\n", iface, - debugstr_hstring(type_name), debugstr_hstring(property_name), value); + debugstr_h(type_name), debugstr_h(property_name), value);
if (!type_name) return E_INVALIDARG; @@ -255,7 +245,7 @@ static HRESULT STDMETHODCALLTYPE api_information_statics_IsReadOnlyPropertyPrese BOOLEAN *value) { FIXME("iface %p, type_name %s, property_name %s, value %p stub!\n", iface, - debugstr_hstring(type_name), debugstr_hstring(property_name), value); + debugstr_h(type_name), debugstr_h(property_name), value);
if (!type_name) return E_INVALIDARG; @@ -267,7 +257,7 @@ static HRESULT STDMETHODCALLTYPE api_information_statics_IsWriteablePropertyPres IApiInformationStatics *iface, HSTRING type_name, HSTRING property_name, BOOLEAN *value) { FIXME("iface %p, type_name %s, property_name %s, value %p stub!\n", iface, - debugstr_hstring(type_name), debugstr_hstring(property_name), value); + debugstr_h(type_name), debugstr_h(property_name), value);
if (!type_name) return E_INVALIDARG; @@ -279,7 +269,7 @@ static HRESULT STDMETHODCALLTYPE api_information_statics_IsEnumNamedValuePresent IApiInformationStatics *iface, HSTRING enum_type_name, HSTRING value_name, BOOLEAN *value) { FIXME("iface %p, enum_type_name %s, value_name %s, value %p stub!\n", iface, - debugstr_hstring(enum_type_name), debugstr_hstring(value_name), value); + debugstr_h(enum_type_name), debugstr_h(value_name), value);
if (!enum_type_name) return E_INVALIDARG; @@ -291,7 +281,7 @@ static HRESULT STDMETHODCALLTYPE api_information_statics_IsApiContractPresentByM IApiInformationStatics *iface, HSTRING contract_name, UINT16 major_version, BOOLEAN *value) { FIXME("iface %p, contract_name %s, major_version %u, value %p stub!\n", iface, - debugstr_hstring(contract_name), major_version, value); + debugstr_h(contract_name), major_version, value);
if (!contract_name) return E_INVALIDARG; @@ -305,7 +295,7 @@ static HRESULT STDMETHODCALLTYPE api_information_statics_IsApiContractPresentByM UINT16 minor_version, BOOLEAN *value) { FIXME("iface %p, contract_name %s, major_version %u, minor_version %u, value %p stub!\n", iface, - debugstr_hstring(contract_name), major_version, minor_version, value); + debugstr_h(contract_name), major_version, minor_version, value);
if (!contract_name) return E_INVALIDARG; @@ -350,7 +340,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, void **out)
HRESULT WINAPI DllGetActivationFactory(HSTRING classid, IActivationFactory **factory) { - TRACE("classid %s, factory %p.\n", debugstr_hstring(classid), factory); + TRACE("classid %s, factory %p.\n", debugstr_h(classid), factory); *factory = &wintypes.IActivationFactory_iface; IUnknown_AddRef(*factory); return S_OK; @@ -369,7 +359,7 @@ HRESULT WINAPI RoResolveNamespace(HSTRING name, HSTRING windowsMetaDataDir, DWORD *subNamespacesCount, HSTRING **subNamespaces) { FIXME("name %s, windowsMetaDataDir %s, metaDataFilePaths %p, subNamespaces %p stub!\n", - debugstr_hstring(name), debugstr_hstring(windowsMetaDataDir), + debugstr_h(name), debugstr_h(windowsMetaDataDir), metaDataFilePaths, subNamespaces);
if (!metaDataFilePaths && !subNamespaces)
This merge request was approved by Mohamad Al-Jaf.
Please keep the existing debugstr_hstring name.
Also this should only be defined when the corresponding headers have been included, similarly to debugstr_variant.