Skip to content

Commit 9bba082

Browse files
Merge pull request #416 from microsoft/pete-dev
Fixed app-to-app MIDI and other IDL-change-related issues
2 parents 04c6fdf + 53b08fc commit 9bba082

Some content is hidden

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

42 files changed

+302
-224
lines changed
Binary file not shown.
Binary file not shown.

build/staging/version/BundleInfo.wxi

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<Include>
22
<?define SetupVersionName="Developer Preview 7 Arm64" ?>
3-
<?define SetupVersionNumber="1.0.1-preview.7.24297.2239" ?>
3+
<?define SetupVersionNumber="1.0.1-preview.7.24301.1830" ?>
44
</Include>

samples/cpp-winrt/basics/client-basics-cpp.vcxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<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')" />
44
<PropertyGroup Label="Globals">
5-
<WindowsMidiServicesSdkPackage>Microsoft.Windows.Devices.Midi2.1.0.1-preview.7.24297.2239</WindowsMidiServicesSdkPackage>
5+
<WindowsMidiServicesSdkPackage>Microsoft.Windows.Devices.Midi2.1.0.1-preview.7.24301.1830</WindowsMidiServicesSdkPackage>
66
<CppWinRTOptimized>true</CppWinRTOptimized>
77
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
88
<CppWinRTGenerateWindowsMetadata>false</CppWinRTGenerateWindowsMetadata>
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Microsoft.Windows.CppWinRT" version="2.0.240405.15" targetFramework="native" />
4-
<package id="Microsoft.Windows.Devices.Midi2" version="1.0.1-preview.7.24297.2239" targetFramework="native" />
4+
<package id="Microsoft.Windows.Devices.Midi2" version="1.0.1-preview.7.24301.1830" targetFramework="native" />
55
</packages>

samples/cpp-winrt/loopback-endpoints/loopback-endpoints-cpp.vcxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<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')" />
44
<PropertyGroup Label="Globals">
5-
<WindowsMidiServicesSdkPackage>Microsoft.Windows.Devices.Midi2.1.0.1-preview.7.24297.2239</WindowsMidiServicesSdkPackage>
5+
<WindowsMidiServicesSdkPackage>Microsoft.Windows.Devices.Midi2.1.0.1-preview.7.24301.1830</WindowsMidiServicesSdkPackage>
66
<CppWinRTOptimized>true</CppWinRTOptimized>
77
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
88
<CppWinRTGenerateWindowsMetadata>true</CppWinRTGenerateWindowsMetadata>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Microsoft.Windows.CppWinRT" version="2.0.240405.15" targetFramework="native" />
4-
<package id="Microsoft.Windows.Devices.Midi2" version="1.0.1-preview.7.24297.2239" targetFramework="native" />
4+
<package id="Microsoft.Windows.Devices.Midi2" version="1.0.1-preview.7.24301.1830" targetFramework="native" />
55
</packages>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Microsoft.Windows.CppWinRT" version="2.0.240405.15" targetFramework="native" />
4-
<package id="Microsoft.Windows.Devices.Midi2" version="1.0.1-preview.7.24297.2239" targetFramework="native" />
4+
<package id="Microsoft.Windows.Devices.Midi2" version="1.0.1-preview.7.24301.1830" targetFramework="native" />
55
</packages>

samples/cpp-winrt/send-speed/send-speed-cpp.vcxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<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')" />
44
<PropertyGroup Label="Globals">
5-
<WindowsMidiServicesSdkPackage>Microsoft.Windows.Devices.Midi2.1.0.1-preview.7.24297.2239</WindowsMidiServicesSdkPackage>
5+
<WindowsMidiServicesSdkPackage>Microsoft.Windows.Devices.Midi2.1.0.1-preview.7.24301.1830</WindowsMidiServicesSdkPackage>
66
<CppWinRTOptimized>true</CppWinRTOptimized>
77
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
88
<CppWinRTGenerateWindowsMetadata>true</CppWinRTGenerateWindowsMetadata>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Microsoft.Windows.CppWinRT" version="2.0.240405.15" targetFramework="native" />
4-
<package id="Microsoft.Windows.Devices.Midi2" version="1.0.1-preview.7.24297.2239" targetFramework="native" />
4+
<package id="Microsoft.Windows.Devices.Midi2" version="1.0.1-preview.7.24301.1830" targetFramework="native" />
55
</packages>

