From: lx-s Date: Wed, 8 Jul 2026 08:41:23 +0000 (+0200) Subject: Fixed double GetInstance. Fixed casts. X-Git-Tag: 2.6.0.0~88 X-Git-Url: https://repos.lx-s.de/gitweb/?a=commitdiff_plain;h=88d22b5ec4e72860070e05e54a8f287e1b348928;p=winmute.git Fixed double GetInstance. Fixed casts. --- diff --git a/WinMute/MMNotificationClient.cpp b/WinMute/MMNotificationClient.cpp index 4579c56..f144ce0 100644 --- a/WinMute/MMNotificationClient.cpp +++ b/WinMute/MMNotificationClient.cpp @@ -67,10 +67,10 @@ STDMETHODIMP_(HRESULT) MMNotificationClient::QueryInterface( { if (IID_IUnknown == riid) { AddRef(); - *ppvInterface = reinterpret_cast(this); + *ppvInterface = static_cast(this); } else if (__uuidof(IMMNotificationClient) == riid) { AddRef(); - *ppvInterface = reinterpret_cast(this); + *ppvInterface = static_cast(this); } else { *ppvInterface = nullptr; return E_NOINTERFACE; @@ -89,7 +89,7 @@ STDMETHODIMP_(HRESULT) MMNotificationClient::OnDeviceAdded(LPCWSTR pwstrDeviceId { if (notifyParent_ && pwstrDeviceId != nullptr) { const auto deviceName = GetDeviceNameFromId(pwstrDeviceId); - WMLog::GetInstance().GetInstance().LogInfo(L"Device \"%s\" added", deviceName.c_str()); + WMLog::GetInstance().LogInfo(L"Device \"%s\" added", deviceName.c_str()); notifyParent_->ShouldReInit(); } return S_OK; @@ -99,7 +99,7 @@ STDMETHODIMP_(HRESULT) MMNotificationClient::OnDeviceRemoved(LPCWSTR pwstrDevice { if (notifyParent_ && pwstrDeviceId != nullptr) { const auto deviceName = GetDeviceNameFromId(pwstrDeviceId); - WMLog::GetInstance().GetInstance().LogInfo(L"Device \"%s\" removed", deviceName.c_str()); + WMLog::GetInstance().LogInfo(L"Device \"%s\" removed", deviceName.c_str()); notifyParent_->ShouldReInit(); } return S_OK; @@ -126,7 +126,7 @@ STDMETHODIMP_(HRESULT) MMNotificationClient::OnDeviceStateChanged( if (notify && notifyParent_) { // TODO: Check if output device const auto deviceName = GetDeviceNameFromId(pwstrDeviceId); - WMLog::GetInstance().GetInstance().LogInfo( + WMLog::GetInstance().LogInfo( L"Device \"%s\" status changed to %s", deviceName.c_str(), what.c_str());