Skip to content

Commit

Permalink
Rename m_protocolRegistration ->m_lrpRegistration
Browse files Browse the repository at this point in the history
  • Loading branch information
pmpurifoy committed Feb 24, 2022
1 parent 4629e56 commit d6097f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions dev/PushNotifications/PushNotificationManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ namespace winrt::Microsoft::Windows::PushNotifications::implementation
{
auto lock{ m_lock.lock_shared() };
processName = m_processName.get();
THROW_HR_IF(E_INVALIDARG, m_protocolRegistration);
THROW_HR_IF(E_INVALIDARG, m_lrpRegistration);
}

auto scopeExitToCleanRegistrations{ wil::scope_exit([&]()
Expand All @@ -359,7 +359,7 @@ namespace winrt::Microsoft::Windows::PushNotifications::implementation
auto lock { m_lock.lock_exclusive() };

m_comActivatorRegistration.reset();
m_protocolRegistration = false;
m_lrpRegistration = false;
registering = false;
}

Expand All @@ -383,7 +383,7 @@ namespace winrt::Microsoft::Windows::PushNotifications::implementation
THROW_IF_FAILED(notificationPlatform->RegisterFullTrustApplication(processName.c_str(), GUID_NULL, &unpackagedAppUserModelId));
{
auto lock{ m_lock.lock_exclusive() };
m_protocolRegistration = true;
m_lrpRegistration = true;
}

// Register a sink for the application to receive foreground raw notifications
Expand Down Expand Up @@ -461,15 +461,15 @@ namespace winrt::Microsoft::Windows::PushNotifications::implementation
}
else if (!AppModel::Identity::IsPackagedProcess())
{
THROW_HR_IF_MSG(HRESULT_FROM_WIN32(ERROR_NOT_FOUND), !m_protocolRegistration, "Protocol Activator not registered");
THROW_HR_IF_MSG(HRESULT_FROM_WIN32(ERROR_NOT_FOUND), !m_lrpRegistration, "Not registered with the PushNotificationsLongRunningProcess.");

auto coInitialize{ wil::CoInitializeEx() };

auto notificationPlatform{ PushNotificationHelpers::GetNotificationPlatform() };

LOG_IF_FAILED(notificationPlatform->UnregisterLongRunningActivator(m_processName.get()));

m_protocolRegistration = false;
m_lrpRegistration = false;
}
}
catch (...)
Expand All @@ -484,7 +484,7 @@ namespace winrt::Microsoft::Windows::PushNotifications::implementation
{
{
auto lock{ m_lock.lock_shared() };
THROW_HR_IF_MSG(HRESULT_FROM_WIN32(ERROR_NOT_FOUND), m_comActivatorRegistration || m_protocolRegistration, "Must register event handlers before calling Register().");
THROW_HR_IF_MSG(HRESULT_FROM_WIN32(ERROR_NOT_FOUND), m_comActivatorRegistration || m_lrpRegistration, "Must register event handlers before calling Register().");
}

auto lock{ m_lock.lock_exclusive() };
Expand Down
2 changes: 1 addition & 1 deletion dev/PushNotifications/PushNotificationManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace winrt::Microsoft::Windows::PushNotifications::implementation
winrt::event<PushNotificationEventHandler> m_foregroundHandlers;
winrt::Windows::ApplicationModel::Background::IBackgroundTaskRegistration m_pushTriggerRegistration{ nullptr };
wil::unique_com_class_object_cookie m_comActivatorRegistration;
bool m_protocolRegistration{ false };
bool m_lrpRegistration{ false }; // Defines if the app is registered with the PushNotificationsLongRunningProcess
wil::srwlock m_lock;
wil::unique_cotaskmem_string m_processName;
winrt::guid m_registeredClsid{ GUID_NULL };
Expand Down

0 comments on commit d6097f7

Please sign in to comment.