Windows Socket 2.0 32-Bit DLL Fix for RAD Studio 10.2.2 and above Introduction When launch an application built with runtime packages compiled by RAD Studio 10.2 update 2 in Windows XP, an error prompt
The procedure entry point inet_pton could not be located in the dynamic link library ws2_32.dll. The application works fine from Windows Vista onwards.
As stated in InetPton function:
The InetPton function is supported on Windows Vista and later. RAD Studio 10.2 update 2 has a new update in unit :Windows.WinSock2.pas
function inet_pton; external ws2_32 name 'inet_pton'; The function is bind statically when application was launch. There is no way to patch the source code easily. A quick workaround solution is built the application as single executable file instead of runtime packages.
Solution: Deploy a proxy DLL to original WS2_32.dll This project attempt to define proxy functions to all exported functions of original Windows XP's including that was missing in Windows XP's . It tricks the Windows XP application process to think that is available and not prompting any errors.WS2_32.dllinet_ptonWS2_32.dllinet_pton
Please note that the DLL shall deploy to Windows XP only.
Can no longer build executables for Windows XP without customization: Project Options->Building->Delphi Compiler->Linking->Set OS Version fields in PE Headers (and Set SubSystem Version fields in PE Headers" to 5.1 (it now defaults to 6.0)
If you use System.Threading, then need to change GetTickCount64 references to a new routine matching something like the code below and then use a modified system.thread.dcu in your projects (or update \lib\win32\debug and \lib\win32\release with new versions of System.Threading.dcu) More info from Michal Mutl on Delphi PRAXIS forum message
function _GetTickCount64: UInt64; begin if TOSVersion.Major<6 then Result := TThread.GetTickCount else Result := TThread.GetTickCount64; end;
----------------------------------------------
简单做人,认真做事。