Skip to content

Commit

Permalink
Merge pull request #444 from microsoft/pete-dev
Browse files Browse the repository at this point in the history
Update Microsoft.Windows.Devices.Midi2.Initialization.hpp
  • Loading branch information
Psychlist1972 authored Nov 25, 2024
2 parents 70f323a + 8b36b50 commit 3b1372e
Showing 1 changed file with 9 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@
(p) = NULL; \
}



// these are files generated from the MIDL compiler and are
// provided alongside this file for use in your apps
// they should be included in your app before this file. They
// are not included here because that can result in dups


namespace Microsoft::Windows::Devices::Midi2::Initialization
{
typedef enum
Expand Down Expand Up @@ -181,7 +173,7 @@ namespace Microsoft::Windows::Devices::Midi2::Initialization
DWORD installedVersionMinor{ 0 };
DWORD installedVersionRevision{ 0 };

m_initializer->GetInstalledWindowsMidiServicesSdkVersion(
if (SUCCEEDED(m_initializer->GetInstalledWindowsMidiServicesSdkVersion(
nullptr, // build platform
&installedVersionMajor, // major
&installedVersionMinor, // minor
Expand All @@ -191,13 +183,16 @@ namespace Microsoft::Windows::Devices::Midi2::Initialization
nullptr, // buildSource string. Remember to cotaskmemfree if provided
nullptr, // versionName string. Remember to cotaskmemfree if provided
nullptr // versionFullString string. Remember to cotaskmemfree if provided
);
)))
{
if (minRequiredVersionMajor > installedVersionMajor) return false;
if (minRequiredVersionMinor > installedVersionMinor) return false;
if (minRequiredVersionRevision > installedVersionRevision) return false;

if (minRequiredVersionMajor > installedVersionMajor) return false;
if (minRequiredVersionMinor > installedVersionMinor) return false;
if (minRequiredVersionRevision > installedVersionRevision) return false;
return true;
}

return true;
return false;
}
else
{
Expand All @@ -207,21 +202,6 @@ namespace Microsoft::Windows::Devices::Midi2::Initialization
}
}

//// TODO: function to return the installed SDK version
//bool GetSdkVersion(PWINDOWSMIDISERVICESAPPSDKVERSION installedVersion)
//{
// if (m_initializer != nullptr)
// {
// if (SUCCEEDED(m_initializer->GetInstalledWindowsMidiServicesSdkVersion(installedVersion)))
// {
// return true;
// }
// }

// return false;
//}



void ShutdownSdkRuntime()
{
Expand Down

0 comments on commit 3b1372e

Please sign in to comment.