samples/cpp-winrt/static-enum-endpoints/static-enum-endpoints-cpp.vcxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<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')" />
44
<PropertyGroup Label="Globals">
5-
<WindowsMidiServicesSdkPackage>Microsoft.Windows.Devices.Midi2.1.0.1-preview.7.24297.2239</WindowsMidiServicesSdkPackage>
5+
<WindowsMidiServicesSdkPackage>Microsoft.Windows.Devices.Midi2.1.0.1-preview.7.24301.1830</WindowsMidiServicesSdkPackage>
66
<CppWinRTOptimized>true</CppWinRTOptimized>
77
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
88
<CppWinRTGenerateWindowsMetadata>true</CppWinRTGenerateWindowsMetadata>

samples/cpp-winrt/virtual-device-app-winui/packages.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Microsoft.Windows.CppWinRT" version="2.0.240405.15" targetFramework="native" />
4-
<package id="Microsoft.Windows.Devices.Midi2" version="1.0.1-preview.7.24297.2239" targetFramework="native" />
4+
<package id="Microsoft.Windows.Devices.Midi2" version="1.0.1-preview.7.24301.1830" targetFramework="native" />
55
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.220914.1" targetFramework="native" />
66
<package id="Microsoft.Windows.SDK.BuildTools" version="10.0.22621.756" targetFramework="native" />
77
<package id="Microsoft.WindowsAppSDK" version="1.5.240607001" targetFramework="native" />

samples/cpp-winrt/virtual-device-app-winui/virtual-device-app-winui.vcxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<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')" />
55
<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')" />
66
<PropertyGroup Label="Globals">
7-
<WindowsMidiServicesSdkPackage>Microsoft.Windows.Devices.Midi2.1.0.1-preview.7.24297.2239</WindowsMidiServicesSdkPackage>
7+
<WindowsMidiServicesSdkPackage>Microsoft.Windows.Devices.Midi2.1.0.1-preview.7.24301.1830</WindowsMidiServicesSdkPackage>
88
<CppWinRTOptimized>true</CppWinRTOptimized>
99
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
1010
<MinimalCoreWin>true</MinimalCoreWin>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Microsoft.Windows.CppWinRT" version="2.0.240405.15" targetFramework="native" />
4-
<package id="Microsoft.Windows.Devices.Midi2" version="1.0.1-preview.7.24297.2239" targetFramework="native" />
4+
<package id="Microsoft.Windows.Devices.Midi2" version="1.0.1-preview.7.24301.1830" targetFramework="native" />
55
</packages>

samples/cpp-winrt/watch-endpoints/watch-endpoints-cpp.vcxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<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')" />
44
<PropertyGroup Label="Globals">
5-
<WindowsMidiServicesSdkPackage>Microsoft.Windows.Devices.Midi2.1.0.1-preview.7.24297.2239</WindowsMidiServicesSdkPackage>
5+
<WindowsMidiServicesSdkPackage>Microsoft.Windows.Devices.Midi2.1.0.1-preview.7.24301.1830</WindowsMidiServicesSdkPackage>
66
<CppWinRTOptimized>true</CppWinRTOptimized>
77
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
88
<CppWinRTGenerateWindowsMetadata>true</CppWinRTGenerateWindowsMetadata>

samples/csharp-net/basics/client-basics-cs.csproj

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
@@ -9,9 +9,10 @@
99
<Platforms>AnyCPU;x64</Platforms>
1010
</PropertyGroup>
1111

12+
<!-- For versioning info: https://learn.microsoft.com/en-us/nuget/concepts/dependency-resolution#floating-versions -->
1213
<ItemGroup>
13-
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.3" />
14-
<PackageReference Include="Microsoft.Windows.Devices.Midi2" Version="1.0.24260.2134-preview.7" />
14+
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.6" />
15+
<PackageReference Include="Microsoft.Windows.Devices.Midi2" Version="*-*" />
1516
</ItemGroup>
1617

1718
<ItemGroup>

samples/csharp-net/virtual-device-app-winui/MainWindow.xaml.cs

