From: Steve Lhomme Date: Thu, 20 Jun 2024 20:57:15 +0000 (+0200) Subject: Fix usage of GetVolumePathNameW in UWP before 20H1 (#2247) X-Git-Tag: v3.7.5~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ec2b8446289dcaf328288804e19f9457ca4ef76;p=thirdparty%2Flibarchive.git Fix usage of GetVolumePathNameW in UWP before 20H1 (#2247) It started being allowed in UWP in 20H1. --- diff --git a/libarchive/archive_windows.h b/libarchive/archive_windows.h index 6b7006a00..14909da16 100644 --- a/libarchive/archive_windows.h +++ b/libarchive/archive_windows.h @@ -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;