vcpkg/ports/libsndfile/0001-Improve-UWP-support.patch
evpobr fd7e280af8
[libsndfile] Update to 1.0.29 (#12921)
Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
2020-08-25 18:42:26 -07:00

38 lines
1018 B
Diff

diff --git a/src/file_io.c b/src/file_io.c
index e5762ce8..90ef23d5 100644
--- a/src/file_io.c
+++ b/src/file_io.c
@@ -777,6 +777,21 @@ psf_open_handle (PSF_FILE * pfile)
return NULL ;
} ;
+#if defined (WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
+ if (!pfile->use_wchar)
+ return NULL ;
+
+ CREATEFILE2_EXTENDED_PARAMETERS cfParams = { 0 } ;
+ cfParams.dwSize = sizeof (CREATEFILE2_EXTENDED_PARAMETERS) ;
+ cfParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL ;
+
+ handle = CreateFile2 (pfile->path.wc, dwDesiredAccess, dwShareMode, dwCreationDistribution, &cfParams) ;
+
+ if (handle == INVALID_HANDLE_VALUE)
+ return NULL ;
+
+ return handle ;
+#else
if (pfile->use_wchar)
handle = CreateFileW (
pfile->path.wc, /* pointer to name of the file */
@@ -802,6 +817,7 @@ psf_open_handle (PSF_FILE * pfile)
return NULL ;
return handle ;
+#endif
} /* psf_open_handle */
/* USE_WINDOWS_API */ static void
--
2.27.0.windows.1