+33-13
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
using Microsoft.Windows.Devices.Midi2.Messages;
2121
using Microsoft.Windows.Devices.Midi2.Endpoints.Virtual;
2222
using Microsoft.Windows.Devices.Midi2.Initialization;
23+
using Windows.UI.Popups;
2324

2425

2526
namespace MidiSample.AppToAppMidi
@@ -37,27 +38,42 @@ public MainWindow()
3738
{
3839
this.InitializeComponent();
3940

41+
UpdateName.IsEnabled = false;
42+
EndpointNameEntry.IsEnabled = false;
43+
PadContainer.Visibility = Visibility.Collapsed;
44+
45+
this.SetWindowSize(500, 600);
46+
this.Closed += MainWindow_Closed;
47+
4048
if (!MidiServicesInitializer.EnsureServiceAvailable())
4149
{
4250
// In your application, you may decide it is appropriate to fall back to an older MIDI API
4351
Console.WriteLine("Windows MIDI Services is not available");
52+
this.AppWindow.Title = "(MIDI not available)";
53+
4454
}
4555
else
4656
{
4757
// bootstrap the SDK runtime. Should check the return result here
4858
MidiServicesInitializer.InitializeSdkRuntime();
4959

50-
StartVirtualDevice();
60+
if (StartVirtualDevice())
61+
{
62+
var notes = new byte[] { 50, 52, 53, 55, 57, 58, 60, 62, 64, 65, 67, 69, 70, 72, 74, 76 };
63+
Notes = notes.Select(n => new Note() { NoteNumber = n, Connection = _connection, GroupIndex = 0, ChannelIndex = 0 }).ToList();
5164

52-
var notes = new byte[] { 50, 52, 53, 55, 57, 58, 60, 62, 64, 65, 67, 69, 70, 72, 74, 76 };
65+
this.SetIsAlwaysOnTop(true);
5366

54-
Notes = notes.Select(n => new Note() { NoteNumber = n, Connection = _connection, GroupIndex = 0, ChannelIndex = 0 }).ToList();
67+
UpdateName.IsEnabled = true;
68+
EndpointNameEntry.IsEnabled = true;
69+
PadContainer.Visibility = Visibility.Visible;
70+
}
71+
else
72+
{
73+
this.AppWindow.Title = "(failed to start virtual device)";
74+
}
5575
}
5676

57-
this.Closed += MainWindow_Closed;
58-
59-
this.SetWindowSize(500, 600);
60-
this.SetIsAlwaysOnTop(true);
6177
}
6278

6379
private void MainWindow_Closed(object sender, WindowEventArgs args)
@@ -72,7 +88,7 @@ private void MainWindow_Closed(object sender, WindowEventArgs args)
7288
_session.Dispose();
7389
}
7490

75-
private void StartVirtualDevice()
91+
private bool StartVirtualDevice()
7692
{
7793
try
7894
{
@@ -89,7 +105,7 @@ private void StartVirtualDevice()
89105
if (_session == null)
90106
{
91107
System.Diagnostics.Debug.WriteLine("StartVirtualDevice Unable to create session");
92-
return;
108+
return false;
93109
}
94110

95111
// create the virtual device, so we can get the endpoint device id to connect to
@@ -100,7 +116,7 @@ private void StartVirtualDevice()
100116
if (_virtualDevice == null)
101117
{
102118
System.Diagnostics.Debug.WriteLine("StartVirtualDevice Unable to create virtual device");
103-
return;
119+
return false;
104120
}
105121

106122
// create our device-side connection
@@ -110,7 +126,7 @@ private void StartVirtualDevice()
110126
if (_connection == null)
111127
{
112128
System.Diagnostics.Debug.WriteLine("StartVirtualDevice failed to create connection");
113-
return;
129+
return false;
114130
}
115131

116132
// necessary for the virtual device to participate in MIDI communication
@@ -128,17 +144,21 @@ private void StartVirtualDevice()
128144
System.Diagnostics.Debug.WriteLine("Connection Opened");
129145

130146
this.AppWindow.Title = creationConfig.Name + ": Connected";
147+
148+
return true;
131149
}
132150
else
133151
{
134152
System.Diagnostics.Debug.WriteLine("Connection Open Failed");
135-
this.AppWindow.Title = creationConfig.Name + ": (no connection)";
136-
}
137153

154+
return false;
155+
}
138156
}
139157
catch (Exception ex)
140158
{
141159
System.Diagnostics.Debug.WriteLine("Exception: " + ex.ToString());
160+
161+
return false;
142162
}
143163
}
144164

