From ae87f01321d98012576270bd85ee59fe2096fb92 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Thu, 1 Jun 2023 15:27:53 +0200 Subject: [PATCH 05/17] headers: enable CreateHardLinkW in Win10 19H1 UWP builds The documentation doesn't say it's allowed but they are allowed by the Windows Application Certification Kit and the 18362 Windows SDK. It is not allowed in older SDK. It won't compile or won't link. The target DLL [1] will likely not have the function, so it should not be used when targeting older Windows 10 versions in UWP mode. We already have api-ms-win-core-file-l2-1-0 in mincore and windowsapp. [1] https://learn.microsoft.com/en-us/uwp/win32-and-com/win32-apis#apis-from-api-ms-win-core-file-l2-1-0dll Signed-off-by: LIU Hao --- mingw-w64-headers/include/winbase.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mingw-w64-headers/include/winbase.h b/mingw-w64-headers/include/winbase.h index 82c8b7cc3..c6c34ed3b 100644 --- a/mingw-w64-headers/include/winbase.h +++ b/mingw-w64-headers/include/winbase.h @@ -2464,9 +2464,11 @@ typedef enum FILE_FLUSH_MODE { WINBASEAPI WINBOOL WINAPI ReplaceFileA (LPCSTR lpReplacedFileName, LPCSTR lpReplacementFileName, LPCSTR lpBackupFileName, DWORD dwReplaceFlags, LPVOID lpExclude, LPVOID lpReserved); WINBASEAPI WINBOOL WINAPI ReplaceFileW (LPCWSTR lpReplacedFileName, LPCWSTR lpReplacementFileName, LPCWSTR lpBackupFileName, DWORD dwReplaceFlags, LPVOID lpExclude, LPVOID lpReserved); #endif +#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || NTDDI_VERSION >= NTDDI_WIN10_19H1 + WINBASEAPI WINBOOL WINAPI CreateHardLinkW (LPCWSTR lpFileName, LPCWSTR lpExistingFileName, LPSECURITY_ATTRIBUTES lpSecurityAttributes); +#endif #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) WINBASEAPI WINBOOL WINAPI CreateHardLinkA (LPCSTR lpFileName, LPCSTR lpExistingFileName, LPSECURITY_ATTRIBUTES lpSecurityAttributes); - WINBASEAPI WINBOOL WINAPI CreateHardLinkW (LPCWSTR lpFileName, LPCWSTR lpExistingFileName, LPSECURITY_ATTRIBUTES lpSecurityAttributes); #define ReplaceFile __MINGW_NAME_AW(ReplaceFile) #define CreateHardLink __MINGW_NAME_AW(CreateHardLink) -- 2.37.3.windows.1