]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/ports/libflac/uwp-createfile2.patch
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / tools / vcpkg / ports / libflac / uwp-createfile2.patch
1 diff --git a/src/share/win_utf8_io/win_utf8_io.c b/src/share/win_utf8_io/win_utf8_io.c
2 index 8b20bbb7..058295fa 100644
3 --- a/src/share/win_utf8_io/win_utf8_io.c
4 +++ b/src/share/win_utf8_io/win_utf8_io.c
5 @@ -156,6 +156,27 @@ int get_utf8_argv(int *argc, char ***argv)
6 /* similar to CreateFileW but accepts UTF-8 encoded lpFileName */
7 HANDLE WINAPI CreateFile_utf8(const char *lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
8 {
9 +#if defined (WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
10 + HANDLE handle = INVALID_HANDLE_VALUE;
11 +
12 + if (!flac_internal_get_utf8_filenames())
13 + return handle;
14 +
15 + wchar_t *wname;
16 +
17 + if ((wname = wchar_from_utf8(lpFileName)) != NULL)
18 + {
19 + CREATEFILE2_EXTENDED_PARAMETERS cfParams = {0};
20 + cfParams.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS);
21 + cfParams.dwFileAttributes = dwFlagsAndAttributes & FILE_ATTRIBUTE_NORMAL;
22 + cfParams.lpSecurityAttributes = lpSecurityAttributes;
23 + cfParams.hTemplateFile = hTemplateFile;
24 + handle = CreateFile2(wname, dwDesiredAccess, dwShareMode, dwCreationDisposition, &cfParams);
25 + free(wname);
26 + }
27 +
28 + return handle;
29 +#else
30 if (!flac_internal_get_utf8_filenames()) {
31 return CreateFileA(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
32 } else {
33 @@ -169,6 +190,7 @@ HANDLE WINAPI CreateFile_utf8(const char *lpFileName, DWORD dwDesiredAccess, DWO
34
35 return handle;
36 }
37 +#endif
38 }
39
40 /* return number of characters in the UTF-8 string */