samples/csharp-net/virtual-device-app-winui/virtual-device-app-winui-cs.csproj

+3-2
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@
5252
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
5353
</ItemGroup>
5454

55+
<!-- For versioning info: https://learn.microsoft.com/en-us/nuget/concepts/dependency-resolution#floating-versions -->
5556
<ItemGroup>
56-
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.3" />
57-
<PackageReference Include="Microsoft.Windows.Devices.Midi2" Version="1.0.24260.2134-preview.7" />
57+
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.6" />
58+
<PackageReference Include="Microsoft.Windows.Devices.Midi2" Version="*-*" />
5859
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.240829007" />
5960
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1" />
6061
<PackageReference Include="WinUIEx" Version="2.4.0" />

src/api/Abstraction/MidiSrvAbstraction/Midi2.MidiSrvConfigurationManager.cpp

+40-15
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,48 @@ CMidi2MidiSrvConfigurationManager::Initialize(
4242

4343
_Use_decl_annotations_
4444
HRESULT
45-
CMidi2MidiSrvConfigurationManager::UpdateConfiguration(LPCWSTR configurationJson, LPWSTR* response)
45+
CMidi2MidiSrvConfigurationManager::UpdateConfiguration(LPCWSTR configurationJson, LPWSTR* responseJson)
4646
{
4747
TraceLoggingWrite(
4848
MidiSrvAbstractionTelemetryProvider::Provider(),
4949
MIDI_TRACE_EVENT_INFO,
5050
TraceLoggingString(__FUNCTION__, MIDI_TRACE_EVENT_LOCATION_FIELD),
5151
TraceLoggingLevel(WINEVENT_LEVEL_INFO),
52-
TraceLoggingPointer(this, "this")
53-
);
52+
TraceLoggingPointer(this, "this"),
53+
TraceLoggingWideString(L"Entering UpdateConfiguration", MIDI_TRACE_EVENT_MESSAGE_FIELD),
54+
TraceLoggingWideString(configurationJson, "config json"),
55+
TraceLoggingPointer(responseJson, "Response pointer")
56+
);
5457

55-
wil::unique_rpc_binding bindingHandle;
58+
RETURN_HR_IF_NULL(E_INVALIDARG, responseJson);
59+
60+
// requirement for RPC and also in case of failure
61+
*responseJson = NULL;
5662

57-
RETURN_IF_FAILED(GetMidiSrvBindingHandle(&bindingHandle));
58-
RETURN_HR_IF_NULL(E_INVALIDARG, response);
5963
RETURN_HR_IF_NULL(E_INVALIDARG, configurationJson);
6064

65+
wil::unique_rpc_binding bindingHandle;
66+
RETURN_IF_FAILED(GetMidiSrvBindingHandle(&bindingHandle));
67+
6168
RETURN_IF_FAILED([&]()
6269
{
6370
// RPC calls are placed in a lambda to work around compiler error C2712, limiting use of try/except blocks
6471
// with structured exception handling.
65-
RpcTryExcept RETURN_IF_FAILED(MidiSrvUpdateConfiguration(bindingHandle.get(), configurationJson, response));
72+
RpcTryExcept RETURN_IF_FAILED(MidiSrvUpdateConfiguration(bindingHandle.get(), configurationJson, responseJson));
6673
RpcExcept(I_RpcExceptionFilter(RpcExceptionCode())) RETURN_IF_FAILED(HRESULT_FROM_WIN32(RpcExceptionCode()));
6774
RpcEndExcept
75+
76+
TraceLoggingWrite(
77+
MidiSrvAbstractionTelemetryProvider::Provider(),
78+
MIDI_TRACE_EVENT_INFO,
79+
TraceLoggingString(__FUNCTION__, MIDI_TRACE_EVENT_LOCATION_FIELD),
80+
TraceLoggingLevel(WINEVENT_LEVEL_INFO),
81+
TraceLoggingPointer(this, "this"),
82+
TraceLoggingWideString(L"Completed RPC call", MIDI_TRACE_EVENT_MESSAGE_FIELD),
83+
TraceLoggingWideString(configurationJson, "config json"),
84+
TraceLoggingPointer(responseJson, "Response pointer")
85+
);
86+
6887
return S_OK;
6988
}());
7089

@@ -84,16 +103,17 @@ CMidi2MidiSrvConfigurationManager::GetTransportList(LPWSTR* transportListJson)
84103
TraceLoggingPointer(this, "this")
85104
);
86105

