@@ -522,21 +522,31 @@ HRESULT STDMETHODCALLTYPE SarClient::NotificationClient::OnDeviceStateChanged(
522522 _In_ LPCWSTR pwstrDeviceId,
523523 _In_ DWORD dwNewState)
524524{
525- OutputDebugString (_T (" OnDeviceStateChanged" ));
525+ std::ostringstream os;
526+
527+ os << " OnDeviceStateChanged(" << TCHARToUTF8 (pwstrDeviceId)
528+ << " , " << dwNewState << " )" ;
529+ OutputDebugStringA (os.str ().c_str ());
526530 return S_OK;
527531}
528532
529533HRESULT STDMETHODCALLTYPE SarClient::NotificationClient::OnDeviceAdded (
530534 _In_ LPCWSTR pwstrDeviceId)
531535{
532- OutputDebugString (_T (" OnDeviceAdded" ));
536+ std::ostringstream os;
537+
538+ os << " OnDeviceAdded(" << TCHARToUTF8 (pwstrDeviceId) << " )" ;
539+ OutputDebugStringA (os.str ().c_str ());
533540 return S_OK;
534541}
535542
536543HRESULT STDMETHODCALLTYPE SarClient::NotificationClient::OnDeviceRemoved (
537544 _In_ LPCWSTR pwstrDeviceId)
538545{
539- OutputDebugString (_T (" OnDeviceRemoved" ));
546+ std::ostringstream os;
547+
548+ os << " OnDeviceRemoved(" << TCHARToUTF8 (pwstrDeviceId) << " )" ;
549+ OutputDebugStringA (os.str ().c_str ());
540550 return S_OK;
541551}
542552
@@ -545,15 +555,25 @@ HRESULT STDMETHODCALLTYPE SarClient::NotificationClient::OnDefaultDeviceChanged(
545555 _In_ ERole role,
546556 _In_ LPCWSTR pwstrDefaultDeviceId)
547557{
548- OutputDebugString (_T (" OnDefaultDeviceChanged" ));
558+ std::ostringstream os;
559+
560+ os << " OnDefaultDeviceChanged(" << flow << " , " << role << " , "
561+ << TCHARToUTF8 (pwstrDefaultDeviceId) << " )" ;
562+ OutputDebugStringA (os.str ().c_str ());
549563 return S_OK;
550564}
551565
552566HRESULT STDMETHODCALLTYPE SarClient::NotificationClient::OnPropertyValueChanged (
553567 _In_ LPCWSTR pwstrDeviceId,
554568 _In_ const PROPERTYKEY key)
555569{
556- OutputDebugString (_T (" OnPropertyValueChanged" ));
570+ std::ostringstream os;
571+ CComBSTR bstr (key.fmtid );
572+ std::wstring wstr (bstr);
573+
574+ os << " OnPropertyValueChanged(" << TCHARToUTF8 (pwstrDeviceId)
575+ << " , " << TCHARToUTF8 (wstr.c_str ()) << " )" ;
576+ OutputDebugStringA (os.str ().c_str ());
557577 return S_OK;
558578}
559579
0 commit comments