summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShane Fournier <93808768+win32ss@users.noreply.github.com>2024-10-14 13:26:32 -0400
committerGitHub <noreply@github.com>2024-10-14 20:26:32 +0300
commitc8fa11373bfcba1b777426febd70e1caf4955463 (patch)
treef3044b2aaa46d040914afb644ba12054377357a2
parent4348743ace7373ccc75113e97cb724268a81fb4a (diff)
Windows XP compatibility for Telegram module (#4729)
* These changes should allow telegram.dll to build as an XP-compatible component, using LSC wrapper DLLs to resolve dependencies in kernel32.dll and ws2_32.dll. mir_app also uses the LSC wrapper in place of kernel32 to load telegram.dll with support for implicit thread local storage. * Corrected mir_app link target * Now returning to this code, correcting the Telegram build to incorporate the libs properly. * Removed requirement for pwrp_k32 in mir_app. The TLS loading process will now be performed through GetSystemTimeAsFileTime in the Telegram DLL as calls to that function are made before this first TLS access attempt. --------- Co-authored-by: win32ss <win32ss@nulln.nl>
-rw-r--r--libs/win32/p_s232.libbin0 -> 43812 bytes
-rw-r--r--libs/win32/progwrp_k32.libbin0 -> 389574 bytes
-rw-r--r--libs/win64/p_s232.libbin0 -> 42840 bytes
-rw-r--r--libs/win64/progwrp_k32.libbin0 -> 381346 bytes
-rw-r--r--protocols/Telegram/Telegram.vcxproj2
-rw-r--r--tools/build_scripts/redist/x32/lsc/p_s232.dllbin0 -> 39936 bytes
-rw-r--r--tools/build_scripts/redist/x32/lsc/pwrp_k32.dllbin0 -> 326144 bytes
-rw-r--r--tools/build_scripts/redist/x64/lsc/p_s232.dllbin0 -> 43520 bytes
-rw-r--r--tools/build_scripts/redist/x64/lsc/pwrp_k32.dllbin0 -> 355328 bytes
-rw-r--r--tools/build_scripts/z2_PackPluginUpdater.bat9
10 files changed, 10 insertions, 1 deletions
diff --git a/libs/win32/p_s232.lib b/libs/win32/p_s232.lib
new file mode 100644
index 0000000000..5e4009b4f8
--- /dev/null
+++ b/libs/win32/p_s232.lib
Binary files differ
diff --git a/libs/win32/progwrp_k32.lib b/libs/win32/progwrp_k32.lib
new file mode 100644
index 0000000000..a82f9ff92f
--- /dev/null
+++ b/libs/win32/progwrp_k32.lib
Binary files differ
diff --git a/libs/win64/p_s232.lib b/libs/win64/p_s232.lib
new file mode 100644
index 0000000000..5de53775b7
--- /dev/null
+++ b/libs/win64/p_s232.lib
Binary files differ
diff --git a/libs/win64/progwrp_k32.lib b/libs/win64/progwrp_k32.lib
new file mode 100644
index 0000000000..4d548943ce
--- /dev/null
+++ b/libs/win64/progwrp_k32.lib
Binary files differ
diff --git a/protocols/Telegram/Telegram.vcxproj b/protocols/Telegram/Telegram.vcxproj
index 90e1e5e72d..82aaf0c512 100644
--- a/protocols/Telegram/Telegram.vcxproj
+++ b/protocols/Telegram/Telegram.vcxproj
@@ -47,7 +47,7 @@
<Link>
<AdditionalLibraryDirectories Condition="'$(Platform)'=='Win32'">.\tdlib\lib\$(Configuration)32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(Platform)'=='x64'">.\tdlib\lib\$(Configuration)64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
- <AdditionalDependencies>libcrypto.lib;libssl.lib;crypt32.lib;psapi.lib;Normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>progwrp_k32.lib;p_s232.lib;libcrypto.lib;libssl.lib;crypt32.lib;psapi.lib;Normaliz.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
diff --git a/tools/build_scripts/redist/x32/lsc/p_s232.dll b/tools/build_scripts/redist/x32/lsc/p_s232.dll
new file mode 100644
index 0000000000..90c31481db
--- /dev/null
+++ b/tools/build_scripts/redist/x32/lsc/p_s232.dll
Binary files differ
diff --git a/tools/build_scripts/redist/x32/lsc/pwrp_k32.dll b/tools/build_scripts/redist/x32/lsc/pwrp_k32.dll
new file mode 100644
index 0000000000..a80c1af3d7
--- /dev/null
+++ b/tools/build_scripts/redist/x32/lsc/pwrp_k32.dll
Binary files differ
diff --git a/tools/build_scripts/redist/x64/lsc/p_s232.dll b/tools/build_scripts/redist/x64/lsc/p_s232.dll
new file mode 100644
index 0000000000..6063ac80a6
--- /dev/null
+++ b/tools/build_scripts/redist/x64/lsc/p_s232.dll
Binary files differ
diff --git a/tools/build_scripts/redist/x64/lsc/pwrp_k32.dll b/tools/build_scripts/redist/x64/lsc/pwrp_k32.dll
new file mode 100644
index 0000000000..bccb8e4471
--- /dev/null
+++ b/tools/build_scripts/redist/x64/lsc/pwrp_k32.dll
Binary files differ
diff --git a/tools/build_scripts/z2_PackPluginUpdater.bat b/tools/build_scripts/z2_PackPluginUpdater.bat
index 998a3b6866..924f7e1a67 100644
--- a/tools/build_scripts/z2_PackPluginUpdater.bat
+++ b/tools/build_scripts/z2_PackPluginUpdater.bat
@@ -96,6 +96,15 @@ for /f %%a in ('dir plugins\*.dll /B /L') do (
rd /S /Q Libs
ren Libs2 Libs
)
+
+ if /I "%%a"=="Telegram.dll" (
+ copy /V /Y ..\..\redist\x%tp%\lsc\ps2_32.dll Libs
+ copy /V /Y ..\..\redist\x%tp%\lsc\pwrp_k32.dll Libs
+ %ZipIt% "%Arch%\Plugins\%%~na.zip" "Libs\ps2_32.dll" "Libs/pwrp_k32.dll"
+ del "Libs/ps2_32.dll"
+ del "Libs/pwrp_k32.dll"
+ )
+
rem now adding plugin itself into archive
%ZipIt% "%Arch%\Plugins\%%~na.zip" %%a
)