diff --git a/src/NetVips/Image.cs b/src/NetVips/Image.cs
index 2426680..2bf58e2 100644
--- a/src/NetVips/Image.cs
+++ b/src/NetVips/Image.cs
@@ -30,7 +30,7 @@ public partial class Image : VipsObject
/// Internal marshaller delegate for .
///
[SuppressUnmanagedCodeSecurity, UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- internal delegate void EvalMarshalDelegate(IntPtr imagePtr, VipsProgress progress, IntPtr userDataPtr);
+ internal delegate void EvalMarshalDelegate(IntPtr imagePtr, IntPtr progressPtr, IntPtr userDataPtr);
///
internal Image(IntPtr pointer)
@@ -2103,9 +2103,9 @@ public void SetKill(bool kill)
/// If it failed to connect the signal.
public ulong SignalConnect(Enums.Signals signal, EvalDelegate callback, IntPtr data = default)
{
- void EvalMarshal(IntPtr imagePtr, VipsProgress progress, IntPtr userDataPtr)
+ void EvalMarshal(IntPtr imagePtr, IntPtr progressPtr, IntPtr userDataPtr)
{
- if (imagePtr == IntPtr.Zero)
+ if (imagePtr == IntPtr.Zero || progressPtr == IntPtr.Zero)
{
return;
}
@@ -2113,6 +2113,8 @@ void EvalMarshal(IntPtr imagePtr, VipsProgress progress, IntPtr userDataPtr)
using var image = new Image(imagePtr);
image.ObjectRef();
+ var progress = Marshal.PtrToStructure(progressPtr);
+
callback.Invoke(image, progress);
}
diff --git a/src/NetVips/Internal/Vips.cs b/src/NetVips/Internal/Vips.cs
index ecd355a..4f28f4a 100644
--- a/src/NetVips/Internal/Vips.cs
+++ b/src/NetVips/Internal/Vips.cs
@@ -17,8 +17,8 @@ internal static class Vips
internal delegate IntPtr TypeMap2Fn(IntPtr type, IntPtr a, IntPtr b);
[SuppressUnmanagedCodeSecurity, UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- internal delegate IntPtr ArgumentMapFn(IntPtr @object, GParamSpec.Struct pspec, VipsArgumentClass argumentClass,
- VipsArgumentInstance argumentInstance, IntPtr a, IntPtr b);
+ internal delegate IntPtr ArgumentMapFn(IntPtr @object, IntPtr pspec, IntPtr argumentClass,
+ IntPtr argumentInstance, IntPtr a, IntPtr b);
[SuppressUnmanagedCodeSecurity, UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate int CallbackFn(IntPtr a, IntPtr b);
diff --git a/src/NetVips/Introspect.cs b/src/NetVips/Introspect.cs
index e329af1..b7fd953 100644
--- a/src/NetVips/Introspect.cs
+++ b/src/NetVips/Introspect.cs
@@ -189,16 +189,16 @@ void AddArg(string name, Enums.ArgumentFlags flags)
}
else
{
- IntPtr AddConstruct(IntPtr self, GParamSpec.Struct pspec, VipsArgumentClass argumentClass,
- VipsArgumentInstance argumentInstance, IntPtr a, IntPtr b)
+ IntPtr AddConstruct(IntPtr self, IntPtr pspec, IntPtr argumentClass, IntPtr argumentInstance,
+ IntPtr a, IntPtr b)
{
- var flags = argumentClass.Flags;
+ var flags = Marshal.PtrToStructure(argumentClass).Flags;
if ((flags & Enums.ArgumentFlags.CONSTRUCT) == 0)
{
return IntPtr.Zero;
}
- var name = Marshal.PtrToStringAnsi(pspec.Name);
+ var name = Marshal.PtrToStringAnsi(Marshal.PtrToStructure(pspec).Name);
AddArg(name, flags);
diff --git a/src/NetVips/VipsProgress.cs b/src/NetVips/VipsProgress.cs
index 1346aaf..a086d22 100644
--- a/src/NetVips/VipsProgress.cs
+++ b/src/NetVips/VipsProgress.cs
@@ -22,7 +22,8 @@ public struct GTimer
///
/// Is the timer currently active?
///
- public int Active;
+ [MarshalAs(UnmanagedType.I1)]
+ public bool Active;
}
///
@@ -65,6 +66,11 @@ public struct VipsProgress
///
/// Start time.
///
- public GTimer Start;
+ private IntPtr StartPtr;
+
+ ///
+ /// Start time.
+ ///
+ public GTimer Start => Marshal.PtrToStructure(StartPtr);
}
}
\ No newline at end of file