UWP certification issues when using C++20 std::stop_token in code

Rafael Lecina 26 Reputation points
2022-03-14T11:20:45.37+00:00

Hi

We’ve recently updated our UWP application to use C++20 by porting it from C++/Cx to C++/WinRT without issues

After that we’ve started to use some new C++20 features (everything looks to work fine locally)
Our issue is that we’ve started using std::stop_token as a way to mark task cancellation. Everything looks to work fine but the “Windows App Cert Kit” complains that we are using usupported API on UWP (see attached screenshot)

Those APIs seem to come from some new std::atomic methods

We have this line on our appmanifest file

<PackageDependency Name="Microsoft.VCLibs.140.00.UWPDesktop" MinVersion="14.0.24217.0" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />

I also tried to set MinVersion to 14.0.30035.0 (which is the version I can see inside VS folders) but that fails with the same issues

We are using VS 2019 16.11.10. I also tried changing C++ Language Standard setting from /std:C++20 to /std::c++latest and does not fix my issue
Our main problem is that Windows App Cert Kit reports usage of invalid APIs on our applications for UWP for functionality inside the std C++20 library. In particular the issue is with std::atomic::notify_all_direct and std::atomic::wait::direct which are used by std::stop_token. We are using Visual Studio 2019 16.11.10 and I've attached a screenshot from the certification result

182729-image.png

We cannot update our applications on the Microsoft Store because of this issue...

Developer technologies | Universal Windows Platform (UWP)
Microsoft Partner Center | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Rafael Lecina 26 Reputation points
    2022-03-29T08:23:32.66+00:00

    Hi

    Thank you very much for your help @Nico Zhu (Shanghai Wicresoft Co,.Ltd.)

    We found a dirty workaround by using stop_token bundled on GCC's libstdc++ instead of the one bundled on MSVC std library. I don't like too much this fix because we support several different platforms and is good for us to stick to standard utilities

    I assume we will eventually get stuck again on different functionality while we continue our development so I'll keep his contact in case we may find a new blocker.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.