Current Windows MIDI Services detection approach (based on COM activation) is not sufficient for cases where the service or bits are present, but currently disabled as part of the controlled rollout process.
https://github.com/microsoft/MIDI/tree/main/samples/cpp/detectmidi
For example, after KB5065789 went out to 25h2 and 24h2 etc. the MIDI Service is present, but isn't supposed to run. However, the current COM activation succeeds, resulting in broken detection.
NOTE: Windows MIDI Services app code should not be deployed in production until we (Microsoft) give the OK for that. The SDK is not approved for production use at this time, and to clarify, that includes the code to detect the presence of the service and SDK. They are for use only with test customers using Windows Insider Canary releases of Windows.
Need to update this example and guidance with a version which takes into account whether or not the service is actually enabled per the rollout.