On 2023-06-27 17:21, LIU Hao wrote:
在 2023-06-27 20:24, Steve Lhomme 写道:
They're allowed by the WACK and available in windowsapp.lib since 19H1.
They're not allowed by the Windows SDK headers.

These functions can be found in api-ms-win-core-localization-l1-2-0.
---
  mingw-w64-headers/include/winnls.h | 13 ++++++++-----
  1 file changed, 8 insertions(+), 5 deletions(-)

Are there any reasons why we should declare it while Microsoft do not? Are there any projects that use them?

Technically the MS headers are not always the cleanest. They do restrict when something is restricted, however they sometimes go too far. I have found that reliable sources are windowsapp.lib and the WACK (in that order).

It's always possible to access API's by doing something like, and in the end the code will link and be allowed by the WACK and work on all UWP platforms:

#undef WINAPI_FAMILY
#define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP

That would be necessary to enable the code when built with MSVC.

If Windows SDK headers do not declare these functions, then people shouldn't use them in that scenario, even they seem to pass WACK.

Yes, but it's trickier to get those patches merged in various libs rather than having headers match windowsapp.lib and the WACK.

Also such patch is not safe, it may enable some API that are actually not allowed.

I enquiried MS regarding the odd wincrypt situation, in hope they will fix their headers. If that happens, I'll do the same with CreateFileW/A and these winnls functions.


_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to