Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Bootstrap C# API. Spec Bootstrap C# and get GenerationId (Flat-C/WinRT) APIs #1274

Merged
merged 29 commits into from
Aug 31, 2021
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
852eb19
Moved DynamicDependency project into a subdir so I can collapse the m…
DrusTheAxe Aug 19, 2021
ed16f30
Added 'GenerationId'. Added Bootstrap C# API
DrusTheAxe Aug 20, 2021
61f3dae
Added Bootstrap API samples
DrusTheAxe Aug 20, 2021
def7f83
Fixed return type/calling convention of MddGetGenerationId()
DrusTheAxe Aug 20, 2021
edc4eff
Added C# API for Bootstrap API
DrusTheAxe Aug 20, 2021
5eec705
Incorporated feedback
DrusTheAxe Aug 20, 2021
cecaf04
Removed redundant AnyCPU setting (it's the default if unspecified)
DrusTheAxe Aug 20, 2021
7042adc
Incorporated feedback
DrusTheAxe Aug 20, 2021
6edf1b9
Added the C# assembly to the Transport package
DrusTheAxe Aug 20, 2021
a367ea8
Removed accidental nuget reference
DrusTheAxe Aug 20, 2021
46aee95
Moved the specs out to user/drustheaxe/spec-bootstrapcs-generationid
DrusTheAxe Aug 20, 2021
0d11034
Fixed bad patah
DrusTheAxe Aug 20, 2021
3d8f1d9
Merge branch 'main' into user/drustheaxe/cs-bootstrap
DrusTheAxe Aug 20, 2021
9a34e56
Merge branch 'main' into user/drustheaxe/cs-bootstrap
DrusTheAxe Aug 24, 2021
07c5464
Incorporated feedback
DrusTheAxe Aug 24, 2021
4af4055
Merge branch 'main' into user/drustheaxe/cs-bootstrap
DrusTheAxe Aug 24, 2021
1da80e6
Fixed typo (sheepish grin)
DrusTheAxe Aug 24, 2021
7d2417f
Merge branch 'main' into user/drustheaxe/cs-bootstrap
DrusTheAxe Aug 26, 2021
a5dad5a
Merge branch 'main' into user/drustheaxe/cs-bootstrap
DrusTheAxe Aug 26, 2021
166b910
Merge branch 'main' into user/drustheaxe/cs-bootstrap
DrusTheAxe Aug 27, 2021
ccd492d
Merge branch 'main' into user/drustheaxe/cs-bootstrap
DrusTheAxe Aug 28, 2021
3919dc2
Merge branch 'main' into user/drustheaxe/cs-bootstrap
DrusTheAxe Aug 30, 2021
f62351a
Fixed bad merge
DrusTheAxe Aug 30, 2021
a4d76b4
Merge branch 'main' into user/drustheaxe/cs-bootstrap
DrusTheAxe Aug 30, 2021
0a9e014
Fixed previous incomplete bad-merge-fix (Gah! VS .sln files are heavi…
DrusTheAxe Aug 30, 2021
aec9dcb
More mergy fun
DrusTheAxe Aug 30, 2021
4a7225b
Merge branch 'main' into user/drustheaxe/cs-bootstrap
DrusTheAxe Aug 30, 2021
61ca984
Update *WindowsAppSDK* to *WindowsAppRuntime*
DrusTheAxe Aug 30, 2021
6c83057
Missed one
DrusTheAxe Aug 31, 2021
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
40 changes: 34 additions & 6 deletions WindowsAppSDK.sln
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AppLifecycleTestApp", "test
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DynamicDependency", "DynamicDependency", "{6CD01EF6-D4A4-4801-ADCF-344CF87FF942}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DynamicDependency", "dev\DynamicDependency\DynamicDependency.vcxitems", "{BF055A59-0919-4E34-9B76-DD055495CC5A}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "API", "API", "{6F6B0096-819C-4C12-885F-A20A742F516F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DynamicDependency", "dev\DynamicDependency\API\DynamicDependency.vcxitems", "{BF055A59-0919-4E34-9B76-DD055495CC5A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DynamicDependency", "DynamicDependency", "{17B1F036-8FC3-49E6-9464-0C1F96CEAEB9}"
EndProject
Expand Down Expand Up @@ -191,6 +193,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ChangeTracker", "dev\Change
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EnvironmentManagerTests", "test\EnvironmentManagerTests\EnvironmentManagerTests.vcxproj", "{2CD5CD9B-CF45-4FA7-9769-EE4E02426BF0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Bootstrap", "Bootstrap", "{8746775A-899E-49DD-A46C-2FE0899FFFEA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CS", "CS", "{536FA8DA-51E2-40A3-8A97-A90FFA75AA18}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.WindowsAppSDK.Bootstrap.Net", "dev\Bootstrap\CS\Microsoft.WindowsAppSDK.Bootstrap.Net\Microsoft.WindowsAppSDK.Bootstrap.Net.csproj", "{D6574FD6-8D13-4412-9FCB-308D44063CDA}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
test\inc\inc.vcxitems*{0a5fee93-48b7-40ec-bb9a-b27d11060da9}*SharedItemsImports = 4
Expand All @@ -204,12 +212,12 @@ Global
test\inc\inc.vcxitems*{b567fe2e-3a03-48d0-b2b5-760cdec35891}*SharedItemsImports = 9
dev\ChangeTracker\ChangeTracker.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4
dev\Common\Common.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4
dev\DynamicDependency\DynamicDependency.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4
dev\DynamicDependency\API\DynamicDependency.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4
dev\Microsoft.Process.Environment\Microsoft.Process.Environment.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4
dev\PowerNotifications\PowerNotifications.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4
dev\UndockedRegFreeWinRT\UndockedRegFreeWinRT.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4
dev\PowerNotifications\PowerNotifications.vcxitems*{b75c1b22-553c-40e4-b38e-6ab4d01fdb9d}*SharedItemsImports = 9
dev\DynamicDependency\DynamicDependency.vcxitems*{bf055a59-0919-4e34-9b76-dd055495cc5a}*SharedItemsImports = 9
dev\DynamicDependency\API\DynamicDependency.vcxitems*{bf055a59-0919-4e34-9b76-dd055495cc5a}*SharedItemsImports = 9
test\inc\inc.vcxitems*{c62688a1-16a0-4729-b6ed-842f4faa29f3}*SharedItemsImports = 4
dev\ChangeTracker\ChangeTracker.vcxitems*{e15c3465-9d45-495d-92ce-b91ef45e8623}*SharedItemsImports = 9
dev\AppLifecycle\AppLifecycle.vcxitems*{e3a522a3-6635-4a42-bded-1af46a15f63c}*SharedItemsImports = 9
Expand Down Expand Up @@ -633,8 +641,8 @@ Global
{CBD95746-61CE-4F31-B6CC-C5ABF1766180}.Release|x86.ActiveCfg = Release|Win32
{CBD95746-61CE-4F31-B6CC-C5ABF1766180}.Release|x86.Build.0 = Release|Win32
{47D8D21D-F022-4D58-8DB2-8B467756E08C}.Debug|Any CPU.ActiveCfg = Debug|x86
{47D8D21D-F022-4D58-8DB2-8B467756E08C}.Debug|ARM64.ActiveCfg = Debug|ARM64
{47D8D21D-F022-4D58-8DB2-8B467756E08C}.Debug|ARM64.Build.0 = Debug|ARM64
{47D8D21D-F022-4D58-8DB2-8B467756E08C}.Debug|ARM64.ActiveCfg = Debug|arm64
{47D8D21D-F022-4D58-8DB2-8B467756E08C}.Debug|ARM64.Build.0 = Debug|arm64
{47D8D21D-F022-4D58-8DB2-8B467756E08C}.Debug|x64.ActiveCfg = Debug|x64
{47D8D21D-F022-4D58-8DB2-8B467756E08C}.Debug|x64.Build.0 = Debug|x64
{47D8D21D-F022-4D58-8DB2-8B467756E08C}.Debug|x86.ActiveCfg = Debug|x86
Expand Down Expand Up @@ -684,6 +692,22 @@ Global
{2CD5CD9B-CF45-4FA7-9769-EE4E02426BF0}.Release|x64.Build.0 = Release|x64
{2CD5CD9B-CF45-4FA7-9769-EE4E02426BF0}.Release|x86.ActiveCfg = Release|Win32
{2CD5CD9B-CF45-4FA7-9769-EE4E02426BF0}.Release|x86.Build.0 = Release|Win32
{D6574FD6-8D13-4412-9FCB-308D44063CDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D6574FD6-8D13-4412-9FCB-308D44063CDA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D6574FD6-8D13-4412-9FCB-308D44063CDA}.Debug|ARM64.ActiveCfg = Debug|arm64
{D6574FD6-8D13-4412-9FCB-308D44063CDA}.Debug|ARM64.Build.0 = Debug|arm64
{D6574FD6-8D13-4412-9FCB-308D44063CDA}.Debug|x64.ActiveCfg = Debug|x64
{D6574FD6-8D13-4412-9FCB-308D44063CDA}.Debug|x64.Build.0 = Debug|x64
{D6574FD6-8D13-4412-9FCB-308D44063CDA}.Debug|x86.ActiveCfg = Debug|x86
{D6574FD6-8D13-4412-9FCB-308D44063CDA}.Debug|x86.Build.0 = Debug|x86
{D6574FD6-8D13-4412-9FCB-308D44063CDA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D6574FD6-8D13-4412-9FCB-308D44063CDA}.Release|Any CPU.Build.0 = Release|Any CPU
{D6574FD6-8D13-4412-9FCB-308D44063CDA}.Release|ARM64.ActiveCfg = Release|arm64
{D6574FD6-8D13-4412-9FCB-308D44063CDA}.Release|ARM64.Build.0 = Release|arm64
{D6574FD6-8D13-4412-9FCB-308D44063CDA}.Release|x64.ActiveCfg = Release|x64
{D6574FD6-8D13-4412-9FCB-308D44063CDA}.Release|x64.Build.0 = Release|x64
{D6574FD6-8D13-4412-9FCB-308D44063CDA}.Release|x86.ActiveCfg = Release|x86
{D6574FD6-8D13-4412-9FCB-308D44063CDA}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -696,7 +720,8 @@ Global
{B567FE2E-3A03-48D0-B2B5-760CDEC35891} = {8630F7AA-2969-4DC9-8700-9B468C1DC21D}
{7C502995-59C3-483B-86BA-815985353633} = {AC5FFC80-92FE-4933-BED2-EC5519AC4440}
{6CD01EF6-D4A4-4801-ADCF-344CF87FF942} = {448ED2E5-0B37-4D97-9E6B-8C10A507976A}
{BF055A59-0919-4E34-9B76-DD055495CC5A} = {6CD01EF6-D4A4-4801-ADCF-344CF87FF942}
{6F6B0096-819C-4C12-885F-A20A742F516F} = {6CD01EF6-D4A4-4801-ADCF-344CF87FF942}
{BF055A59-0919-4E34-9B76-DD055495CC5A} = {6F6B0096-819C-4C12-885F-A20A742F516F}
{17B1F036-8FC3-49E6-9464-0C1F96CEAEB9} = {8630F7AA-2969-4DC9-8700-9B468C1DC21D}
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED} = {17B1F036-8FC3-49E6-9464-0C1F96CEAEB9}
{F76B776E-86F5-48C5-8FC7-D2795ECC9746} = {448ED2E5-0B37-4D97-9E6B-8C10A507976A}
Expand Down Expand Up @@ -746,6 +771,9 @@ Global
{034E840E-2165-4167-B560-50AF6B4A52DC} = {448ED2E5-0B37-4D97-9E6B-8C10A507976A}
{E15C3465-9D45-495D-92CE-B91EF45E8623} = {034E840E-2165-4167-B560-50AF6B4A52DC}
{2CD5CD9B-CF45-4FA7-9769-EE4E02426BF0} = {8630F7AA-2969-4DC9-8700-9B468C1DC21D}
{8746775A-899E-49DD-A46C-2FE0899FFFEA} = {448ED2E5-0B37-4D97-9E6B-8C10A507976A}
{536FA8DA-51E2-40A3-8A97-A90FFA75AA18} = {8746775A-899E-49DD-A46C-2FE0899FFFEA}
{D6574FD6-8D13-4412-9FCB-308D44063CDA} = {536FA8DA-51E2-40A3-8A97-A90FFA75AA18}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4B3D7591-CFEC-4762-9A07-ABE99938FB77}
Expand Down
2 changes: 2 additions & 0 deletions build/CopyFilesToStagingDir.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ PublishFile $FullBuildOutput\DynamicDependencyLifetimeManager.ProxyStub\DynamicD
PublishFile $FullBuildOutput\WindowsAppSDK_BootstrapDLL\Microsoft.WindowsAppSDK.Bootstrap.dll $FullPublishDir\Microsoft.WindowsAppSDK.Bootstrap\
PublishFile $FullBuildOutput\WindowsAppSDK_BootstrapDLL\Microsoft.WindowsAppSDK.Bootstrap.lib $FullPublishDir\Microsoft.WindowsAppSDK.Bootstrap\
PublishFile $FullBuildOutput\WindowsAppSDK_BootstrapDLL\MddBootstrap.h $FullPublishDir\Microsoft.WindowsAppSDK.Bootstrap\
PublishFile $FullBuildOutput\Microsoft.WindowsAppSDK.Bootstrap.Net\Microsoft.WindowsAppSDK.Bootstrap.Net.dll $FullPublishDir\Microsoft.WindowsAppSDK.Bootstrap\
PublishFile $FullBuildOutput\Microsoft.WindowsAppSDK.Bootstrap.Net\Microsoft.WindowsAppSDK.Bootstrap.Net.pdb $FullPublishDir\Microsoft.WindowsAppSDK.Bootstrap\

#PublishFile -IfExists $FullBuildOutput\WindowsAppSDK_DLL\Generic.xaml $FullPublishDir\Microsoft.WindowsAppSDK\
#PublishFile -IfExists $FullBuildOutput\Microsoft.WindowsAppSDK.Design\Microsoft.WindowsAppSDK.Design.dll $FullPublishDir\Microsoft.WindowsAppSDK.Design\
Expand Down
218 changes: 218 additions & 0 deletions dev/Bootstrap/CS/Microsoft.WindowsAppSDK.Bootstrap.Net/Bootstrap.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System.Runtime.InteropServices;

namespace Microsoft.Windows.ApplicationModel.DynamicDependency
{
// The version of an MSIX package. This is logically `Major.Minor.Build.Revision` and can be expressed as...
// * individual `ushort` values (uint16)
// * an unsigned `ulong` value (uint64)
// * a dot-string notation ("major.minor.build.revision")
public struct PackageVersion
{
public ushort Major;
public ushort Minor;
public ushort Build;
public ushort Revision;

// Create an instance with the value `major.0.0.0`.
public PackageVersion(ushort major) :
this(major, 0, 0, 0)
{
}

// Create an instance with the value `major.minor.0.0`.
public PackageVersion(ushort major, ushort minor) :
this(major, minor, 0, 0)
{
}

// Create an instance with the value `major.minor.build.0`.
public PackageVersion(ushort major, ushort minor, ushort build) :
this(major, minor, build, 0)
{
}

// Create an instance with the value `major.minor.build.revision`.
public PackageVersion(ushort major, ushort minor, ushort build, ushort revision)
{
Major = major;
Minor = minor;
Build = build;
Revision = revision;
}

// Create an instance from a version as a uint64.
public PackageVersion(ulong version) :
this((ushort)(version >> 48), (ushort)(version >> 32), (ushort)(version >> 16), (ushort)version)
{
}

// Return the version as a uint64.
public ulong ToVersion()
{
return (((ulong)Major) << 48) | (((ulong)Minor) << 32) | (((ulong)Build) << 16) | ((ulong)Revision);
}

// Return the string as a formatted value "major.minor.build.revision".
public override string ToString()
{
return $"{Major}.{Minor}.{Build}.{Revision}";
}
};

internal static class NativeMethods
{
[DllImport("Microsoft.WindowsAppSDK.Bootstrap.dll", EntryPoint = "MddBootstralInitialize", CharSet = CharSet.Unicode, ExactSpelling = true, PreserveSig = false)]
internal static extern void MddBootstrapInitialize_Throw(uint majorMinorVersion, string versionTag, PackageVersion packageVersion);

[DllImport("Microsoft.WindowsAppSDK.Bootstrap.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
internal static extern int MddBootstrapInitialize(uint majorMinorVersion, string versionTag, PackageVersion packageVersion);

[DllImport("Microsoft.WindowsAppSDK.Bootstrap.dll", ExactSpelling = true)]
internal static extern void MddBootstrapShutdown();
}

// The Windows App SDK bootstrap initialization API. This class throws exceptions on error.
//
// @see Bootstrap_NoThrow
public class Bootstrap
{
/// Initialize the calling process to use Windows App SDK's framework package.
///
/// Find a Windows App SDK framework package meeting the criteria and make it available
/// for use by the current process. If multiple packages meet the criteria the best
/// candidate is selected.
///
/// This is equivalent to `Initialize(majorMinorVersion, null, new PackageVersion())`.
///
/// @param majorMinorVersion major and minor version of Windows App SDK's framework package, encoded as `0xMMMMNNNN` where M=Major, N=Minor (e.g. 1.2 == 0x00010002).
/// @see Initialize(uint, string)
/// @see Initialize(uint, string, PackageVersion)
/// @see Shutdown()
public static void Initialize(uint majorMinorVersion)
{
Initialize(majorMinorVersion, null);
}

/// Initialize the calling process to use Windows App SDK's framework package.
///
/// Find a Windows App SDK framework package meeting the criteria and make it available
/// for use by the current process. If multiple packages meet the criteria the best
/// candidate is selected.
///
/// This is equivalent to `Initialize(majorMinorVersion, versionTag, new PackageVersion())`.
///
/// @param majorMinorVersion major and minor version of Windows App SDK's framework package, encoded as `0xMMMMNNNN` where M=Major, N=Minor (e.g. 1.2 == 0x00010002).
/// @param versionTag version tag (if any), e.g. "preview1".
/// @see Initialize(uint)
/// @see Initialize(uint, string, PackageVersion)
/// @see Shutdown()
public static void Initialize(uint majorMinorVersion, string versionTag)
{
Initialize(majorMinorVersion, versionTag, new PackageVersion());
}

/// Initialize the calling process to use Windows App SDK's framework package.
///
/// Find a Windows App SDK framework package meeting the criteria and make it available
/// for use by the current process. If multiple packages meet the criteria the best
/// candidate is selected.
///
/// @param majorMinorVersion major and minor version of Windows App SDK's framework package, encoded as `0xMMMMNNNN` where M=Major, N=Minor (e.g. 1.2 == 0x00010002).
/// @param versionTag version tag (if any), e.g. "preview1".
/// @param minVersion the minimum version to use
/// @see Initialize(uint)
/// @see Initialize(uint, string)
/// @see Shutdown()
public static void Initialize(uint majorMinorVersion, string versionTag, PackageVersion minVersion)
{
NativeMethods.MddBootstrapInitialize_Throw(majorMinorVersion, versionTag, minVersion);
}

/// Undo the changes made by Initialize().
///
/// @warning Packages made available via `Initialize()` and
/// the Dynamic Dependencies API should not be used after this call.
/// @see Initialize(uint)
/// @see Initialize(uint, string)
/// @see Initialize(uint, string, PackageVersion)
public static void Shutdown()
{
NativeMethods.MddBootstrapShutdown();
}
}

// The Windows App SDK bootstrap initialization API. This class returns error as an HRESULT
// (>=0 on success, <0 on error).
//
// @see Bootstrap
public class Bootstrap_NoThrow
{
/// Initialize the calling process to use Windows App SDK's framework package.
///
/// Find a Windows App SDK framework package meeting the criteria and make it available
/// for use by the current process. If multiple packages meet the criteria the best
/// candidate is selected.
///
/// This is equivalent to `Initialize(majorMinorVersion, null, new PackageVersion())`.
///
/// @param majorMinorVersion major and minor version of Windows App SDK's framework package, encoded as `0xMMMMNNNN` where M=Major, N=Minor (e.g. 1.2 == 0x00010002).
/// @see Initialize(uint, string)
/// @see Initialize(uint, string, PackageVersion)
/// @see Shutdown()
public static int Initialize(uint majorMinorVersion)
{
return Initialize(majorMinorVersion, null);
}

/// Initialize the calling process to use Windows App SDK's framework package.
///
/// Find a Windows App SDK framework package meeting the criteria and make it available
/// for use by the current process. If multiple packages meet the criteria the best
/// candidate is selected.
///
/// This is equivalent to `Initialize(majorMinorVersion, versionTag, new PackageVersion())`.
///
/// @param majorMinorVersion major and minor version of Windows App SDK's framework package, encoded as `0xMMMMNNNN` where M=Major, N=Minor (e.g. 1.2 == 0x00010002).
/// @param versionTag version tag (if any), e.g. "preview1".
/// @see Initialize(uint)
/// @see Initialize(uint, string, PackageVersion)
/// @see Shutdown()
public static int Initialize(uint majorMinorVersion, string versionTag)
{
var minVersion = new PackageVersion();
return Initialize(majorMinorVersion, versionTag, minVersion);
}

/// Initialize the calling process to use Windows App SDK's framework package.
///
/// Find a Windows App SDK framework package meeting the criteria and make it available
/// for use by the current process. If multiple packages meet the criteria the best
/// candidate is selected.
///
/// @param majorMinorVersion major and minor version of Windows App SDK's framework package, encoded as `0xMMMMNNNN` where M=Major, N=Minor (e.g. 1.2 == 0x00010002).
/// @param versionTag version tag (if any), e.g. "preview1".
/// @param minVersion the minimum version to use
/// @see Initialize(uint)
/// @see Initialize(uint, string)
/// @see Shutdown()
public static int Initialize(uint majorMinorVersion, string versionTag, PackageVersion minVersion)
{
return NativeMethods.MddBootstrapInitialize(majorMinorVersion, versionTag, minVersion);
}

/// Undo the changes made by Initialize().
///
/// @warning Packages made available via `Initialize()` and
/// the Dynamic Dependencies API should not be used after this call.
/// @see Initialize(uint)
/// @see Initialize(uint, string)
/// @see Initialize(uint, string, PackageVersion)
public static void Shutdown()
{
NativeMethods.MddBootstrapShutdown();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net5.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<Platforms>x86;x64;arm64</Platforms>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<PublicHeaders Include="$(MSBuildThisFileDirectory)MddLifetimeManagement.h" />
<PublicHeaders Include="$(MSBuildThisFileDirectory)MddLifetimeManagementTest.h" />
<PublicHeaders Include="$(MSBuildThisFileDirectory)MsixDynamicDependency.h" />
<PublicHeaders Include="$(MSBuildThisFileDirectory)..\common\TerminalVelocityFeatures-DynamicDependency.h" />
<PublicHeaders Include="$(MSBuildThisFileDirectory)..\..\common\TerminalVelocityFeatures-DynamicDependency.h" />
<PublicHeaders Include="$(MSBuildThisFileDirectory)wil_msixdynamicdependency.h" />
</ItemGroup>
</Project>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ STDAPI MddGetIdForPackageDependencyContext(
}
CATCH_RETURN();

UINT32 MddGetGenerationId() noexcept
STDAPI_(UINT32) MddGetGenerationId() noexcept
{
if (!::Microsoft::Windows::ApplicationModel::DynamicDependency::Feature_GenerationId::IsEnabled())
{
Expand Down
Loading