|
From: | Steve Lhomme |
Subject: | Re: [PATCH] Use CreateFile2 in UWP builds |
Date: | Wed, 17 May 2023 07:42:50 +0200 |
Hi, On 2023-05-16 16:52, Bruno Haible wrote:
Steve Lhomme wrote:CreateFileA and CreateFileW are forbidden calls in UWP. CreateFile2 is close enough, some parameters are passed in a structure and it requires a WCHAR filename.CreateFileW has an emulation in mingw's winstorecompat: https://github.com/mirror/mingw-w64/blob/master/mingw-w64-libraries/winstorecompat/src/CreateFileW.c Can you suggest to the mingw people to add a CreateFileA emulation as well? That's IMO the better place for emulating CreateFileA on top of CreateFile2, rather than Gnulib.
That would be OK if gnulib was restricted to mingw64 on Windows. But it can be compiled by MSVC as well which doesn't have the winstorecompat library. And it needs an extra define when compiling the code to "enable" this library. I'm not sure that's a practical solution for gnulib.
Also There are 2 versions of the library depending if you target the original UWP (Win8 = winstorecompat) or the more relaxed UWP (Win10 = windowsappcompat). That would need some extra checks in the gnulib build system to pick the right one.
IMO it's better to go for a solution that follows the Windows API's. CreateFile2 is available on all Windows versions since Win8.
Bruno
[Prev in Thread] | Current Thread | [Next in Thread] |