87-
wil::unique_rpc_binding bindingHandle;
106+
RETURN_HR_IF_NULL(E_INVALIDARG, transportListJson);
88107

108+
// requirement for RPC and also in case of failure
109+
*transportListJson = NULL;
110+
111+
wil::unique_rpc_binding bindingHandle;
89112
RETURN_IF_FAILED(GetMidiSrvBindingHandle(&bindingHandle));
90-
RETURN_HR_IF_NULL(E_INVALIDARG, transportListJson);
113+
91114

92115
RETURN_IF_FAILED([&]()
93116
{
94-
// RPC requirement
95-
//*transportListJson = nullptr;
96-
97117
// RPC calls are placed in a lambda to work around compiler error C2712, limiting use of try/except blocks
98118
// with structured exception handling.
99119
RpcTryExcept RETURN_IF_FAILED(MidiSrvGetTransportList(bindingHandle.get(), transportListJson));
@@ -118,19 +138,24 @@ CMidi2MidiSrvConfigurationManager::GetTransformList(LPWSTR* transformListJson)
118138
TraceLoggingPointer(this, "this")
119139
);
120140

121-
wil::unique_rpc_binding bindingHandle;
141+
RETURN_HR_IF_NULL(E_INVALIDARG, transformListJson);
122142

143+
// requirement for RPC and also in case of failure
144+
*transformListJson = NULL;
145+
146+
wil::unique_rpc_binding bindingHandle;
123147
RETURN_IF_FAILED(GetMidiSrvBindingHandle(&bindingHandle));
124-
RETURN_HR_IF_NULL(E_INVALIDARG, transformListJson);
148+
125149

126150
RETURN_IF_FAILED([&]()
127151
{
152+
128153
// RPC calls are placed in a lambda to work around compiler error C2712, limiting use of try/except blocks
129154
// with structured exception handling.
130155
RpcTryExcept RETURN_IF_FAILED(MidiSrvGetTransformList(bindingHandle.get(), transformListJson));
131156
RpcExcept(I_RpcExceptionFilter(RpcExceptionCode())) RETURN_IF_FAILED(HRESULT_FROM_WIN32(RpcExceptionCode()));
132157
RpcEndExcept
133-
return S_OK;
158+
return S_OK;
134159
}());
135160

136161
return S_OK;

src/api/Abstraction/MidiSrvAbstraction/Midi2.MidiSrvConfigurationManager.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ class CMidi2MidiSrvConfigurationManager :
1717
public:
1818
STDMETHOD(Initialize(
1919
_In_ GUID transportId,
20-
_In_ IMidiDeviceManagerInterface* deviceManagerInterface,
21-
_In_ IMidiServiceConfigurationManagerInterface* midiServiceConfigurationManagerInterface));
20+
_In_opt_ IMidiDeviceManagerInterface* deviceManagerInterface,
21+
_In_opt_ IMidiServiceConfigurationManagerInterface* midiServiceConfigurationManagerInterface));
2222

2323
STDMETHOD(UpdateConfiguration(_In_ LPCWSTR configurationJson, _Out_ LPWSTR* responseJson));
24+
//STDMETHOD(UpdateConfiguration(_In_ LPCWSTR configurationJson, _Inout_ BSTR* responseJson));
2425
STDMETHOD(Shutdown)();
2526

2627

src/api/Abstraction/MidiSrvAbstraction/Midi2.MidiSrvSessionTracker.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ CMidi2MidiSrvSessionTracker::GetSessionList(
147147

148148
RETURN_IF_FAILED([&]()
149149
{
150+
// RPC requirement
151+
*sessionList = nullptr;
152+
150153
// RPC calls are placed in a lambda to work around compiler error C2712, limiting use of try/except blocks
151154
// with structured exception handling.
152155
RpcTryExcept RETURN_IF_FAILED(MidiSrvGetSessionList(bindingHandle.get(), sessionList));

0 commit comments

Comments
 (0)