Skip to content

Commit

Permalink
Merge pull request #424 from microsoft/pete-dev
Browse files Browse the repository at this point in the history
Pete dev - sync up to main for DP8 work
  • Loading branch information
Psychlist1972 authored Nov 4, 2024
2 parents 14bb9cd + 8758874 commit 19ba0b0
Show file tree
Hide file tree
Showing 72 changed files with 1,179 additions and 174 deletions.
6 changes: 6 additions & 0 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,13 @@
"BuildConsoleApp",
"BuildCppSamples",
"BuildCSharpSamples",
"BuildInDevelopmentServicePlugins",
"BuildInDevelopmentServicePluginsInstaller",
"BuildServiceAndPlugins",
"BuildServiceAndPluginsInstaller",
"BuildSettingsApp",
"BuildUserToolsSharedComponents",
"CreateVersionIncludes",
"Prerequisites"
]
}
Expand All @@ -92,10 +95,13 @@
"BuildConsoleApp",
"BuildCppSamples",
"BuildCSharpSamples",
"BuildInDevelopmentServicePlugins",
"BuildInDevelopmentServicePluginsInstaller",
"BuildServiceAndPlugins",
"BuildServiceAndPluginsInstaller",
"BuildSettingsApp",
"BuildUserToolsSharedComponents",
"CreateVersionIncludes",
"Prerequisites"
]
}
Expand Down
215 changes: 197 additions & 18 deletions build/nuke_build/Build.cs

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/staging/app-sdk/Arm64EC/mididiag.exe
Binary file not shown.
4 changes: 2 additions & 2 deletions build/staging/version/BundleInfo.wxi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Include>
<?define SetupVersionName="Developer Preview 7 Arm64" ?>
<?define SetupVersionNumber="1.0.1-preview.7.24305.1438" ?>
<?define SetupVersionName="Developer Preview 8 Arm64" ?>
<?define SetupVersionNumber="1.0.1-preview.8.24308.1821" ?>
</Include>
2 changes: 1 addition & 1 deletion samples/cpp-winrt/basics/client-basics-cpp.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.props')" />
<PropertyGroup Label="Globals">
<WindowsMidiServicesSdkPackage>Microsoft.Windows.Devices.Midi2.1.0.1-preview.7.24305.1438</WindowsMidiServicesSdkPackage>
<WindowsMidiServicesSdkPackage>Microsoft.Windows.Devices.Midi2.1.0.1-preview.8.24308.2011</WindowsMidiServicesSdkPackage>
<CppWinRTOptimized>true</CppWinRTOptimized>
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
<CppWinRTGenerateWindowsMetadata>false</CppWinRTGenerateWindowsMetadata>
Expand Down
2 changes: 1 addition & 1 deletion samples/cpp-winrt/basics/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.240405.15" targetFramework="native" />
<package id="Microsoft.Windows.Devices.Midi2" version="1.0.1-preview.7.24305.1438" targetFramework="native" />
<package id="Microsoft.Windows.Devices.Midi2" version="1.0.1-preview.8.24308.2011" targetFramework="native" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.props')" />
<PropertyGroup Label="Globals">
<WindowsMidiServicesSdkPackage>Microsoft.Windows.Devices.Midi2.1.0.1-preview.7.24305.1438</WindowsMidiServicesSdkPackage>
<WindowsMidiServicesSdkPackage>Microsoft.Windows.Devices.Midi2.1.0.1-preview.8.24308.2011</WindowsMidiServicesSdkPackage>
<CppWinRTOptimized>true</CppWinRTOptimized>
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
<CppWinRTGenerateWindowsMetadata>true</CppWinRTGenerateWindowsMetadata>
Expand Down
2 changes: 1 addition & 1 deletion samples/cpp-winrt/loopback-endpoints/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.240405.15" targetFramework="native" />
<package id="Microsoft.Windows.Devices.Midi2" version="1.0.1-preview.7.24305.1438" targetFramework="native" />
<package id="Microsoft.Windows.Devices.Midi2" version="1.0.1-preview.8.24308.2011" targetFramework="native" />
</packages>
2 changes: 1 addition & 1 deletion samples/cpp-winrt/send-speed/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.240405.15" targetFramework="native" />
<package id="Microsoft.Windows.Devices.Midi2" version="1.0.1-preview.7.24305.1438" targetFramework="native" />
<package id="Microsoft.Windows.Devices.Midi2" version="1.0.1-preview.8.24308.2011" targetFramework="native" />
</packages>
2 changes: 1 addition & 1 deletion samples/cpp-winrt/send-speed/send-speed-cpp.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.props')" />
<PropertyGroup Label="Globals">
<WindowsMidiServicesSdkPackage>Microsoft.Windows.Devices.Midi2.1.0.1-preview.7.24305.1438</WindowsMidiServicesSdkPackage>
<WindowsMidiServicesSdkPackage>Microsoft.Windows.Devices.Midi2.1.0.1-preview.8.24308.2011</WindowsMidiServicesSdkPackage>
<CppWinRTOptimized>true</CppWinRTOptimized>
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
<CppWinRTGenerateWindowsMetadata>true</CppWinRTGenerateWindowsMetadata>
Expand Down
2 changes: 1 addition & 1 deletion samples/cpp-winrt/static-enum-endpoints/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.240405.15" targetFramework="native" />
<package id="Microsoft.Windows.Devices.Midi2" version="1.0.1-preview.7.24305.1438" targetFramework="native" />
<package id="Microsoft.Windows.Devices.Midi2" version="1.0.1-preview.8.24308.2011" targetFramework="native" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.props')" />
<PropertyGroup Label="Globals">
<WindowsMidiServicesSdkPackage>Microsoft.Windows.Devices.Midi2.1.0.1-preview.7.24305.1438</WindowsMidiServicesSdkPackage>
<WindowsMidiServicesSdkPackage>Microsoft.Windows.Devices.Midi2.1.0.1-preview.8.24308.2011</WindowsMidiServicesSdkPackage>
<CppWinRTOptimized>true</CppWinRTOptimized>
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
<CppWinRTGenerateWindowsMetadata>true</CppWinRTGenerateWindowsMetadata>
Expand Down
2 changes: 1 addition & 1 deletion samples/cpp-winrt/virtual-device-app-winui/packages.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.240405.15" targetFramework="native" />
<package id="Microsoft.Windows.Devices.Midi2" version="1.0.1-preview.7.24305.1438" targetFramework="native" />
<package id="Microsoft.Windows.Devices.Midi2" version="1.0.1-preview.8.24308.2011" targetFramework="native" />
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.220914.1" targetFramework="native" />
<package id="Microsoft.Windows.SDK.BuildTools" version="10.0.22621.756" targetFramework="native" />
<package id="Microsoft.WindowsAppSDK" version="1.5.240607001" targetFramework="native" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.props')" />
<Import Project="..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.756\build\Microsoft.Windows.SDK.BuildTools.props" Condition="Exists('..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.756\build\Microsoft.Windows.SDK.BuildTools.props')" />
<PropertyGroup Label="Globals">
<WindowsMidiServicesSdkPackage>Microsoft.Windows.Devices.Midi2.1.0.1-preview.7.24305.1438</WindowsMidiServicesSdkPackage>
<WindowsMidiServicesSdkPackage>Microsoft.Windows.Devices.Midi2.1.0.1-preview.8.24308.2011</WindowsMidiServicesSdkPackage>
<CppWinRTOptimized>true</CppWinRTOptimized>
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
<MinimalCoreWin>true</MinimalCoreWin>
Expand Down
2 changes: 1 addition & 1 deletion samples/cpp-winrt/watch-endpoints/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.240405.15" targetFramework="native" />
<package id="Microsoft.Windows.Devices.Midi2" version="1.0.1-preview.7.24305.1438" targetFramework="native" />
<package id="Microsoft.Windows.Devices.Midi2" version="1.0.1-preview.8.24308.2011" targetFramework="native" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.props')" />
<PropertyGroup Label="Globals">
<WindowsMidiServicesSdkPackage>Microsoft.Windows.Devices.Midi2.1.0.1-preview.7.24305.1438</WindowsMidiServicesSdkPackage>
<WindowsMidiServicesSdkPackage>Microsoft.Windows.Devices.Midi2.1.0.1-preview.8.24308.2011</WindowsMidiServicesSdkPackage>
<CppWinRTOptimized>true</CppWinRTOptimized>
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
<CppWinRTGenerateWindowsMetadata>true</CppWinRTGenerateWindowsMetadata>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,50 +40,50 @@ CMidi2NetworkMidiConfigurationManager::Initialize(



MidiNetworkUdpHostAuthentication MidiNetworkUdpHostAuthenticationFromJsonString(_In_ winrt::hstring const& jsonString)
MidiNetworkHostAuthentication MidiNetworkHostAuthenticationFromJsonString(_In_ winrt::hstring const& jsonString)
{
auto value = internal::ToLowerTrimmedHStringCopy(jsonString);

if (value == MIDI_CONFIG_JSON_ENDPOINT_NETWORK_MIDI_HOST_AUTHENTICATION_VALUE_NONE)
{
return MidiNetworkUdpHostAuthentication::NoAuthentication;
return MidiNetworkHostAuthentication::NoAuthentication;
}
else if (value == MIDI_CONFIG_JSON_ENDPOINT_NETWORK_MIDI_HOST_AUTHENTICATION_VALUE_PASSWORD)
{
return MidiNetworkUdpHostAuthentication::PasswordAuthentication;
return MidiNetworkHostAuthentication::PasswordAuthentication;
}
else if (value == MIDI_CONFIG_JSON_ENDPOINT_NETWORK_MIDI_HOST_AUTHENTICATION_VALUE_USER)
{
return MidiNetworkUdpHostAuthentication::UserAuthentication;
return MidiNetworkHostAuthentication::UserAuthentication;
}
else
{
// default is any
return MidiNetworkUdpHostAuthentication::NoAuthentication;
return MidiNetworkHostAuthentication::NoAuthentication;
}
}


MidiNetworkUdpHostConnectionPolicy MidiNetworkUdpHostConnectionPolicyFromJsonString(_In_ winrt::hstring const& jsonString)
MidiNetworkHostConnectionPolicy MidiNetworkHostConnectionPolicyFromJsonString(_In_ winrt::hstring const& jsonString)
{
auto value = internal::ToLowerTrimmedHStringCopy(jsonString);

if (value == MIDI_CONFIG_JSON_ENDPOINT_NETWORK_MIDI_CONNECTION_POLICY_ALLOW_IPV4_VALUE_ANY)
{
return MidiNetworkUdpHostConnectionPolicy::AllowAllConnections;
return MidiNetworkHostConnectionPolicy::PolicyAllowAllConnections;
}
else if (value == MIDI_CONFIG_JSON_ENDPOINT_NETWORK_MIDI_CONNECTION_POLICY_ALLOW_IPV4_VALUE_LIST)
{
return MidiNetworkUdpHostConnectionPolicy::AllowFromIpList;
return MidiNetworkHostConnectionPolicy::PolicyAllowFromIpList;
}
else if (value == MIDI_CONFIG_JSON_ENDPOINT_NETWORK_MIDI_CONNECTION_POLICY_ALLOW_IPV4_VALUE_RANGE)
{
return MidiNetworkUdpHostConnectionPolicy::AllowFromIpRange;
return MidiNetworkHostConnectionPolicy::PolicyAllowFromIpRange;
}
else
{
// default is any
return MidiNetworkUdpHostConnectionPolicy::AllowAllConnections;
return MidiNetworkHostConnectionPolicy::PolicyAllowAllConnections;
}
}

Expand All @@ -92,7 +92,7 @@ MidiNetworkUdpHostConnectionPolicy MidiNetworkUdpHostConnectionPolicyFromJsonStr
_Use_decl_annotations_
HRESULT
CMidi2NetworkMidiConfigurationManager::ValidateHostDefinition(
MidiNetworkUdpHostDefinition& definition,
MidiNetworkHostDefinition& definition,
winrt::hstring& errorMessage)
{
errorMessage = L"";
Expand Down Expand Up @@ -120,7 +120,7 @@ CMidi2NetworkMidiConfigurationManager::ValidateHostDefinition(
return E_INVALIDARG;
}

if (definition.ConnectionPolicy == MidiNetworkUdpHostConnectionPolicy::AllowFromIpRange)
if (definition.ConnectionPolicy == MidiNetworkHostConnectionPolicy::PolicyAllowFromIpRange)
{
// validate that there are exactly two entries

Expand All @@ -130,7 +130,7 @@ CMidi2NetworkMidiConfigurationManager::ValidateHostDefinition(
return E_INVALIDARG;
}
}
else if (definition.ConnectionPolicy == MidiNetworkUdpHostConnectionPolicy::AllowFromIpList)
else if (definition.ConnectionPolicy == MidiNetworkHostConnectionPolicy::PolicyAllowFromIpList)
{
// validate that there is at least one entry

Expand Down Expand Up @@ -194,6 +194,7 @@ CMidi2NetworkMidiConfigurationManager::UpdateConfiguration(
// "networkPort" : "auto",
// "umpOnly" : true,
// "enabled" : true,
// "advertise" : true,
// "connectionRulesIpv4" :
// {
// "allow" : "list",
Expand Down Expand Up @@ -278,7 +279,7 @@ CMidi2NetworkMidiConfigurationManager::UpdateConfiguration(
// are we defining a host?
if (auto hostEntry = jsonEntry.GetNamedObject(MIDI_CONFIG_JSON_ENDPOINT_NETWORK_MIDI_HOST_KEY, nullptr); hostEntry != nullptr)
{
MidiNetworkUdpHostDefinition definition;
MidiNetworkHostDefinition definition;
winrt::hstring validationErrorMessage{};

// currently, UDP is the only allowed protocol
Expand All @@ -296,11 +297,11 @@ CMidi2NetworkMidiConfigurationManager::UpdateConfiguration(
definition.UmpEndpointName = internal::TrimmedHStringCopy(hostEntry.GetNamedString(MIDI_CONFIG_JSON_ENDPOINT_COMMON_NAME_PROPERTY, L""));
definition.ProductInstanceId = internal::TrimmedHStringCopy(hostEntry.GetNamedString(MIDI_CONFIG_JSON_ENDPOINT_NETWORK_MIDI_PRODUCT_INSTANCE_ID_PROPERTY, L""));

definition.Authentication = MidiNetworkUdpHostAuthenticationFromJsonString(hostEntry.GetNamedString(MIDI_CONFIG_JSON_ENDPOINT_NETWORK_MIDI_HOST_AUTHENTICATION_KEY, L""));
definition.ConnectionPolicy = MidiNetworkUdpHostConnectionPolicyFromJsonString(hostEntry.GetNamedString(MIDI_CONFIG_JSON_ENDPOINT_NETWORK_MIDI_CONNECTION_POLICY_KEY, L""));
definition.Authentication = MidiNetworkHostAuthenticationFromJsonString(hostEntry.GetNamedString(MIDI_CONFIG_JSON_ENDPOINT_NETWORK_MIDI_HOST_AUTHENTICATION_KEY, L""));
definition.ConnectionPolicy = MidiNetworkHostConnectionPolicyFromJsonString(hostEntry.GetNamedString(MIDI_CONFIG_JSON_ENDPOINT_NETWORK_MIDI_CONNECTION_POLICY_KEY, L""));

// read the list of ip info
if (definition.ConnectionPolicy != MidiNetworkUdpHostConnectionPolicy::AllowAllConnections)
if (definition.ConnectionPolicy != MidiNetworkHostConnectionPolicy::PolicyAllowAllConnections)
{
auto addressArray = hostEntry.GetNamedArray(MIDI_CONFIG_JSON_ENDPOINT_NETWORK_MIDI_CONNECTION_POLICY_IPV4_ADDRESSES_KEY);

Expand All @@ -315,14 +316,14 @@ CMidi2NetworkMidiConfigurationManager::UpdateConfiguration(
}

// read authentication information
if (definition.Authentication != MidiNetworkUdpHostAuthentication::NoAuthentication)
if (definition.Authentication != MidiNetworkHostAuthentication::NoAuthentication)
{

if (definition.Authentication == MidiNetworkUdpHostAuthentication::PasswordAuthentication)
if (definition.Authentication == MidiNetworkHostAuthentication::PasswordAuthentication)
{
// TODO: Read the password vault key
}
else if (definition.Authentication == MidiNetworkUdpHostAuthentication::UserAuthentication)
else if (definition.Authentication == MidiNetworkHostAuthentication::UserAuthentication)
{
// TODO: Read username/password vault key
}
Expand Down Expand Up @@ -355,7 +356,7 @@ CMidi2NetworkMidiConfigurationManager::UpdateConfiguration(

definition.ServiceInstanceName = serviceInstanceNamePrefix;

// TODO: See if the serviceInstanceName is already in use. If so, add a disambiguation number
// TODO: See if the serviceInstanceName is already in use. If so, add a disambiguation number. Keep trying until unused one is found



Expand All @@ -371,7 +372,13 @@ CMidi2NetworkMidiConfigurationManager::UpdateConfiguration(
RETURN_HR_IF_NULL(E_POINTER, host);
RETURN_IF_FAILED(host->Initialize(definition));

host->Start();
// TODO: add to our collection of hosts


TransportState::Current().AddHost(host);

// start the network host
RETURN_IF_FAILED(host->Start());
}
else
{
Expand All @@ -386,24 +393,6 @@ CMidi2NetworkMidiConfigurationManager::UpdateConfiguration(
// TODO: Add to the client reconnect table
}



// internal::JsonStringifyObjectToOutParam(responseObject, &Response);

// // create the device-side endpoint. This is a critical step
// RETURN_IF_FAILED(AbstractionState::Current().GetEndpointManager()->CreateDeviceSideEndpoint(deviceEntry));

// // mark success
// responseObject.SetNamedValue(
// MIDI_CONFIG_JSON_CONFIGURATION_RESPONSE_SUCCESS_PROPERTY_KEY,
// jsonTrue);

// // TODO: This should have the association Id or something in it for the client to make sense of it
// auto singleResponse = internal::JsonCreateSingleWStringPropertyObject(
// MIDI_CONFIG_JSON_ENDPOINT_VIRTUAL_DEVICE_RESPONSE_CREATED_ID_PROPERTY_KEY,
// deviceEntry.CreatedDeviceEndpointId);

// createdDevicesResponseArray.Append(singleResponse);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CMidi2NetworkMidiConfigurationManager :
STDMETHOD(UpdateConfiguration(_In_ LPCWSTR configurationJsonSection, _Out_ LPWSTR* Response));
STDMETHOD(Shutdown)();

STDMETHOD(ValidateHostDefinition(_In_ MidiNetworkUdpHostDefinition& definition, _Out_ winrt::hstring& errorMessage));
STDMETHOD(ValidateHostDefinition(_In_ MidiNetworkHostDefinition& definition, _Out_ winrt::hstring& errorMessage));
// STDMETHOD(ValidateClientDefinition(_In_ MidiNetworkUdpClientDefinition& definition));

private:
Expand Down
Loading

0 comments on commit 19ba0b0

Please sign in to comment.