[ZBX-5103] Windows Agent incompatible with Windows 2000 Created: 2012 May 30  Updated: 2017 Sep 07  Resolved: 2013 Aug 08

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G)
Affects Version/s: 2.0.0
Fix Version/s: 2.0.3rc1

Type: Problem report Priority: Major
Reporter: Brendan Gilmore Assignee: Unassigned
Resolution: Fixed Votes: 3
Labels: agent, windows
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 2000 SP4


Issue Links:
Duplicate

 Description   

Error text when executing zabbix_agentd.exe "The procedure entry point DnsFree could not be located in the dynamic link library DNSAPI.dll." on Windows 2000. WinDNS.h (starting at line 1629 in Windows SDK v6.0a) overrides the DnsRecordListFree function to DnsFree for _WIN32_WINT>= 0x0501 (Windows XP). This is a problem because DnsFree was added to Dnsapi.lib in Windows XP so is therefore unavailable in Windows 2000.

Probable solution is adding "_WIN32_WINNT=0x0500" or similar symbol for Windows SDK headers to process.

I added this directly to the net.c compilation command in build\win32\project\Makefile_agent because adding to the CFLAGS macro caused error with system.c compilation. I leave it to much more capable programmers to determine the optimal course of solution.

Relevant links
Forum discussion: http://www.zabbix.com/forum/showthread.php?t=26369
Using the Windows Headers http://msdn.microsoft.com/en-us/library/aa383745(v=vs.85).aspx
DnsFree: http://msdn.microsoft.com/en-us/library/windows/desktop/ms682011(v=vs.85).aspx
DnsRecordListFree: http://msdn.microsoft.com/en-us/library/windows/desktop/ms682021(v=vs.85).aspx



 Comments   
Comment by Alexander Vladishev [ 2012 Jul 13 ]

Fixed in the development branch svn://svn.zabbix.com/branches/dev/ZBX-5103

Comment by dimir [ 2012 Jul 23 ]

Successfully tested.

Comment by Alexander Vladishev [ 2012 Jul 31 ]

Fixed in pre-2.0.3 r29229 and pre-2.1.0 (beta) r29230

Comment by Alice Ferrazzi [ 2012 Nov 21 ]

I`am Alice Ferrazzi, I am currently working with MIRACLELINUX in Japan.
We made a new patch for this issue that is dynamically loading Dnsapi.dll as needed using LoadLibrary() with this you don`t need to use "_WIN32_WINNT=0x0500" for fix the issue and you can enjoy the new 2.0.x feature on windows 2000.
"_WIN32_WINNT=0x0500" is too much. It affects to every code in Zabbix.
So, it's better to use dynamically loading.

https://gist.github.com/4123963

The patch requires "Dnsapi.dll" in executing time for link.
We had compiled the binary in windows 2008 and tested it in windows 2000/2003/2008

We thank you for your time and would like to receive comments.

Comment by Igors Homjakovs (Inactive) [ 2013 Aug 05 ]

Thank you for the patch Alice. It was applied and successfully tested. We appreciate your active involvement.

Comment by Andris Zeila [ 2013 Aug 08 ]

As we are still supporting Windows 2000 we must set the target platform version to Windows 2000 (_WIN32_WINNT=0x0500). Otherwise there are no guarantees that an executable built for different platform won't use newer API calls which would fail on Windows 2000.

If some features not supported by Windows 2000 must be used for newer platforms, then it should be done the other way - detecting the windows version in runtime and dynamically loading the required libraries.

Comment by Cristian Mammoli [ 2017 Sep 04 ]

It happens again with 3.4.0.

Comment by dimir [ 2017 Sep 06 ]

c.mammoli, does it happen with Windows 2000? Because in 3.4 we dropped support for Windows below XP:

https://www.zabbix.com/documentation/3.4/manual/installation/requirements#supported_platforms

Comment by Cristian Mammoli [ 2017 Sep 07 ]

Yes, it's Win2k. I didn't know the support was dropped, not a big deal in 2017. Sorry for the noise, I only looked in the "What's new section" and in the "Upgrade Notes"

I even opened https://support.zabbix.com/browse/ZBXNEXT-4082

Generated at Sat Apr 20 10:19:35 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.