Skip to content
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
ff8aa4d
New branch for undocked_winrt_activation
kythant Jan 2, 2020
04ab115
Got it to build and run
kythant Jan 3, 2020
996aef1
Add back in test and add a test files folder
kythant Jan 3, 2020
e5318a3
Add dw threading model field for the component
kythant Jan 4, 2020
85d8ac0
Kythant/undocked winrt activation/apartments (#625)
kythant Jan 7, 2020
ece9303
Configure cmake so that we don't have to manually copy over necessary…
kythant Jan 8, 2020
fb3ea8b
Kythant/undocked winrt activation/apartments tests (#626)
kythant Jan 13, 2020
8e10fcf
Change it back to AND
kythant Jan 13, 2020
fadf779
Deleting old dll to make git happy
Jan 14, 2020
a2c4103
Updating parsing to handle xml manifest files (#628)
EricJohnson327 Jan 16, 2020
66d67d9
Change from Cmake to vcxproj plus azure pipline
kythant Jan 21, 2020
a9d28eb
delete dll
kythant Jan 21, 2020
77f4188
Merge branch 'undocked_winrt_activation' of https://github.com/Micros…
kythant Jan 21, 2020
49d6097
Update Nuspec
kythant Jan 21, 2020
3c6fcff
Updated nuspec target
kythant Jan 21, 2020
35cfa1f
Fixed targets
kythant Jan 21, 2020
f9015db
Fixed targets
kythant Jan 21, 2020
62fb1a0
Fixed targets
kythant Jan 21, 2020
eba10b1
Update Targets
kythant Jan 22, 2020
00e9bba
Just testing pipeline trigger
kythant Jan 22, 2020
72e8cde
Merge branch 'undocked_winrt_activation' of https://github.com/micros…
Jan 22, 2020
bee0b3a
Ejohn/undocked winrt activation/metadata (#631)
EricJohnson327 Jan 28, 2020
db3c299
Merge branch 'undocked_winrt_activation' of https://github.com/micros…
Jan 28, 2020
bbb24ab
Build fix - removed old header include
Jan 28, 2020
adfdadf
Build fixes
kythant Jan 28, 2020
a830a84
Nuspec and target updates
kythant Jan 28, 2020
4559a37
ForceSymbolReferences are different for x64 than x86 Go figure ¯\_(ツ)_/¯
kythant Jan 29, 2020
b8e446d
Fix targets for export initialize forced reference
kythant Jan 29, 2020
bb3c757
Fix targets for export initialize forced reference 2
kythant Jan 29, 2020
6f1ba4d
Win32 OR condition
kythant Jan 29, 2020
a3e08fb
Updating tests to use single manifest
Jan 29, 2020
a059530
Merge branch 'undocked_winrt_activation' of https://github.com/micros…
Jan 29, 2020
3c64a91
Disable detours for 19h1 and above. (#633)
kythant Feb 3, 2020
f6bd108
Adding c# tests
Feb 5, 2020
3f7520a
Automatically add ManagedTest's manifest
kythant Feb 5, 2020
e414ee1
Cross Apartment GetActivationFactory
kythant Feb 5, 2020
15790ad
Fix issue with IFactory not marked as Agile
kythant Feb 5, 2020
74f1c8b
Delete unused TestComp folder
kythant Feb 7, 2020
8a6a733
Fix targets for managed .net
kythant Feb 15, 2020
6c502d2
Fix leak on Hstring
kythant Apr 7, 2020
93e9abb
Merge branch 'master' into undocked_winrt_activation
kythant May 7, 2020
a7bac31
Merge branch 'master' into undocked_winrt_activation
kythant May 7, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/UndockedRegFreeWinRT/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildVersion Condition="'$(BuildVersion)'==''">1.0.0.0</BuildVersion>
<BuildPlatform>$(Platform)</BuildPlatform>
<BuildPlatform Condition="'$(Platform)'=='Win32'">x86</BuildPlatform>
<BuildOutDir Condition="'$(BuildOutDir)'==''">$([System.IO.Path]::GetFullPath('$(SolutionDir)_build\$(BuildPlatform)\$(Configuration)\'))</BuildOutDir>
<CsWinRTDir>$(BuildOutDir)</CsWinRTDir>
<CsWinRTDir Condition="'$(Platform)'=='ARM' or '$(Platform)'=='ARM64'">$([System.IO.Path]::GetFullPath('$(SolutionDir)_build\x86\$(Configuration)\'))</CsWinRTDir>
<CsWinRTExe>$(CsWinRTDir)cswinrt.exe</CsWinRTExe>
<OutDir>$(BuildOutDir)</OutDir>
<IntDir>$(OutDir)$(ProjectName)\</IntDir>
</PropertyGroup>
</Project>
24 changes: 24 additions & 0 deletions src/UndockedRegFreeWinRT/Nuget/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
C++ for the Windows Runtime (C++/WinRT)

Copyright (c) Microsoft Corporation
All rights reserved.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.5">
<id>Microsoft.Windows.UndockedRegFreeWinrt</id>
<version>1.0.0.0</version>
<title>Regfree WinRT Build Support</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Regfree WinRT enables using WinRT types without the registry</description>
<releaseNotes></releaseNotes>
<tags>regfree WinRT</tags>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<license type="file">LICENSE</license>
<projectUrl>https://github.com/Microsoft/xlang</projectUrl>
</metadata>
<files>
<file src="LICENSE"/>
<file src="Microsoft.Windows.UndockedRegFreeWinrt.targets" target="build\native"/>
<file src="Microsoft.Windows.UndockedRegFreeWinrt.targets" target="build\net45"/>
<file src="Microsoft.Windows.UndockedRegFreeWinrt.targets" target="build\netcoreapp2.0"/>
<file src="readme.txt"/>
<file src="$winrtactx64release$" target="runtimes\x64\release\"/>
<file src="$winrtactx64debug$" target="runtimes\x64\debug\"/>
<file src="$winrtactx86release$" target="runtimes\x86\release\"/>
<file src="$winrtactx86debug$" target="runtimes\x86\debug\"/>
<file src="$winrtactlibx64release$" target="runtimes\x64\release\"/>
<file src="$winrtactlibx64debug$" target="runtimes\x64\debug\"/>
<file src="$winrtactlibx86release$" target="runtimes\x86\release\"/>
<file src="$winrtactlibx86debug$" target="runtimes\x86\debug\"/>
</files>
</package>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<ItemDefinitionGroup>
<Link>
<AdditionalDependencies Condition="'$(Configuration)' == 'Debug' And ('$(Platform)' == 'Win32' Or '$(Platform)' == 'x86')">$(MSBuildThisFileDirectory)..\..\runtimes\x86\debug\winrtact.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)' == 'Release' And ('$(Platform)' == 'Win32' Or '$(Platform)' == 'x86')">$(MSBuildThisFileDirectory)..\..\runtimes\x86\release\winrtact.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)' == 'Debug' And '$(Platform)' == 'x64'">$(MSBuildThisFileDirectory)..\..\runtimes\x64\debug\winrtact.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)' == 'Release' And '$(Platform)' == 'x64'">$(MSBuildThisFileDirectory)..\..\runtimes\x64\release\winrtact.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)' == 'Debug' And '$(Platform)' == 'ARM64'">$(MSBuildThisFileDirectory)..\..\runtimes\arm64\debug\winrtact.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)' == 'Release' And '$(Platform)' == 'ARM64'">$(MSBuildThisFileDirectory)..\..\runtimes\arm64\release\winrtact.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ForceSymbolReferences Condition="'$(Platform)' == 'Win32' Or '$(Platform)' == 'x86'">_winrtact_Initialize@0;%(ForceSymbolReferences)</ForceSymbolReferences>
<ForceSymbolReferences Condition="'$(Platform)' == 'x64'">winrtact_Initialize;%(ForceSymbolReferences)</ForceSymbolReferences>
</Link>
</ItemDefinitionGroup>

<!-- x86 -->
<ItemGroup Condition="'$(Configuration)' == 'Debug' And ('$(Platform)' == 'Win32' Or '$(Platform)' == 'x86')">
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\runtimes\x86\debug\winrtact.dll" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'Release' And ('$(Platform)' == 'Win32' Or '$(Platform)' == 'x86')">
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\runtimes\x86\release\winrtact.dll" />
</ItemGroup>

<!-- x64 -->
<ItemGroup Condition="'$(Configuration)' == 'Debug' And '$(Platform)' == 'x64'">
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\runtimes\x64\debug\winrtact.dll" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'Release' And '$(Platform)' == 'x64'">
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\runtimes\x64\release\winrtact.dll" />
</ItemGroup>

<!-- arm64 -->
<ItemGroup Condition="'$(Configuration)' == 'Debug' And '$(Platform)' == 'ARM64'">
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\runtimes\arm64\debug\winrtact.dll" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'Release' And '$(Platform)' == 'ARM64'">
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\runtimes\arm64\release\winrtact.dll" />
</ItemGroup>


<!--AnyCPU Not Supported -->
<Target Name="BeforeBuild" Condition="'$(Platform)' == 'AnyCPU'" >
<Warning Text="Please change your app project architecture to x86 or x64 or arm64 in the Configuration Manager."/>
</Target>

</Project>
6 changes: 6 additions & 0 deletions src/UndockedRegFreeWinRT/Nuget/SignConfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<SignConfigXML>
<job platform="" configuration="" dest="__OUTPATHROOT__" jobname="CsWinRT NuGet" approvers="">
<file src="__INPATHROOT__\Microsoft.Windows.UndockedRegFreeWinrt.*.nupkg" signType="CP-401405" dest="__OUTPATHROOT__\Microsoft.Windows.UndockedRegFreeWinrt.*.nupkg" />
</job>
</SignConfigXML>
40 changes: 40 additions & 0 deletions src/UndockedRegFreeWinRT/Nuget/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
========================================================================
The Microsoft.Windows.UndockedRegFreeWinrt NuGet package
enabling you consume Windows Runtime classes registry free!
========================================================================

Installing this package will enable non-packaged desktop applications
to leverage user-defined Windows Runtime types via the use of the
fusion manifest down to RS2.

Example fusion manifest:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<file name="TestComponent.dll">
<activatableClass
clsid="TestComponent.Class1"
threadingModel="Both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
clsid="TestComponent.Class2"
threadingModel="sta"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
clsid="TestComponent.Class3"
threadingModel="mta"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
</file>
</assembly>

Since the regfree winrt feature is already available on versions of windows 19h1 and above,
this package will automatically disable itself on 19h1 and above.
However you must target your application for windows for it to self-disable.
https://docs.microsoft.com/en-us/windows/win32/sysinfo/targeting-your-application-at-windows-8-1

========================================================================
For more information, visit:
https://github.com/microsoft/xlang/tree/undocked_winrt_activation

For more information about the original feature, visit:
https://blogs.windows.com/windowsdeveloper/2019/04/30/enhancing-non-packaged-desktop-apps-using-windows-runtime-components/
========================================================================
6 changes: 6 additions & 0 deletions src/UndockedRegFreeWinRT/SignConfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<SignConfigXML>
<job platform="" configuration="" dest="__OUTPATHROOT__" jobname="Regfree Winrt Tools" approvers="">
<file src="__INPATHROOT__\winrtact.dll" signType="400" dest="__OUTPATHROOT__\winrtact.dll" />
</job>
</SignConfigXML>
47 changes: 47 additions & 0 deletions src/UndockedRegFreeWinRT/TestComponent/Class.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#include "pch.h"
#include "Class.h"
#include "ClassBoth.g.cpp"
#include "ClassSta.g.cpp"
#include "ClassMta.g.cpp"

namespace winrt::TestComponent::implementation
{
int32_t ClassBoth::Apartment()
{
APTTYPE aptType;
APTTYPEQUALIFIER aptQualifier;
check_hresult(CoGetApartmentType(&aptType, &aptQualifier));
return aptType;
}

void ClassBoth::Apartment(int32_t /* value */)
{
throw hresult_not_implemented();
}

int32_t ClassSta::Apartment()
{
APTTYPE aptType;
APTTYPEQUALIFIER aptQualifier;
check_hresult(CoGetApartmentType(&aptType, &aptQualifier));
return aptType;
}

void ClassSta::Apartment(int32_t /* value */)
{
throw hresult_not_implemented();
}

int32_t ClassMta::Apartment()
{
APTTYPE aptType;
APTTYPEQUALIFIER aptQualifier;
check_hresult(CoGetApartmentType(&aptType, &aptQualifier));
return aptType;
}

void ClassMta::Apartment(int32_t /* value */)
{
throw hresult_not_implemented();
}
}
47 changes: 47 additions & 0 deletions src/UndockedRegFreeWinRT/TestComponent/Class.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#pragma once

#include "ClassBoth.g.h"
#include "ClassSta.g.h"
#include "ClassMta.g.h"

namespace winrt::TestComponent::implementation
{
struct ClassBoth : ClassBothT<ClassBoth, winrt::non_agile>
{
ClassBoth() = default;

int32_t Apartment();
void Apartment(int32_t value);
};

struct ClassSta : ClassStaT<ClassSta, winrt::non_agile>
{
ClassSta() = default;

int32_t Apartment();
void Apartment(int32_t value);
};

struct ClassMta : ClassMtaT<ClassMta, winrt::non_agile>
{
ClassMta() = default;

int32_t Apartment();
void Apartment(int32_t value);
};
}

namespace winrt::TestComponent::factory_implementation
{
struct ClassBoth : ClassBothT<ClassBoth, implementation::ClassBoth, winrt::non_agile>
{
};

struct ClassSta : ClassStaT<ClassSta, implementation::ClassSta, winrt::non_agile>
{
};

struct ClassMta : ClassMtaT<ClassMta, implementation::ClassMta, winrt::non_agile>
{
};
}
23 changes: 23 additions & 0 deletions src/UndockedRegFreeWinRT/TestComponent/Class.idl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
namespace TestComponent
{
[default_interface]
runtimeclass ClassBoth
{
ClassBoth();
Int32 Apartment;
}

[default_interface]
runtimeclass ClassSta
{
ClassSta();
Int32 Apartment;
}

[default_interface]
runtimeclass ClassMta
{
ClassMta();
Int32 Apartment;
}
}
16 changes: 16 additions & 0 deletions src/UndockedRegFreeWinRT/TestComponent/PropertySheet.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<!--
To customize common C++/WinRT project properties:
* right-click the project node
* expand the Common Properties item
* select the C++/WinRT property page
For more advanced scenarios, and complete documentation, please see:
https://github.com/Microsoft/cppwinrt/tree/master/nuget
-->
<PropertyGroup />
<ItemDefinitionGroup />
</Project>
3 changes: 3 additions & 0 deletions src/UndockedRegFreeWinRT/TestComponent/TestComponent.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
EXPORTS
DllCanUnloadNow = WINRT_CanUnloadNow PRIVATE
DllGetActivationFactory = WINRT_GetActivationFactory PRIVATE
Loading