Skip to content

Commit edfe7a0

Browse files
committed
Update PushNotificationManager::PushReceived error code from ERROR_NOT_FOUND to ERROR_INVALID_HANDLE
1 parent 7990252 commit edfe7a0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

dev/PushNotifications/PushNotificationManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ namespace winrt::Microsoft::Windows::PushNotifications::implementation
751751

752752
{
753753
auto lock{ m_lock.lock_shared() };
754-
THROW_HR_IF_MSG(HRESULT_FROM_WIN32(ERROR_NOT_FOUND), m_comActivatorRegistration || m_singletonLongRunningSinkRegistration, "Must register event handlers before calling Register().");
754+
THROW_HR_IF_MSG(HRESULT_FROM_WIN32(ERROR_INVALID_HANDLE), m_comActivatorRegistration || m_singletonLongRunningSinkRegistration, "Must register event handlers before calling Register().");
755755
}
756756

757757
auto lock{ m_lock.lock_exclusive() };

test/PushNotificationTests/BaseTestSuite.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation and Contributors. All rights reserved.
1+
// Copyright (c) Microsoft Corporation and Contributors. All rights reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

44
#include "pch.h"
@@ -279,7 +279,7 @@ void BaseTestSuite::VerifyForegroundHandlerFails()
279279
RegisterWithPushNotificationManager();
280280
if (PushNotificationManager::Default().IsSupported())
281281
{
282-
VERIFY_THROWS_HR(PushNotificationManager::Default().PushReceived([](const auto&, PushNotificationReceivedEventArgs const& /* args */) {}), HRESULT_FROM_WIN32(ERROR_NOT_FOUND));
282+
VERIFY_THROWS_HR(PushNotificationManager::Default().PushReceived([](const auto&, PushNotificationReceivedEventArgs const& /* args */) {}), HRESULT_FROM_WIN32(ERROR_INVALID_HANDLE);
283283
}
284284
else
285285
{

0 commit comments

Comments
 (0)