]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix usage of GetVolumePathNameW in UWP before 20H1 (#2247)
authorSteve Lhomme <robux4@ycbcr.xyz>
Thu, 20 Jun 2024 20:57:15 +0000 (22:57 +0200)
committerGitHub <noreply@github.com>
Thu, 20 Jun 2024 20:57:15 +0000 (22:57 +0200)
It started being allowed in UWP in 20H1.

libarchive/archive_windows.h

index 6b7006a00a1e0c2cdbb17a75b6507dd4f13f7585..14909da1628804c1500638ef89ec71b791bb0cc3 100644 (file)
@@ -292,12 +292,17 @@ typedef int mbstate_t;
 size_t wcrtomb(char *, wchar_t, mbstate_t *);
 #endif
 
-#if defined(_MSC_VER) && _MSC_VER < 1300
+#if !WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) && NTDDI_VERSION < NTDDI_WIN10_VB
+// not supported in UWP SDK before 20H1
+#define GetVolumePathNameW(f, v, c)   (0)
+#elif defined(_MSC_VER) && _MSC_VER < 1300
 WINBASEAPI BOOL WINAPI GetVolumePathNameW(
        LPCWSTR lpszFileName,
        LPWSTR lpszVolumePathName,
        DWORD cchBufferLength
        );
+#endif
+#if defined(_MSC_VER) && _MSC_VER < 1300
 # if _WIN32_WINNT < 0x0500 /* windows.h not providing 0x500 API */
 typedef struct _FILE_ALLOCATED_RANGE_BUFFER {
        LARGE_INTEGER FileOffset;