1 From 11390430fbad4a0d5a70671f922bd374defc715b Mon Sep 17 00:00:00 2001
2 From: Steve Lhomme <robux4@ycbcr.xyz>
3 Date: Fri, 3 Apr 2020 13:25:14 +0200
4 Subject: [PATCH 2/2] Don't call CreateFileA on Winstore builds
6 The API is only available on desktop builds.
7 https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea
9 src/share/win_utf8_io/win_utf8_io.c | 4 ++++
10 1 file changed, 4 insertions(+)
12 diff --git a/src/share/win_utf8_io/win_utf8_io.c b/src/share/win_utf8_io/win_utf8_io.c
13 index 1e0c1e86..e634efd9 100644
14 --- a/src/share/win_utf8_io/win_utf8_io.c
15 +++ b/src/share/win_utf8_io/win_utf8_io.c
16 @@ -154,7 +154,11 @@ int get_utf8_argv(int *argc, char ***argv)
17 HANDLE WINAPI CreateFile_utf8(const char *lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
19 if (!flac_internal_get_utf8_filenames()) {
20 +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
21 return CreateFileA(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
23 + return INVALID_HANDLE_VALUE;
27 HANDLE handle = INVALID_HANDLE_VALUE;