From a143f63efb596b4129f8d808813e6c179a95e10c Mon Sep 17 00:00:00 2001 From: Pete Brown Date: Sun, 24 Nov 2024 13:31:54 -0500 Subject: [PATCH 1/3] Fix exception handling in mididiag for instances where the SDK is not installed --- src/app-sdk/mididiag/main.cpp | 41 +++++++++++++++++------------------ 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/src/app-sdk/mididiag/main.cpp b/src/app-sdk/mididiag/main.cpp index 367b2fb5..7c9711a3 100644 --- a/src/app-sdk/mididiag/main.cpp +++ b/src/app-sdk/mididiag/main.cpp @@ -360,9 +360,8 @@ bool DoSectionRegistryEntries(_In_ bool const verbose) // list values under the desktop app sdk runtime - const auto sdkRuntimeRootKey = wil::reg::open_unique_key(HKEY_LOCAL_MACHINE, MIDI_ROOT_APP_SDK_REG_KEY); - - if (sdkRuntimeRootKey.is_valid()) + wil::unique_hkey sdkRuntimeRootKey{ }; + if (SUCCEEDED(wil::reg::open_unique_key_nothrow(HKEY_LOCAL_MACHINE, MIDI_ROOT_APP_SDK_REG_KEY, sdkRuntimeRootKey))) { auto sdkRuntimeInstalledValue = wil::reg::try_get_value_string(sdkRuntimeRootKey.get(), MIDI_APP_SDK_INSTALLED_REG_VALUE); @@ -374,7 +373,6 @@ bool DoSectionRegistryEntries(_In_ bool const verbose) { OutputError(L"No MIDI Desktop app SDK runtime registry 'Installed' value."); } - } else { @@ -408,32 +406,33 @@ bool DoSectionRegistryEntries(_In_ bool const verbose) // list all values under transport plugins - const auto transportPluginsKey = wil::reg::open_unique_key(HKEY_LOCAL_MACHINE, MIDI_ROOT_TRANSPORT_PLUGINS_REG_KEY); - - if (transportPluginsKey.is_valid()) + wil::unique_hkey transportPluginsKey{ }; + if (SUCCEEDED(wil::reg::open_unique_key_nothrow(HKEY_LOCAL_MACHINE, MIDI_ROOT_TRANSPORT_PLUGINS_REG_KEY, transportPluginsKey))) { for (const auto& keyData : wil::make_range(wil::reg::key_iterator{ transportPluginsKey.get() }, wil::reg::key_iterator{})) { // name of the transport in the registry (this doesn't really mean anything) OutputStringField(MIDIDIAG_FIELD_LABEL_REGISTRY_TRANSPORT_NAME, keyData.name); - const auto key = wil::reg::open_unique_key(HKEY_LOCAL_MACHINE, std::wstring(std::wstring(MIDI_ROOT_TRANSPORT_PLUGINS_REG_KEY) + L"\\" + keyData.name).c_str()); - - OutputRegStringValue(MIDIDIAG_FIELD_LABEL_REGISTRY_TRANSPORT_CLSID, key.get(), MIDI_PLUGIN_CLSID_REG_VALUE); - OutputRegDWordBooleanValue(MIDIDIAG_FIELD_LABEL_REGISTRY_TRANSPORT_ENABLED, key.get(), MIDI_PLUGIN_ENABLED_REG_VALUE); + wil::unique_hkey key{ }; + if (SUCCEEDED(wil::reg::open_unique_key_nothrow(HKEY_LOCAL_MACHINE, std::wstring(std::wstring(MIDI_ROOT_TRANSPORT_PLUGINS_REG_KEY) + L"\\" + keyData.name).c_str(), key))) + { + OutputRegStringValue(MIDIDIAG_FIELD_LABEL_REGISTRY_TRANSPORT_CLSID, key.get(), MIDI_PLUGIN_CLSID_REG_VALUE); + OutputRegDWordBooleanValue(MIDIDIAG_FIELD_LABEL_REGISTRY_TRANSPORT_ENABLED, key.get(), MIDI_PLUGIN_ENABLED_REG_VALUE); + // resolve the DLL path for the transport - // resolve the DLL path for the transport + auto midiClsid = wil::reg::try_get_value_string(key.get(), MIDI_PLUGIN_CLSID_REG_VALUE); - auto midiClsid = wil::reg::try_get_value_string(key.get(), MIDI_PLUGIN_CLSID_REG_VALUE); + if (midiClsid.has_value()) + { + OutputCOMComponentInfo(MIDIDIAG_FIELD_LABEL_REGISTRY_TRANSPORT_DLLNAME, midiClsid.value()); + } + else + { + OutputError(L"No clsid found in MIDI transport entry"); + } - if (midiClsid.has_value()) - { - OutputCOMComponentInfo(MIDIDIAG_FIELD_LABEL_REGISTRY_TRANSPORT_DLLNAME, midiClsid.value()); - } - else - { - OutputError(L"No clsid found in MIDI transport entry"); } OutputItemSeparator(); @@ -484,7 +483,7 @@ bool DoSectionRegistryEntries(_In_ bool const verbose) } catch (...) { - OutputError(L"Could not open required registry key(s)."); + OutputError(L"Exception enumerating registry keys and values."); return false; } From 7f7f9cf66b61db17fe1e25c1728c9b8bb40c8c35 Mon Sep 17 00:00:00 2001 From: Pete Brown Date: Sun, 24 Nov 2024 23:18:28 -0500 Subject: [PATCH 2/3] Debugging Arm64X --- src/app-sdk/app-sdk.sln | 3 +++ .../undocked-reg-free-winrt/detours/detours.vcxproj | 8 ++++---- src/app-sdk/winrt/Microsoft.Windows.Devices.Midi2.vcxproj | 5 ++++- src/app-sdk/winrt/midi-app-winrt-sdk.def | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/app-sdk/app-sdk.sln b/src/app-sdk/app-sdk.sln index 10712d20..4f3bedc6 100644 --- a/src/app-sdk/app-sdk.sln +++ b/src/app-sdk/app-sdk.sln @@ -4,6 +4,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 VisualStudioVersion = 17.10.34825.169 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.Windows.Devices.Midi2", "winrt\Microsoft.Windows.Devices.Midi2.vcxproj", "{9EAA3AF3-7328-4F67-A011-E2DD8FBAA4C4}" + ProjectSection(ProjectDependencies) = postProject + {787EC629-C0FB-4BA9-9746-4A82CD06B73E} = {787EC629-C0FB-4BA9-9746-4A82CD06B73E} + EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "0 Shared", "0 Shared", "{78B3E981-FFD4-4C8D-9575-B288DED97905}" ProjectSection(SolutionItems) = preProject diff --git a/src/app-sdk/undocked-reg-free-winrt/detours/detours.vcxproj b/src/app-sdk/undocked-reg-free-winrt/detours/detours.vcxproj index 993b36dc..49b489e5 100644 --- a/src/app-sdk/undocked-reg-free-winrt/detours/detours.vcxproj +++ b/src/app-sdk/undocked-reg-free-winrt/detours/detours.vcxproj @@ -123,13 +123,13 @@ true $(SolutionDir)vsfiles\intermediate\$(ProjectName)\$(Platform)\$(Configuration)\ $(SolutionDir)vsfiles\out\$(ProjectName)\$(Platform)\$(Configuration)\ - true + false true $(SolutionDir)vsfiles\intermediate\$(ProjectName)\$(Platform)\$(Configuration)\ $(SolutionDir)vsfiles\out\$(ProjectName)\$(Platform)\$(Configuration)\ - true + false false @@ -140,13 +140,13 @@ false $(SolutionDir)vsfiles\intermediate\$(ProjectName)\$(Platform)\$(Configuration)\ $(SolutionDir)vsfiles\out\$(ProjectName)\$(Platform)\$(Configuration)\ - true + false false $(SolutionDir)vsfiles\intermediate\$(ProjectName)\$(Platform)\$(Configuration)\ $(SolutionDir)vsfiles\out\$(ProjectName)\$(Platform)\$(Configuration)\ - true + false diff --git a/src/app-sdk/winrt/Microsoft.Windows.Devices.Midi2.vcxproj b/src/app-sdk/winrt/Microsoft.Windows.Devices.Midi2.vcxproj index b7e3f1de..470e01c0 100644 --- a/src/app-sdk/winrt/Microsoft.Windows.Devices.Midi2.vcxproj +++ b/src/app-sdk/winrt/Microsoft.Windows.Devices.Midi2.vcxproj @@ -184,12 +184,13 @@ false false %(AdditionalDependencies);ntdll.lib;Detours.lib - MachineARM64X + MachineARM64 false false %(AdditionalDependencies);ntdll.lib;Detours.lib + MachineARM64X false @@ -243,6 +244,8 @@ %(AdditionalDependencies);ntdll.lib;Detours.lib %(AdditionalDependencies);ntdll.lib;Detours.lib %(AdditionalDependencies);ntdll.lib;Detours.lib + MachineARM64 + MachineARM64X diff --git a/src/app-sdk/winrt/midi-app-winrt-sdk.def b/src/app-sdk/winrt/midi-app-winrt-sdk.def index 989d1573..5cbe6b7f 100644 --- a/src/app-sdk/winrt/midi-app-winrt-sdk.def +++ b/src/app-sdk/winrt/midi-app-winrt-sdk.def @@ -1,4 +1,4 @@ -LIBRARY Microsoft.Windows.Devices.Midi2 +LIBRARY EXPORTS From 8af4595d0c160e1e970c4ee5658bf0fa9d472ee0 Mon Sep 17 00:00:00 2001 From: Pete Brown Date: Mon, 25 Nov 2024 02:30:00 -0500 Subject: [PATCH 3/3] Manifest-free activation now working on Arm64 and x64 --- build/staging/version/BundleInfo.wxi | 2 +- build/staging/version/WindowsMidiServicesVersion.cs | 6 +++--- build/staging/version/WindowsMidiServicesVersion.h | 6 +++--- samples/cpp-winrt/basics/client-basics-cpp.vcxproj | 2 +- samples/cpp-winrt/basics/packages.config | 2 +- .../loopback-endpoints/loopback-endpoints-cpp.vcxproj | 2 +- samples/cpp-winrt/loopback-endpoints/packages.config | 2 +- samples/cpp-winrt/send-speed/packages.config | 2 +- samples/cpp-winrt/send-speed/send-speed-cpp.vcxproj | 2 +- samples/cpp-winrt/static-enum-endpoints/packages.config | 2 +- .../static-enum-endpoints/static-enum-endpoints-cpp.vcxproj | 2 +- samples/cpp-winrt/watch-endpoints/packages.config | 2 +- .../cpp-winrt/watch-endpoints/watch-endpoints-cpp.vcxproj | 2 +- src/app-sdk/mididiag/mididiag.vcxproj | 2 +- src/app-sdk/mididiag/packages.config | 2 +- src/app-sdk/midiusbinfo/midiusbinfo.vcxproj | 2 +- src/app-sdk/midiusbinfo/packages.config | 2 +- src/app-sdk/undocked-reg-free-winrt/detours/detours.vcxproj | 4 ++-- src/app-sdk/winrt/Microsoft.Windows.Devices.Midi2.vcxproj | 4 +--- 19 files changed, 24 insertions(+), 26 deletions(-) diff --git a/build/staging/version/BundleInfo.wxi b/build/staging/version/BundleInfo.wxi index 25ce197b..c21264d0 100644 --- a/build/staging/version/BundleInfo.wxi +++ b/build/staging/version/BundleInfo.wxi @@ -1,4 +1,4 @@ - + diff --git a/build/staging/version/WindowsMidiServicesVersion.cs b/build/staging/version/WindowsMidiServicesVersion.cs index cfbc5070..0f7fd0b2 100644 --- a/build/staging/version/WindowsMidiServicesVersion.cs +++ b/build/staging/version/WindowsMidiServicesVersion.cs @@ -6,12 +6,12 @@ public static class MidiBuildInformation { public const string Source = "GitHub Preview"; public const string Name = "Developer Preview 8"; - public const string BuildFullVersion = "1.0.2-preview-8.241124-138"; + public const string BuildFullVersion = "1.0.2-preview-8.241125-206"; public const string VersionMajor = "1"; public const string VersionMinor = "0"; public const string VersionRevision = "2"; - public const string VersionDateNumber = "241124"; - public const string VersionTimeNumber = "138"; + public const string VersionDateNumber = "241125"; + public const string VersionTimeNumber = "206"; } } diff --git a/build/staging/version/WindowsMidiServicesVersion.h b/build/staging/version/WindowsMidiServicesVersion.h index c6b7f55d..378839a1 100644 --- a/build/staging/version/WindowsMidiServicesVersion.h +++ b/build/staging/version/WindowsMidiServicesVersion.h @@ -5,12 +5,12 @@ #define WINDOWS_MIDI_SERVICES_BUILD_SOURCE L"GitHub Preview" #define WINDOWS_MIDI_SERVICES_BUILD_VERSION_NAME L"Developer Preview 8" -#define WINDOWS_MIDI_SERVICES_BUILD_VERSION_FULL L"1.0.2-preview-8.241124-138" +#define WINDOWS_MIDI_SERVICES_BUILD_VERSION_FULL L"1.0.2-preview-8.241125-206" #define WINDOWS_MIDI_SERVICES_BUILD_VERSION_MAJOR L"1" #define WINDOWS_MIDI_SERVICES_BUILD_VERSION_MINOR L"0" #define WINDOWS_MIDI_SERVICES_BUILD_VERSION_REVISION L"2" -#define WINDOWS_MIDI_SERVICES_BUILD_VERSION_DATE_NUMBER L"241124" -#define WINDOWS_MIDI_SERVICES_BUILD_VERSION_TIME_NUMBER L"138" +#define WINDOWS_MIDI_SERVICES_BUILD_VERSION_DATE_NUMBER L"241125" +#define WINDOWS_MIDI_SERVICES_BUILD_VERSION_TIME_NUMBER L"206" #endif diff --git a/samples/cpp-winrt/basics/client-basics-cpp.vcxproj b/samples/cpp-winrt/basics/client-basics-cpp.vcxproj index 8f1f71a1..890f6f2f 100644 --- a/samples/cpp-winrt/basics/client-basics-cpp.vcxproj +++ b/samples/cpp-winrt/basics/client-basics-cpp.vcxproj @@ -2,7 +2,7 @@ - Microsoft.Windows.Devices.Midi2.1.0.2-preview-8.241124-138 + Microsoft.Windows.Devices.Midi2.1.0.2-preview-8.241125-206 true true false diff --git a/samples/cpp-winrt/basics/packages.config b/samples/cpp-winrt/basics/packages.config index 7796c290..1d4c0819 100644 --- a/samples/cpp-winrt/basics/packages.config +++ b/samples/cpp-winrt/basics/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/samples/cpp-winrt/loopback-endpoints/loopback-endpoints-cpp.vcxproj b/samples/cpp-winrt/loopback-endpoints/loopback-endpoints-cpp.vcxproj index 97cf0c97..035bfd55 100644 --- a/samples/cpp-winrt/loopback-endpoints/loopback-endpoints-cpp.vcxproj +++ b/samples/cpp-winrt/loopback-endpoints/loopback-endpoints-cpp.vcxproj @@ -2,7 +2,7 @@ - Microsoft.Windows.Devices.Midi2.1.0.2-preview-8.241124-138 + Microsoft.Windows.Devices.Midi2.1.0.2-preview-8.241125-206 true true true diff --git a/samples/cpp-winrt/loopback-endpoints/packages.config b/samples/cpp-winrt/loopback-endpoints/packages.config index 7796c290..1d4c0819 100644 --- a/samples/cpp-winrt/loopback-endpoints/packages.config +++ b/samples/cpp-winrt/loopback-endpoints/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/samples/cpp-winrt/send-speed/packages.config b/samples/cpp-winrt/send-speed/packages.config index 7796c290..1d4c0819 100644 --- a/samples/cpp-winrt/send-speed/packages.config +++ b/samples/cpp-winrt/send-speed/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/samples/cpp-winrt/send-speed/send-speed-cpp.vcxproj b/samples/cpp-winrt/send-speed/send-speed-cpp.vcxproj index 7d2a1a57..a582f70a 100644 --- a/samples/cpp-winrt/send-speed/send-speed-cpp.vcxproj +++ b/samples/cpp-winrt/send-speed/send-speed-cpp.vcxproj @@ -2,7 +2,7 @@ - Microsoft.Windows.Devices.Midi2.1.0.2-preview-8.241124-138 + Microsoft.Windows.Devices.Midi2.1.0.2-preview-8.241125-206 true true true diff --git a/samples/cpp-winrt/static-enum-endpoints/packages.config b/samples/cpp-winrt/static-enum-endpoints/packages.config index 7796c290..1d4c0819 100644 --- a/samples/cpp-winrt/static-enum-endpoints/packages.config +++ b/samples/cpp-winrt/static-enum-endpoints/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/samples/cpp-winrt/static-enum-endpoints/static-enum-endpoints-cpp.vcxproj b/samples/cpp-winrt/static-enum-endpoints/static-enum-endpoints-cpp.vcxproj index 2907c303..e3a50d0d 100644 --- a/samples/cpp-winrt/static-enum-endpoints/static-enum-endpoints-cpp.vcxproj +++ b/samples/cpp-winrt/static-enum-endpoints/static-enum-endpoints-cpp.vcxproj @@ -2,7 +2,7 @@ - Microsoft.Windows.Devices.Midi2.1.0.2-preview-8.241124-138 + Microsoft.Windows.Devices.Midi2.1.0.2-preview-8.241125-206 true true true diff --git a/samples/cpp-winrt/watch-endpoints/packages.config b/samples/cpp-winrt/watch-endpoints/packages.config index 7796c290..1d4c0819 100644 --- a/samples/cpp-winrt/watch-endpoints/packages.config +++ b/samples/cpp-winrt/watch-endpoints/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/samples/cpp-winrt/watch-endpoints/watch-endpoints-cpp.vcxproj b/samples/cpp-winrt/watch-endpoints/watch-endpoints-cpp.vcxproj index 8b3703e5..1ee722dc 100644 --- a/samples/cpp-winrt/watch-endpoints/watch-endpoints-cpp.vcxproj +++ b/samples/cpp-winrt/watch-endpoints/watch-endpoints-cpp.vcxproj @@ -2,7 +2,7 @@ - Microsoft.Windows.Devices.Midi2.1.0.2-preview-8.241124-138 + Microsoft.Windows.Devices.Midi2.1.0.2-preview-8.241125-206 true true true diff --git a/src/app-sdk/mididiag/mididiag.vcxproj b/src/app-sdk/mididiag/mididiag.vcxproj index 6e2c648e..34e96b6d 100644 --- a/src/app-sdk/mididiag/mididiag.vcxproj +++ b/src/app-sdk/mididiag/mididiag.vcxproj @@ -2,7 +2,7 @@ - Microsoft.Windows.Devices.Midi2.1.0.2-preview-8.241124-138 + Microsoft.Windows.Devices.Midi2.1.0.2-preview-8.241125-206 true true true diff --git a/src/app-sdk/mididiag/packages.config b/src/app-sdk/mididiag/packages.config index 6986a946..f115fcd8 100644 --- a/src/app-sdk/mididiag/packages.config +++ b/src/app-sdk/mididiag/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/src/app-sdk/midiusbinfo/midiusbinfo.vcxproj b/src/app-sdk/midiusbinfo/midiusbinfo.vcxproj index b5bd8954..987fe84f 100644 --- a/src/app-sdk/midiusbinfo/midiusbinfo.vcxproj +++ b/src/app-sdk/midiusbinfo/midiusbinfo.vcxproj @@ -2,7 +2,7 @@ - Microsoft.Windows.Devices.Midi2.1.0.2-preview-8.241124-138 + Microsoft.Windows.Devices.Midi2.1.0.2-preview-8.241125-206 true true true diff --git a/src/app-sdk/midiusbinfo/packages.config b/src/app-sdk/midiusbinfo/packages.config index 6986a946..f115fcd8 100644 --- a/src/app-sdk/midiusbinfo/packages.config +++ b/src/app-sdk/midiusbinfo/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/src/app-sdk/undocked-reg-free-winrt/detours/detours.vcxproj b/src/app-sdk/undocked-reg-free-winrt/detours/detours.vcxproj index 49b489e5..16be555b 100644 --- a/src/app-sdk/undocked-reg-free-winrt/detours/detours.vcxproj +++ b/src/app-sdk/undocked-reg-free-winrt/detours/detours.vcxproj @@ -129,7 +129,7 @@ true $(SolutionDir)vsfiles\intermediate\$(ProjectName)\$(Platform)\$(Configuration)\ $(SolutionDir)vsfiles\out\$(ProjectName)\$(Platform)\$(Configuration)\ - false + true false @@ -146,7 +146,7 @@ false $(SolutionDir)vsfiles\intermediate\$(ProjectName)\$(Platform)\$(Configuration)\ $(SolutionDir)vsfiles\out\$(ProjectName)\$(Platform)\$(Configuration)\ - false + true diff --git a/src/app-sdk/winrt/Microsoft.Windows.Devices.Midi2.vcxproj b/src/app-sdk/winrt/Microsoft.Windows.Devices.Midi2.vcxproj index 470e01c0..5e0d70e5 100644 --- a/src/app-sdk/winrt/Microsoft.Windows.Devices.Midi2.vcxproj +++ b/src/app-sdk/winrt/Microsoft.Windows.Devices.Midi2.vcxproj @@ -17,7 +17,7 @@ en-US 14.0 true - Windows Store + 10.0 None @@ -120,7 +120,6 @@ $(SolutionDir)vsfiles\intermediate\$(ProjectName)\$(Platform)\$(Configuration)\ $(SolutionDir)VSFiles\intermediate\$(MSBuildProjectName)\$(Platform)\$(Configuration)\GeneratedFiles\ $(SolutionDir)vsfiles\out\Detours\$(Platform)\$(Configuration);$(LibraryPath) - false $(IncludePath) @@ -129,7 +128,6 @@ $(SolutionDir)vsfiles\intermediate\$(ProjectName)\$(Platform)\$(Configuration)\ $(SolutionDir)VSFiles\intermediate\$(MSBuildProjectName)\$(Platform)\$(Configuration)\GeneratedFiles\ $(SolutionDir)vsfiles\out\Detours\$(Platform)\$(Configuration);$(LibraryPath) - false $(IncludePath)