aboutsummaryrefslogtreecommitdiff
path: root/ports/libsndfile/0001-Improve-UWP-support.patch
diff options
context:
space:
mode:
Diffstat (limited to 'ports/libsndfile/0001-Improve-UWP-support.patch')
-rw-r--r--ports/libsndfile/0001-Improve-UWP-support.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/ports/libsndfile/0001-Improve-UWP-support.patch b/ports/libsndfile/0001-Improve-UWP-support.patch
new file mode 100644
index 000000000..9821aa30f
--- /dev/null
+++ b/ports/libsndfile/0001-Improve-UWP-support.patch
@@ -0,0 +1,37 @@
+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
+