Fix FromApp building for UWP.

This commit is contained in:
levlam 2021-04-04 23:39:45 +03:00
parent d3030445c5
commit 02c9caafc0

View File

@ -76,8 +76,8 @@ inline BOOL DeleteFileFromAppW(_In_ LPCWSTR lpFileName) {
}
inline BOOL MoveFileExFromAppW(_In_ LPCWSTR lpExistingFileName, _In_ LPCWSTR lpNewFileName, _In_ DWORD dwFlags) {
auto func = get_from_app_function<4>("MoveFileFromAppW", &MoveFile);
if (func == &MoveFile || (dwFlags & ~MOVEFILE_REPLACE_EXISTING) != 0) {
auto func = get_from_app_function<4>("MoveFileFromAppW", static_cast<BOOL(WINAPI *)(LPCWSTR, LPCWSTR)>(nullptr));
if (func == nullptr || (dwFlags & ~MOVEFILE_REPLACE_EXISTING) != 0) {
// if can't find MoveFileFromAppW or have unsupported flags, call MoveFileEx directly
return MoveFileEx(lpExistingFileName, lpNewFileName, dwFlags);
}