-1

I have an issue while developing the application, that is browsing devices in local network via mdns. Under windows 7 i used bonjour api from apple and all was great. After updating win7 to win10 bonjour can still find devices but it can not resolve connection to them. I found the solution that with Windows 10 Microsoft made inside solution with WINAPI and i found that: https://learn.microsoft.com/en-us/windows/win32/api/windns/nf-windns-dnsservicebrowse.

Entire DNS functions like 'DnsServiceBrowse' etc.. but I can not see them into "windns.h" header like it is specified into documentation. Even in dnsapi.dll i could not find any symbols to those functions. I am working with SDK 10.0.17763.0 under visual studio 2017. My windows 10 version is 1903. Am I missing something?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • Desktop or Universal App? The API is only available for Desktop Apps. – Richard Critten Jul 18 '19 at 12:12
  • desktop app, it is something like lxi discovery tool – Johny Siemano Kolano Jul 18 '19 at 12:31
  • _Even in dnsapi.dll i could not find any symbols to those functions_ From [depends](https://i.ibb.co/SvK3M7x/depends.jpg) on Windows 10 1803 – Castorix Jul 18 '19 at 15:31
  • okey i checked that on other computer with 1803 win version and i have symbols. but still i need a valid header file, and that windns.h from MS documentation has no declarations for those functions, i want to make static linking. i also could try with dynamic without header, and just use definitions from documentation but it is not what i want to achive – Johny Siemano Kolano Jul 18 '19 at 19:19
  • As a workaround, install "Bonjour SDK for Windows", then use `DNSServiceBrowse` in the header file `dns_sd.h`. – Drake Wu Jul 19 '19 at 03:28
  • Bonjour is not working with windows 10 after specified update (but dont know exactly which) its cuz, windows has own dns sd implementation and those two things are not compatible. I can see two options: first block windows implementation some how (i tried that), or just use MS dns instead od bonjour from apple. but i am missing header file for dns functions, dns structs, and so on.. – Johny Siemano Kolano Jul 19 '19 at 09:21
  • works fine in Visual Studio 2015. I just specify `#include` and it is found. The intellisense showed the name as a selection when I typed. I'm unsure as to Visual Studio 2017 but in my development environment, Windows 7 with Visual Studio 2015, I have it listed in a number of kits such as `C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\um`. Seems to be a standard thing. – Richard Chambers Jul 29 '19 at 20:57

3 Answers3

1

It is located at the latest Windows SDK 10.0.18362.0.

enter image description here

Drake Wu
  • 6,927
  • 1
  • 7
  • 30
0

If using visual studio have you made sure that your project is actually using the SDK version you think is being used? The default project settings use the oldest SDK found.

The setting is found under the general page of the project properties window (Project -> Properties, General -> Windows SDK Version).

SoronelHaetir
  • 14,104
  • 1
  • 12
  • 23
  • this is basic thing, my default project settings uses 10.0.17763.0 sdk and target platform is windows 10, same thing for all computers just take a look on yours, and try to use DnsServiceBrowse function from WINAPI acording to MS documentation... – Johny Siemano Kolano Jul 18 '19 at 18:49
0

the problem is solved, for not working bonjour version there is only a need to reinstall bonjour and all is working again, and the solution for the in build windows api is to use SDK 10.0.18362.0 or higher. but visual 2017 installer has not that SDK on the list to you have to donwload it on your own, the specified SDK is available since VS 2019 (from the installer resources) thanks to Drake Wu for help!