X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-sharp%2FDomainBrowser.cs;h=50da54e7306fb0b1e03f8ccf3c85285ee31e165a;hb=c7ecad8fa467b8be2b34064020e2c541c480645e;hp=50ac75778db363ac347cac0881b4add0aaaf4ee4;hpb=84a9392791c574c56ca148157b8b951851208398;p=catta diff --git a/avahi-sharp/DomainBrowser.cs b/avahi-sharp/DomainBrowser.cs index 50ac757..50da54e 100644 --- a/avahi-sharp/DomainBrowser.cs +++ b/avahi-sharp/DomainBrowser.cs @@ -22,6 +22,7 @@ using System; using System.Collections; using System.Runtime.InteropServices; +using System.Text; namespace Avahi { @@ -78,7 +79,7 @@ namespace Avahi [DllImport ("avahi-client")] private static extern IntPtr avahi_domain_browser_new (IntPtr client, int iface, int proto, - IntPtr domain, int btype, LookupFlags flags, + byte[] domain, int btype, LookupFlags flags, DomainBrowserCallback cb, IntPtr userdata); @@ -147,10 +148,12 @@ namespace Avahi return; lock (client) { - IntPtr domainPtr = Utility.StringToPtr (domain); - handle = avahi_domain_browser_new (client.Handle, iface, (int) proto, domainPtr, (int) btype, flags, + handle = avahi_domain_browser_new (client.Handle, iface, (int) proto, + Utility.StringToBytes (domain), (int) btype, flags, cb, IntPtr.Zero); - Utility.Free (domainPtr); + + if (handle == IntPtr.Zero) + client.ThrowError (); } }