Skip to content

Commit b166e36

Browse files
authored
Kozani DVC implementation (#3558)
* Initial DVC client impl * KozaniRemoteManager implementation - checkpoint 1 * Commit before merging with Protocol Buffer changes * KozaniManager (client side DVC plugin) impl * App launch through DVC done * Implemented process lifetime tracking and AppTerminationNotice protocol * Remove unused files * Remote commented out lines. * Added manual tests for remote and local process lifetime tracking * Addressed CR feedbacks * Fix ARM64 build issue for test msix packages. Skip building those packages.
1 parent 8f5ec76 commit b166e36

File tree

72 files changed

+3642
-204
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+3642
-204
lines changed

WindowsAppRuntime.sln

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "data", "data", "{9CE0ED94-0
619619
EndProject
620620
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KozaniManager.Msix", "test\Kozani\data\KozaniManager.Msix\KozaniManager.Msix.vcxproj", "{D4D29026-C15C-49A3-BEC5-4D477028962C}"
621621
EndProject
622+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{0CF759F7-A84E-4BF4-BC99-414A14E27930}"
623+
EndProject
624+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "dev\Kozani\Common\Common.vcxitems", "{431F959D-6323-4C1D-8BC3-78B1EB8B3554}"
625+
EndProject
626+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "KozaniRemoteManagerLauncher", "KozaniRemoteManagerLauncher", "{C5408A09-CDB4-41C1-8766-7677757EB7F2}"
627+
EndProject
628+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KozaniRemoteManagerLauncher", "dev\Kozani\KozaniRemoteManagerLauncher\KozaniRemoteManagerLauncher.vcxproj", "{45C50DA4-F2C7-4A4B-8493-50E5DF17B527}"
629+
EndProject
630+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KozaniRemoteManager.Msix", "test\Kozani\data\KozaniRemoteManager.Msix\KozaniRemoteManager.Msix.vcxproj", "{A18E00C4-3668-4289-ABFC-D1DF330DA6BF}"
631+
EndProject
622632
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "KozaniProtocol", "KozaniProtocol", "{82197F64-3A88-4C48-AEF9-7E62E71D75BB}"
623633
EndProject
624634
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KozaniProtocol", "dev\Kozani\KozaniProtocol\KozaniProtocol.vcxproj", "{3F28C3ED-2548-4530-8B6C-832FAE0E993D}"
@@ -2125,8 +2135,8 @@ Global
21252135
{91FA558E-ABE3-4F36-B611-927AC041F5D2}.Release|x86.Build.0 = Release|Win32
21262136
{FD0CC14A-ED4B-4936-B68B-F31E58372E32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21272137
{FD0CC14A-ED4B-4936-B68B-F31E58372E32}.Debug|Any CPU.Build.0 = Debug|Any CPU
2128-
{FD0CC14A-ED4B-4936-B68B-F31E58372E32}.Debug|ARM64.ActiveCfg = Debug|Any CPU
2129-
{FD0CC14A-ED4B-4936-B68B-F31E58372E32}.Debug|ARM64.Build.0 = Debug|Any CPU
2138+
{FD0CC14A-ED4B-4936-B68B-F31E58372E32}.Debug|ARM64.ActiveCfg = Debug|x64
2139+
{FD0CC14A-ED4B-4936-B68B-F31E58372E32}.Debug|ARM64.Build.0 = Debug|x64
21302140
{FD0CC14A-ED4B-4936-B68B-F31E58372E32}.Debug|x64.ActiveCfg = Debug|x64
21312141
{FD0CC14A-ED4B-4936-B68B-F31E58372E32}.Debug|x64.Build.0 = Debug|x64
21322142
{FD0CC14A-ED4B-4936-B68B-F31E58372E32}.Debug|x86.ActiveCfg = Debug|Any CPU
@@ -2186,6 +2196,37 @@ Global
21862196
{D4D29026-C15C-49A3-BEC5-4D477028962C}.Release|x64.Build.0 = Release|x64
21872197
{D4D29026-C15C-49A3-BEC5-4D477028962C}.Release|x86.ActiveCfg = Release|Win32
21882198
{D4D29026-C15C-49A3-BEC5-4D477028962C}.Release|x86.Build.0 = Release|Win32
2199+
{45C50DA4-F2C7-4A4B-8493-50E5DF17B527}.Debug|Any CPU.ActiveCfg = Debug|x64
2200+
{45C50DA4-F2C7-4A4B-8493-50E5DF17B527}.Debug|Any CPU.Build.0 = Debug|x64
2201+
{45C50DA4-F2C7-4A4B-8493-50E5DF17B527}.Debug|ARM64.ActiveCfg = Debug|ARM64
2202+
{45C50DA4-F2C7-4A4B-8493-50E5DF17B527}.Debug|ARM64.Build.0 = Debug|ARM64
2203+
{45C50DA4-F2C7-4A4B-8493-50E5DF17B527}.Debug|x64.ActiveCfg = Debug|x64
2204+
{45C50DA4-F2C7-4A4B-8493-50E5DF17B527}.Debug|x64.Build.0 = Debug|x64
2205+
{45C50DA4-F2C7-4A4B-8493-50E5DF17B527}.Debug|x86.ActiveCfg = Debug|Win32
2206+
{45C50DA4-F2C7-4A4B-8493-50E5DF17B527}.Debug|x86.Build.0 = Debug|Win32
2207+
{45C50DA4-F2C7-4A4B-8493-50E5DF17B527}.Release|Any CPU.ActiveCfg = Release|x64
2208+
{45C50DA4-F2C7-4A4B-8493-50E5DF17B527}.Release|Any CPU.Build.0 = Release|x64
2209+
{45C50DA4-F2C7-4A4B-8493-50E5DF17B527}.Release|ARM64.ActiveCfg = Release|ARM64
2210+
{45C50DA4-F2C7-4A4B-8493-50E5DF17B527}.Release|ARM64.Build.0 = Release|ARM64
2211+
{45C50DA4-F2C7-4A4B-8493-50E5DF17B527}.Release|x64.ActiveCfg = Release|x64
2212+
{45C50DA4-F2C7-4A4B-8493-50E5DF17B527}.Release|x64.Build.0 = Release|x64
2213+
{45C50DA4-F2C7-4A4B-8493-50E5DF17B527}.Release|x86.ActiveCfg = Release|Win32
2214+
{45C50DA4-F2C7-4A4B-8493-50E5DF17B527}.Release|x86.Build.0 = Release|Win32
2215+
{A18E00C4-3668-4289-ABFC-D1DF330DA6BF}.Debug|Any CPU.ActiveCfg = Debug|x64
2216+
{A18E00C4-3668-4289-ABFC-D1DF330DA6BF}.Debug|Any CPU.Build.0 = Debug|x64
2217+
{A18E00C4-3668-4289-ABFC-D1DF330DA6BF}.Debug|ARM64.ActiveCfg = Debug|x64
2218+
{A18E00C4-3668-4289-ABFC-D1DF330DA6BF}.Debug|ARM64.Build.0 = Debug|x64
2219+
{A18E00C4-3668-4289-ABFC-D1DF330DA6BF}.Debug|x64.ActiveCfg = Debug|x64
2220+
{A18E00C4-3668-4289-ABFC-D1DF330DA6BF}.Debug|x64.Build.0 = Debug|x64
2221+
{A18E00C4-3668-4289-ABFC-D1DF330DA6BF}.Debug|x86.ActiveCfg = Debug|Win32
2222+
{A18E00C4-3668-4289-ABFC-D1DF330DA6BF}.Debug|x86.Build.0 = Debug|Win32
2223+
{A18E00C4-3668-4289-ABFC-D1DF330DA6BF}.Release|Any CPU.ActiveCfg = Release|x64
2224+
{A18E00C4-3668-4289-ABFC-D1DF330DA6BF}.Release|Any CPU.Build.0 = Release|x64
2225+
{A18E00C4-3668-4289-ABFC-D1DF330DA6BF}.Release|ARM64.ActiveCfg = Release|x64
2226+
{A18E00C4-3668-4289-ABFC-D1DF330DA6BF}.Release|x64.ActiveCfg = Release|x64
2227+
{A18E00C4-3668-4289-ABFC-D1DF330DA6BF}.Release|x64.Build.0 = Release|x64
2228+
{A18E00C4-3668-4289-ABFC-D1DF330DA6BF}.Release|x86.ActiveCfg = Release|Win32
2229+
{A18E00C4-3668-4289-ABFC-D1DF330DA6BF}.Release|x86.Build.0 = Release|Win32
21892230
{3F28C3ED-2548-4530-8B6C-832FAE0E993D}.Debug|Any CPU.ActiveCfg = Debug|x64
21902231
{3F28C3ED-2548-4530-8B6C-832FAE0E993D}.Debug|Any CPU.Build.0 = Debug|x64
21912232
{3F28C3ED-2548-4530-8B6C-832FAE0E993D}.Debug|ARM64.ActiveCfg = Debug|ARM64
@@ -2388,6 +2429,11 @@ Global
23882429
{400ED5EC-4530-4ADB-8DCE-9D1E6708A1F5} = {49CF5AB7-304F-4C78-A098-A77B2931F64E}
23892430
{9CE0ED94-078A-405F-8599-BFC2D8D6E537} = {9164C50F-E9CA-41BD-BCA9-5F30845FA257}
23902431
{D4D29026-C15C-49A3-BEC5-4D477028962C} = {9CE0ED94-078A-405F-8599-BFC2D8D6E537}
2432+
{0CF759F7-A84E-4BF4-BC99-414A14E27930} = {84F66485-4391-41C7-89CB-D5006EDF1383}
2433+
{431F959D-6323-4C1D-8BC3-78B1EB8B3554} = {0CF759F7-A84E-4BF4-BC99-414A14E27930}
2434+
{C5408A09-CDB4-41C1-8766-7677757EB7F2} = {84F66485-4391-41C7-89CB-D5006EDF1383}
2435+
{45C50DA4-F2C7-4A4B-8493-50E5DF17B527} = {C5408A09-CDB4-41C1-8766-7677757EB7F2}
2436+
{A18E00C4-3668-4289-ABFC-D1DF330DA6BF} = {9CE0ED94-078A-405F-8599-BFC2D8D6E537}
23912437
{82197F64-3A88-4C48-AEF9-7E62E71D75BB} = {84F66485-4391-41C7-89CB-D5006EDF1383}
23922438
{3F28C3ED-2548-4530-8B6C-832FAE0E993D} = {82197F64-3A88-4C48-AEF9-7E62E71D75BB}
23932439
EndGlobalSection
@@ -2399,14 +2445,17 @@ Global
23992445
dev\PushNotifications\PushNotifications.vcxitems*{103c0c23-7ba8-4d44-a63c-83488e2e3a81}*SharedItemsImports = 9
24002446
dev\EnvironmentManager\API\Microsoft.Process.Environment.vcxitems*{2f3fad1b-d3df-4866-a3a3-c2c777d55638}*SharedItemsImports = 9
24012447
test\inc\inc.vcxitems*{412d023e-8635-4ad2-a0ea-e19e08d36915}*SharedItemsImports = 4
2448+
dev\Kozani\Common\Common.vcxitems*{431f959d-6323-4c1d-8bc3-78b1eb8b3554}*SharedItemsImports = 9
24022449
test\inc\inc.vcxitems*{4b30c685-8490-440f-9879-a75d45daa361}*SharedItemsImports = 4
24032450
dev\UndockedRegFreeWinRT\UndockedRegFreeWinRT.vcxitems*{56371ca6-144b-4989-a4e9-391ad4fa7651}*SharedItemsImports = 9
24042451
test\inc\inc.vcxitems*{56a1d696-feda-4333-bf37-772ebececb10}*SharedItemsImports = 4
24052452
test\inc\inc.vcxitems*{5b2d17fe-c371-417f-860c-3d32397c2404}*SharedItemsImports = 4
24062453
test\inc\inc.vcxitems*{7c502995-59c3-483b-86ba-815985353633}*SharedItemsImports = 4
2454+
dev\Kozani\Common\Common.vcxitems*{829cdb09-eefe-4188-a045-3fc6be7bd96b}*SharedItemsImports = 4
24072455
dev\Common\Common.vcxitems*{8828053c-d6ec-4744-8624-f8c676c2d4df}*SharedItemsImports = 9
24082456
dev\Licensing\Licensing.vcxitems*{885a43fa-052d-4b0d-a2dc-13ee15796435}*SharedItemsImports = 9
24092457
test\inc\inc.vcxitems*{8e52d7ea-a200-4a6b-ba74-8efb49468caf}*SharedItemsImports = 4
2458+
dev\Kozani\Common\Common.vcxitems*{a11c6664-f26a-4e71-b440-2e4e1ba09a93}*SharedItemsImports = 4
24102459
dev\AppNotifications\AppNotifications.vcxitems*{b4824897-88e0-4927-8fb9-e60106f01ed9}*SharedItemsImports = 9
24112460
test\inc\inc.vcxitems*{b567fe2e-3a03-48d0-b2b5-760cdec35891}*SharedItemsImports = 9
24122461
dev\Common\Common.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4

dev/Kozani/Common/Common.vcxitems

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup Label="Globals">
4+
<MSBuildAllProjects Condition="'$(MSBuildVersion)' == '' Or '$(MSBuildVersion)' &lt; '16.0'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
5+
<HasSharedItems>true</HasSharedItems>
6+
<ItemsProjectGuid>{431f959d-6323-4c1d-8bc3-78b1eb8b3554}</ItemsProjectGuid>
7+
</PropertyGroup>
8+
<ItemDefinitionGroup>
9+
<ClCompile>
10+
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory)</AdditionalIncludeDirectories>
11+
</ClCompile>
12+
</ItemDefinitionGroup>
13+
<ItemGroup>
14+
<ProjectCapability Include="SourceItemsFromImports" />
15+
</ItemGroup>
16+
<ItemGroup>
17+
<ClCompile Include="$(MSBuildThisFileDirectory)KozaniDvcProtocol.cpp" />
18+
</ItemGroup>
19+
<ItemGroup>
20+
<ClInclude Include="$(MSBuildThisFileDirectory)KozaniDvc-Constants.h" />
21+
<ClInclude Include="$(MSBuildThisFileDirectory)KozaniDvcProtocol.h" />
22+
<ClInclude Include="$(MSBuildThisFileDirectory)Logging.h" />
23+
<ClInclude Include="$(MSBuildThisFileDirectory)wil_kozani.h" />
24+
</ItemGroup>
25+
</Project>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<ClCompile Include="$(MSBuildThisFileDirectory)KozaniDvcProtocol.cpp" />
5+
</ItemGroup>
6+
<ItemGroup>
7+
<ClInclude Include="$(MSBuildThisFileDirectory)Logging.h" />
8+
<ClInclude Include="$(MSBuildThisFileDirectory)KozaniDvcProtocol.h" />
9+
<ClInclude Include="$(MSBuildThisFileDirectory)KozaniDvc-Constants.h" />
10+
<ClInclude Include="$(MSBuildThisFileDirectory)wil_kozani.h" />
11+
</ItemGroup>
12+
</Project>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright (c) Microsoft Corporation and Contributors.
2+
// Licensed under the MIT License.
3+
4+
#pragma once
5+
6+
namespace Microsoft::Kozani::DVC::Constants
7+
{
8+
const char ConnectionIdSwitch[] = "-connectionId";
9+
10+
const WCHAR RemoteDesktopClientExe[] = L"mstsc.exe";
11+
}
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
// Copyright (c) Microsoft Corporation and Contributors.
2+
// Licensed under the MIT License.
3+
4+
#include <pch.h>
5+
#include "KozaniDvcProtocol.h"
6+
7+
namespace Microsoft::Kozani::DvcProtocol
8+
{
9+
bool IsEmptyPayloadProtocolDataUnitType(Dvc::ProtocolDataUnit::DataType type)
10+
{
11+
switch (type)
12+
{
13+
case Dvc::ProtocolDataUnit::AppTerminationNotice:
14+
return true;
15+
}
16+
17+
return false;
18+
}
19+
20+
std::string CreatePdu(UINT64 activityId, Dvc::ProtocolDataUnit::DataType type, const std::string& payload = std::string())
21+
{
22+
if (!IsEmptyPayloadProtocolDataUnitType(type))
23+
{
24+
// Payload data of the Pdu should not be empty. It catches a failure condition when empty string is returned
25+
// from a failed SerializeAsString call before calling into this method.
26+
THROW_HR_IF(KOZANI_E_PDU_SERIALIZATION, payload.empty());
27+
}
28+
29+
Dvc::ProtocolDataUnit pdu;
30+
pdu.set_activity_id(activityId);
31+
pdu.set_type(type);
32+
33+
if (!payload.empty())
34+
{
35+
pdu.set_data(std::move(payload));
36+
}
37+
38+
std::string rawPdu{ pdu.SerializeAsString() };
39+
THROW_HR_IF(KOZANI_E_PDU_SERIALIZATION, rawPdu.empty());
40+
41+
return rawPdu;
42+
}
43+
44+
std::string CreateConnectionAckPdu(PCSTR connectionId, UINT64 activityId)
45+
{
46+
Dvc::ConnectionAck ackMessage;
47+
ackMessage.set_connection_id(connectionId);
48+
return CreatePdu(activityId, Dvc::ProtocolDataUnit::ConnectionAck, ackMessage.SerializeAsString());
49+
}
50+
51+
std::string SerializeActivatedEventArgs(winrt::Windows::ApplicationModel::Activation::IActivatedEventArgs& args)
52+
{
53+
switch (args.Kind())
54+
{
55+
case winrt::Windows::ApplicationModel::Activation::ActivationKind::Launch:
56+
auto specificArgs{ args.as<winrt::Windows::ApplicationModel::Activation::LaunchActivatedEventArgs>() };
57+
if (!specificArgs.Arguments().empty())
58+
{
59+
const std::string argsUtf8{ ::Microsoft::Utf8::ToUtf8(specificArgs.Arguments().c_str()) };
60+
Dvc::LaunchActivationArgs launchArgs;
61+
launchArgs.set_arguments(std::move(argsUtf8));
62+
return launchArgs.SerializeAsString();
63+
}
64+
break;
65+
}
66+
return std::string();
67+
}
68+
69+
std::string CreateActivateAppRequestPdu(
70+
UINT64 activityId,
71+
PCWSTR appUserModelId,
72+
winrt::Windows::ApplicationModel::Activation::ActivationKind activationKind,
73+
winrt::Windows::ApplicationModel::Activation::IActivatedEventArgs& args)
74+
{
75+
Dvc::ActivateAppRequest activateAppRequest;
76+
activateAppRequest.set_activation_kind(static_cast<Dvc::ActivationKind>(activationKind));
77+
78+
const std::string appUserModelIdUtf8{ ::Microsoft::Utf8::ToUtf8(appUserModelId) };
79+
activateAppRequest.set_app_user_model_id(std::move(appUserModelIdUtf8));
80+
if (args)
81+
{
82+
activateAppRequest.set_arguments(SerializeActivatedEventArgs(args));
83+
}
84+
85+
return CreatePdu(activityId, Dvc::ProtocolDataUnit::ActivateAppRequest, activateAppRequest.SerializeAsString());
86+
}
87+
88+
std::string CreateActivateAppResultPdu(
89+
UINT64 activityId,
90+
HRESULT hr,
91+
DWORD appProcessId,
92+
bool isNewInstance,
93+
const std::string& errorMessage)
94+
{
95+
Dvc::ActivateAppResult activateAppResult;
96+
activateAppResult.set_hresult(hr);
97+
if (SUCCEEDED(hr))
98+
{
99+
activateAppResult.set_process_id(appProcessId);
100+
activateAppResult.set_is_new_instance(isNewInstance);
101+
}
102+
else if (!errorMessage.empty())
103+
{
104+
activateAppResult.set_error_message(errorMessage);
105+
}
106+
107+
return CreatePdu(activityId, Dvc::ProtocolDataUnit::ActivateAppResult, activateAppResult.SerializeAsString());
108+
}
109+
110+
std::string CreateAppTerminationNoticePdu(UINT64 activityId)
111+
{
112+
return CreatePdu(activityId, Dvc::ProtocolDataUnit::AppTerminationNotice);
113+
}
114+
}

dev/Kozani/Common/KozaniDvcProtocol.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Copyright (c) Microsoft Corporation and Contributors.
2+
// Licensed under the MIT License.
3+
4+
#pragma once
5+
6+
#include <winrt/Windows.ApplicationModel.Activation.h>
7+
#include <Microsoft.Utf8.h>
8+
#include <Kozani.DVC.pb.h>
9+
10+
namespace Dvc = ::Microsoft::Kozani::DVC;
11+
12+
namespace Microsoft::Kozani::DvcProtocol
13+
{
14+
const char DvcChannelName[] = "KozaniDvc";
15+
16+
std::string CreatePdu(UINT64 activityId, Dvc::ProtocolDataUnit::DataType type, const std::string& payload);
17+
18+
std::string CreateConnectionAckPdu(PCSTR connectionId, UINT64 activityId);
19+
20+
std::string SerializeActivatedEventArgs(winrt::Windows::ApplicationModel::Activation::IActivatedEventArgs& args);
21+
22+
std::string CreateActivateAppRequestPdu(
23+
UINT64 activityId,
24+
PCWSTR appUserModelId,
25+
winrt::Windows::ApplicationModel::Activation::ActivationKind activationKind,
26+
winrt::Windows::ApplicationModel::Activation::IActivatedEventArgs& args);
27+
28+
std::string CreateActivateAppResultPdu(
29+
UINT64 activityId,
30+
HRESULT hr,
31+
DWORD appProcessId,
32+
bool isNewInstance,
33+
const std::string& errorMessage);
34+
35+
std::string CreateAppTerminationNoticePdu(UINT64 activityId);
36+
}

dev/Kozani/Common/Logging.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright (c) Microsoft Corporation and Contributors.
2+
// Licensed under the MIT License.
3+
4+
#pragma once
5+
6+
// HRESULT used for logging non-error related information for tracing and debugging purpose with LOG_HR_MSG wil logging macro.
7+
// According to https://learn.microsoft.com/en-us/windows/win32/com/codes-in-facility-itf, all the COM-defined FACILITY_ITF codes have a code value
8+
// in the range of 0x0000-0x01FF. It is recommended that only code values in the range of 0x0200-0xFFFF be used for 3rd party FACILITY_ITF codes.
9+
10+
// Success HRESULT used for Kozani information logging purpose.
11+
// 0x00040201 (262657)
12+
constexpr HRESULT KOZANI_S_INFO{ MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0x0201) };
13+
14+
// Bad/malformatted PDU that cannot be parsed successfully.
15+
// 0x80040202 (-2147220990)
16+
constexpr HRESULT KOZANI_E_BAD_PDU{ MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0202) };
17+
18+
// Unsupported ActivationKind enum value
19+
// 0x80040203 (-2147220989)
20+
constexpr HRESULT KOZANI_E_UNSUPPORTED_ACTIVATION_KIND{ MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0203) };
21+
22+
// Bad/malformatted PDU that cannot be parsed successfully.
23+
// 0x80040204 (-2147220988)
24+
constexpr HRESULT KOZANI_E_PDU_SERIALIZATION{ MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0204) };

dev/Kozani/Common/wil_kozani.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright (c) Microsoft Corporation and Contributors.
2+
// Licensed under the MIT License.
3+
4+
namespace wil
5+
{
6+
#if defined(_INC_WTSAPI) && !defined(__WIL_WTSAPI_WTSVIRTUALCHANNELCLOSE)
7+
#define __WIL_WTSAPI_WTSVIRTUALCHANNELCLOSE
8+
using unique_channel_handle = wil::unique_any_handle_null<decltype(&::WTSVirtualChannelClose), ::WTSVirtualChannelClose>;
9+
#endif // __WIL_WTSAPI_WTSVIRTUALCHANNELCLOSE
10+
}
11+

0 commit comments

Comments
 (0)