diff options
author | George Hazan <ghazan@miranda.im> | 2022-12-05 21:30:05 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-12-05 21:30:05 +0300 |
commit | eee0d42e7eba90cf8992716d8fca5a7f28d9a7b8 (patch) | |
tree | 0bc922d9136e924e87ef93e46637ab6b41409e99 /protocols/Telegram | |
parent | 1d685e309ffc7a06b825ac097136d8e55657b0ca (diff) |
Windows SDK 7.1 compatibility
Diffstat (limited to 'protocols/Telegram')
-rw-r--r-- | protocols/Telegram/tdlib/td/tdutils/td/utils/port/FileFd.cpp | 11 | ||||
-rw-r--r-- | protocols/Telegram/tdlib/td/tdutils/td/utils/port/FromApp.h | 7 |
2 files changed, 1 insertions, 17 deletions
diff --git a/protocols/Telegram/tdlib/td/tdutils/td/utils/port/FileFd.cpp b/protocols/Telegram/tdlib/td/tdutils/td/utils/port/FileFd.cpp index 6300f9f85f..5eca7a4370 100644 --- a/protocols/Telegram/tdlib/td/tdutils/td/utils/port/FileFd.cpp +++ b/protocols/Telegram/tdlib/td/tdutils/td/utils/port/FileFd.cpp @@ -206,18 +206,9 @@ Result<FileFd> FileFd::open(CSlice filepath, int32 flags, int32 mode) { if (flags & WinStat) { native_flags |= FILE_FLAG_BACKUP_SEMANTICS; } -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) + auto handle = CreateFile(w_filepath.c_str(), desired_access, share_mode, nullptr, creation_disposition, native_flags, nullptr); -#else - CREATEFILE2_EXTENDED_PARAMETERS extended_parameters; - std::memset(&extended_parameters, 0, sizeof(extended_parameters)); - extended_parameters.dwSize = sizeof(extended_parameters); - extended_parameters.dwFileAttributes = FILE_ATTRIBUTE_NORMAL; - extended_parameters.dwFileFlags = native_flags; - auto handle = td::CreateFile2FromAppW(w_filepath.c_str(), desired_access, share_mode, creation_disposition, - &extended_parameters); -#endif if (handle == INVALID_HANDLE_VALUE) { return OS_ERROR(PSLICE() << "File \"" << filepath << "\" can't be " << PrintFlags{flags}); } diff --git a/protocols/Telegram/tdlib/td/tdutils/td/utils/port/FromApp.h b/protocols/Telegram/tdlib/td/tdutils/td/utils/port/FromApp.h index b33cbf070c..5b74cc8ba6 100644 --- a/protocols/Telegram/tdlib/td/tdutils/td/utils/port/FromApp.h +++ b/protocols/Telegram/tdlib/td/tdutils/td/utils/port/FromApp.h @@ -53,13 +53,6 @@ T *get_from_app_function(const char *name, T *original_func) { #endif } -inline HANDLE CreateFile2FromAppW(_In_ LPCWSTR lpFileName, _In_ DWORD dwDesiredAccess, _In_ DWORD dwShareMode, - _In_ DWORD dwCreationDisposition, - _In_opt_ LPCREATEFILE2_EXTENDED_PARAMETERS pCreateExParams) { - auto func = get_from_app_function<0>("CreateFile2FromAppW", &CreateFile2); - return func(lpFileName, dwDesiredAccess, dwShareMode, dwCreationDisposition, pCreateExParams); -} - inline BOOL CreateDirectoryFromAppW(_In_ LPCWSTR lpPathName, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes) { auto func = get_from_app_function<1>("CreateDirectoryFromAppW", &CreateDirectory); return func(lpPathName, lpSecurityAttributes); |