diff options
Diffstat (limited to 'mono/DBusType/ObjectPath.cs')
-rw-r--r-- | mono/DBusType/ObjectPath.cs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/mono/DBusType/ObjectPath.cs b/mono/DBusType/ObjectPath.cs index f82c6804..01a21ca9 100644 --- a/mono/DBusType/ObjectPath.cs +++ b/mono/DBusType/ObjectPath.cs @@ -28,8 +28,11 @@ namespace DBus.DBusType public ObjectPath(IntPtr iter, Service service) { - - this.path = Marshal.PtrToStringAnsi(dbus_message_iter_get_object_path(iter)); + IntPtr raw; + + dbus_message_iter_get_basic (iter, out raw); + + this.path = Marshal.PtrToStringAnsi (raw); this.service = service; } @@ -47,7 +50,9 @@ namespace DBus.DBusType public void Append(IntPtr iter) { - if (!dbus_message_iter_append_object_path(iter, Marshal.StringToHGlobalAnsi(Path))) + IntPtr marshalVal = Marshal.StringToHGlobalAnsi (Path); + + if (!dbus_message_iter_append_basic (iter, (int) Code, ref marshalVal)) throw new ApplicationException("Failed to append OBJECT_PATH argument:" + val); } @@ -91,9 +96,9 @@ namespace DBus.DBusType } [DllImport("dbus-1")] - private extern static IntPtr dbus_message_iter_get_object_path(IntPtr iter); + private extern static void dbus_message_iter_get_basic (IntPtr iter, out IntPtr path); [DllImport("dbus-1")] - private extern static bool dbus_message_iter_append_object_path(IntPtr iter, IntPtr path); + private extern static bool dbus_message_iter_append_basic (IntPtr iter, int type, ref IntPtr path); } } |