The documentation doesn't say it's allowed but they are allowed by the
Windows Application Certification Kit and the 19041 Windows SDK.

It is not allowed in older SDK. It won't compile or won't link.
The target DLL api-ms-win-core-file-l1-1-0 will likely not have the
function, so it should not be used when targeting older Windows 10 versions
in UWP mode.

The API entries have been added to api-ms-win-core-file-l1-1-0.
---
 mingw-w64-headers/include/fileapi.h | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/mingw-w64-headers/include/fileapi.h 
b/mingw-w64-headers/include/fileapi.h
index 8124bd5cc..280f1ab34 100644
--- a/mingw-w64-headers/include/fileapi.h
+++ b/mingw-w64-headers/include/fileapi.h
@@ -81,19 +81,26 @@ WINBASEAPI DWORD WINAPI SetFilePointer (HANDLE hFile, LONG 
lDistanceToMove, PLON
   WINBASEAPI DWORD WINAPI GetFullPathNameA (LPCSTR lpFileName, DWORD 
nBufferLength, LPSTR lpBuffer, LPSTR *lpFilePart);
   WINBASEAPI DWORD WINAPI GetFullPathNameW (LPCWSTR lpFileName, DWORD 
nBufferLength, LPWSTR lpBuffer, LPWSTR *lpFilePart);
   WINBASEAPI DWORD WINAPI GetLogicalDrives (VOID);
-  WINBASEAPI WINBOOL WINAPI GetVolumePathNameW (LPCWSTR lpszFileName, LPWSTR 
lpszVolumePathName, DWORD cchBufferLength);
 #define FindFirstFile __MINGW_NAME_AW(FindFirstFile)
 #define GetDiskFreeSpace __MINGW_NAME_AW(GetDiskFreeSpace)
 #define GetDriveType __MINGW_NAME_AW(GetDriveType)
 #define GetFullPathName __MINGW_NAME_AW(GetFullPathName)
 #endif
+
+#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || (NTDDI_VERSION >= 
NTDDI_WIN10_VB)
+  WINBASEAPI WINBOOL WINAPI GetVolumePathNameW (LPCWSTR lpszFileName, LPWSTR 
lpszVolumePathName, DWORD cchBufferLength);
+  WINBASEAPI WINBOOL WINAPI ReadFileScatter (HANDLE hFile, 
FILE_SEGMENT_ELEMENT aSegmentArray[], DWORD nNumberOfBytesToRead, LPDWORD 
lpReserved, LPOVERLAPPED lpOverlapped);
+  WINBASEAPI WINBOOL WINAPI SetFileValidData (HANDLE hFile, LONGLONG 
ValidDataLength);
+  WINBASEAPI WINBOOL WINAPI WriteFileGather (HANDLE hFile, 
FILE_SEGMENT_ELEMENT aSegmentArray[], DWORD nNumberOfBytesToWrite, LPDWORD 
lpReserved, LPOVERLAPPED lpOverlapped);
+#ifdef UNICODE
+#define GetVolumePathName GetVolumePathNameW
+#endif
+#endif
+
 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
   WINBASEAPI DWORD WINAPI GetLogicalDriveStringsW (DWORD nBufferLength, LPWSTR 
lpBuffer);
   WINBASEAPI DWORD WINAPI GetShortPathNameW (LPCWSTR lpszLongPath, LPWSTR 
lpszShortPath, DWORD cchBuffer);
   WINBASEAPI DWORD WINAPI QueryDosDeviceW (LPCWSTR lpDeviceName, LPWSTR 
lpTargetPath, DWORD ucchMax);
-  WINBASEAPI WINBOOL WINAPI ReadFileScatter (HANDLE hFile, 
FILE_SEGMENT_ELEMENT aSegmentArray[], DWORD nNumberOfBytesToRead, LPDWORD 
lpReserved, LPOVERLAPPED lpOverlapped);
-  WINBASEAPI WINBOOL WINAPI SetFileValidData (HANDLE hFile, LONGLONG 
ValidDataLength);
-  WINBASEAPI WINBOOL WINAPI WriteFileGather (HANDLE hFile, 
FILE_SEGMENT_ELEMENT aSegmentArray[], DWORD nNumberOfBytesToWrite, LPDWORD 
lpReserved, LPOVERLAPPED lpOverlapped);
   WINBASEAPI WINBOOL WINAPI GetVolumeNameForVolumeMountPointW (LPCWSTR 
lpszVolumeMountPoint, LPWSTR lpszVolumeName, DWORD cchBufferLength);
   WINBASEAPI WINBOOL WINAPI GetVolumePathNamesForVolumeNameW (LPCWSTR 
lpszVolumeName, LPWCH lpszVolumePathNames, DWORD cchBufferLength, PDWORD 
lpcchReturnLength);
 
@@ -105,7 +112,6 @@ WINBASEAPI DWORD WINAPI SetFilePointer (HANDLE hFile, LONG 
lDistanceToMove, PLON
 #define GetLogicalDriveStrings GetLogicalDriveStringsW
 #define GetShortPathName GetShortPathNameW
 #define GetVolumeInformation GetVolumeInformationW
-#define GetVolumePathName GetVolumePathNameW
 #define QueryDosDevice QueryDosDeviceW
 #define GetVolumeNameForVolumeMountPoint GetVolumeNameForVolumeMountPointW
 #define GetVolumePathNamesForVolumeName GetVolumePathNamesForVolumeNameW
-- 
2.39.2



_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to