From bcd94bb3273ba9ba575c3d7919440d8fd827104d Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Mon, 20 Sep 2004 22:10:01 +0000 Subject: [PATCH] use sigar_open instead of sigar_new wrapper --- bindings/dotnet/default.build | 1 + bindings/dotnet/src/Sigar.cs | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bindings/dotnet/default.build b/bindings/dotnet/default.build index fa748d68..cb76ebc1 100644 --- a/bindings/dotnet/default.build +++ b/bindings/dotnet/default.build @@ -25,6 +25,7 @@ diff --git a/bindings/dotnet/src/Sigar.cs b/bindings/dotnet/src/Sigar.cs index 51b8fa60..b2fff3aa 100644 --- a/bindings/dotnet/src/Sigar.cs +++ b/bindings/dotnet/src/Sigar.cs @@ -31,13 +31,16 @@ namespace Hyperic.Sigar { internal HandleRef sigar; [DllImport(LIBSIGAR)] - private static extern IntPtr sigar_new(); + unsafe private static extern int sigar_open(IntPtr *sigar); [DllImport(LIBSIGAR)] private static extern int sigar_close(IntPtr sigar); public Sigar() { - IntPtr handle = sigar_new(); + IntPtr handle; + unsafe { //&pointers are considered "unsafe" + sigar_open(&handle); + } this.sigar = new HandleRef(this, handle); }