summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-06-29 16:58:08 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-06-29 16:58:08 +0300
commitf3bb857b2c0b2fc258bb79c48b79fa086dca68fb (patch)
tree1c98de026eeace028a152408da7867afbec81515
parent907696b103b6e25721dfb543e5f85c43f69929f9 (diff)
32-bit TDLIB doesn't work under WOW64 subsystem
-rw-r--r--protocols/Telegram/tdlib/td/tdutils/td/utils/port/FileFd.cpp4
1 files changed, 3 insertions, 1 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 bc0481fb09..bd5795d629 100644
--- a/protocols/Telegram/tdlib/td/tdutils/td/utils/port/FileFd.cpp
+++ b/protocols/Telegram/tdlib/td/tdutils/td/utils/port/FileFd.cpp
@@ -599,7 +599,9 @@ Result<Stat> FileFd::stat() const {
#ifdef _WIN64
auto status = GetFileInformationByHandleEx(get_native_fd().fd(), FileBasicInfo, &basic_info, sizeof(basic_info));
#else
- auto status = GetFileInformationByHandleEx(get_native_fd().fd(), FileBasicInfo, &basic_info, 0x24);
+ BOOL bIsWow64 = FALSE;
+ IsWow64Process(GetCurrentProcess(), &bIsWow64);
+ auto status = GetFileInformationByHandleEx(get_native_fd().fd(), FileBasicInfo, &basic_info, bIsWow64 ? 0x28 : 0x24);
#endif
if (!status) {
return OS_ERROR("Get FileBasicInfo failed");