-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
User/purifoypaul/rs5 packaged com activation (#2044)
* Initial Commit * Working packaged background RS5 * Remove IRawSerializer * Update NotificationListener.cpp
- Loading branch information
Showing
19 changed files
with
202 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
dev/PushNotifications/PushNotificationsLongRunningTask/PushBackgroundTaskInstance.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#pragma once | ||
|
||
#include "pch.h" | ||
|
||
#include "PushBackgroundTaskInstance.h" | ||
#include <winrt/base.h> | ||
|
||
using namespace winrt::Windows::Networking::PushNotifications; | ||
|
||
winrt::guid PushBackgroundTaskInstance::InstanceId() | ||
{ | ||
return winrt::guid(); | ||
} | ||
|
||
UINT32 PushBackgroundTaskInstance::SuspendedCount() | ||
{ | ||
return 0; | ||
} | ||
|
||
UINT32 PushBackgroundTaskInstance::Progress() | ||
{ | ||
return 0; | ||
} | ||
|
||
UINT32 PushBackgroundTaskInstance::Progress(UINT32 progress) | ||
{ | ||
return 0; | ||
} | ||
|
||
winrt::Windows::ApplicationModel::Background::BackgroundTaskRegistration PushBackgroundTaskInstance::Task() | ||
{ | ||
return nullptr; | ||
} | ||
|
||
winrt::event_token PushBackgroundTaskInstance::Canceled(winrt::Windows::ApplicationModel::Background::BackgroundTaskCanceledEventHandler const& handler) | ||
{ | ||
return winrt::event_token{}; | ||
} | ||
|
||
void PushBackgroundTaskInstance::Canceled(winrt::event_token const& token) noexcept | ||
{ | ||
return; | ||
} | ||
|
||
winrt::Windows::ApplicationModel::Background::BackgroundTaskDeferral PushBackgroundTaskInstance::GetDeferral() | ||
{ | ||
return nullptr; | ||
} | ||
|
||
winrt::Windows::Foundation::IInspectable PushBackgroundTaskInstance::TriggerDetails() | ||
{ | ||
return winrt::box_value(m_payload); | ||
} |
34 changes: 34 additions & 0 deletions
34
dev/PushNotifications/PushNotificationsLongRunningTask/PushBackgroundTaskInstance.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include <winrt/Windows.ApplicationModel.background.h> | ||
|
||
struct PushBackgroundTaskInstance : winrt::implements<PushBackgroundTaskInstance, winrt::Windows::ApplicationModel::Background::IBackgroundTaskInstance> | ||
{ | ||
PushBackgroundTaskInstance() {}; | ||
|
||
winrt::guid InstanceId(); | ||
UINT32 SuspendedCount(); | ||
UINT32 Progress(); | ||
UINT32 Progress(UINT32 progress); | ||
winrt::Windows::ApplicationModel::Background::BackgroundTaskRegistration Task(); | ||
winrt::Windows::Foundation::IInspectable TriggerDetails(); | ||
winrt::event_token Canceled(winrt::Windows::ApplicationModel::Background::BackgroundTaskCanceledEventHandler const& handler); | ||
void Canceled(winrt::event_token const& token) noexcept; | ||
winrt::Windows::ApplicationModel::Background::BackgroundTaskDeferral GetDeferral(); | ||
|
||
void SetRawNotificationPayload(std::wstring const& payload) { m_payload = payload; }; | ||
private: | ||
std::wstring m_payload; | ||
}; | ||
|
||
struct PushBackgroundTaskInstanceFactory : winrt::implements<PushBackgroundTaskInstanceFactory, IClassFactory> | ||
{ | ||
HRESULT __stdcall CreateInstance(_In_opt_ IUnknown* aggregateInterface, _In_ REFIID interfaceId, _Outptr_ VOID** object) noexcept final | ||
{ | ||
RETURN_HR_IF(CLASS_E_NOAGGREGATION, aggregateInterface != nullptr); | ||
return winrt::make<PushBackgroundTaskInstance>().as(interfaceId, object); | ||
} | ||
|
||
HRESULT __stdcall LockServer(BOOL) noexcept final | ||
{ | ||
return S_OK; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.