Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

48 lines (39 sloc) 1.161 kb
using System;
using System.Runtime.InteropServices;
namespace LibGit2Sharp.Core
{
internal class GitErrorMarshaler : ICustomMarshaler
{
static readonly GitErrorMarshaler staticInstance = new GitErrorMarshaler();
public void CleanUpManagedData(object managedObj)
{
}
public void CleanUpNativeData(IntPtr pNativeData)
{
if (pNativeData != IntPtr.Zero)
{
Marshal.FreeHGlobal(pNativeData);
}
}
public int GetNativeDataSize()
{
return -1;
}
public IntPtr MarshalManagedToNative(object managedObj)
{
throw new NotImplementedException();
}
public object MarshalNativeToManaged(IntPtr pNativeData)
{
return NativeToGitError(pNativeData);
}
protected GitError NativeToGitError(IntPtr pNativeData)
{
return (GitError)Marshal.PtrToStructure(pNativeData, typeof(GitError));
}
public static ICustomMarshaler GetInstance(string cookie)
{
return staticInstance;
}
}
}
Jump to Line
Something went wrong with that request. Please try again.