Some DNS API functions cause LNK2019 errors in x86 (32 bit) builds

Davide Beatrici 1 Reputation point
2020-09-24T04:01:57.417+00:00

Some DNS API functions (such as DnsServiceConstructInstance(), DnsServiceFreeInstance(), DnsServiceRegister(), DnsServiceDeRegister() and DnsServiceRegisterCancel()) are declared without the WINAPI modifier, causing them to use __cdecl instead of __stdcall.

Forcing the use of __stdcall (/Gz MSVC option) allows to work around the issue.

Thanks to Russ Keldorph for investigating the issue: https://developercommunity.visualstudio.com/content/problem/1191345/some-dns-api-functions-cause-lnk2019-errors-in-32.html

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,352 questions
{count} votes