From 9a589e1f5221d1bd995b6c4fa73e3a074d4c2da4 Mon Sep 17 00:00:00 2001 From: James Willcox Date: Thu, 17 Nov 2005 21:11:13 +0000 Subject: * add byte[] overloads for EntryGroup methods * cleanup string marshalling git-svn-id: file:///home/lennart/svn/public/avahi/trunk@999 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-sharp/RecordBrowser.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'avahi-sharp/RecordBrowser.cs') diff --git a/avahi-sharp/RecordBrowser.cs b/avahi-sharp/RecordBrowser.cs index 5a736bd..f65f8ac 100644 --- a/avahi-sharp/RecordBrowser.cs +++ b/avahi-sharp/RecordBrowser.cs @@ -23,6 +23,7 @@ using System; using System.Net; using System.Collections; using System.Runtime.InteropServices; +using System.Text; namespace Avahi { @@ -93,7 +94,7 @@ namespace Avahi [DllImport ("avahi-client")] private static extern IntPtr avahi_record_browser_new (IntPtr client, int iface, Protocol proto, - IntPtr name, ushort clazz, ushort type, + byte[] name, ushort clazz, ushort type, LookupFlags flags, RecordBrowserCallback cb, IntPtr userdata); @@ -164,14 +165,13 @@ namespace Avahi (addListeners.Count == 0 && removeListeners.Count == 0)) return; - IntPtr namePtr = Utility.StringToPtr (name); - lock (client) { - handle = avahi_record_browser_new (client.Handle, iface, proto, namePtr, (ushort) clazz, (ushort) type, - flags, cb, IntPtr.Zero); - } + handle = avahi_record_browser_new (client.Handle, iface, proto, Utility.StringToBytes (name), + (ushort) clazz, (ushort) type, flags, cb, IntPtr.Zero); - Utility.Free (namePtr); + if (handle == IntPtr.Zero) + client.ThrowError (); + } } private void Stop (bool force) -- cgit