- IntPtr namePtr = Utility.StringToPtr (name);
- IntPtr typePtr = Utility.StringToPtr (type);
- IntPtr domainPtr = Utility.StringToPtr (domain);
- handle = avahi_service_resolver_new (client.Handle, iface, proto, namePtr, typePtr, domainPtr,
- aproto, cb, IntPtr.Zero);
- Utility.Free (namePtr);
- Utility.Free (typePtr);
- Utility.Free (domainPtr);
+ lock (client) {
+ handle = avahi_service_resolver_new (client.Handle, iface, proto,
+ Utility.StringToBytes (name), Utility.StringToBytes (type),
+ Utility.StringToBytes (domain), aproto, flags, cb, IntPtr.Zero);
+
+ if (handle == IntPtr.Zero)
+ client.ThrowError ();
+ }