@@ -10,13 +10,15 @@ namespace LibGit2Sharp.Core
1010 /// free the native pointer after conversion, because the memory is owned by libgit2.
1111 ///
1212 /// Use this marshaler for return values, for example:
13- /// [return: CustomMarshaler(typeof(LaxFilePathNoCleanupMarshaler), typeof(FilePath))]
13+ /// [return: MarshalAs(UnmanagedType.CustomMarshaler,
14+ /// MarshalCookie = UniqueId.UniqueIdentifier,
15+ /// MarshalTypeRef = typeof(LaxFilePathNoCleanupMarshaler))]
1416 /// </summary>
1517 internal class LaxFilePathNoCleanupMarshaler : LaxFilePathMarshaler
1618 {
1719 private static readonly LaxFilePathNoCleanupMarshaler staticInstance = new LaxFilePathNoCleanupMarshaler ( ) ;
1820
19- public new static ICustomMarshaler GetInstance ( )
21+ public new static ICustomMarshaler GetInstance ( string cookie )
2022 {
2123 return staticInstance ;
2224 }
@@ -39,15 +41,16 @@ public override void CleanUpNativeData(IntPtr pNativeData)
3941 ///
4042 /// Use this marshaler for function parameters, for example:
4143 /// [DllImport(libgit2)]
42- /// private static extern unsafe int git_index_remove_bypath(
43- /// git_index* index,
44- /// [CustomMarshaler(typeof(StrictFilePathMarshaler), typeof(FilePath))] byte* path);
44+ /// internal static extern int git_index_open(out IndexSafeHandle index,
45+ /// [MarshalAs(UnmanagedType.CustomMarshaler,
46+ /// MarshalCookie = UniqueId.UniqueIdentifier,
47+ /// MarshalTypeRef = typeof(StrictFilePathMarshaler))] FilePath indexpath);
4548 /// </summary>
4649 internal class StrictFilePathMarshaler : StrictUtf8Marshaler
4750 {
4851 private static readonly StrictFilePathMarshaler staticInstance = new StrictFilePathMarshaler ( ) ;
4952
50- public new static ICustomMarshaler GetInstance ( )
53+ public new static ICustomMarshaler GetInstance ( string cookie )
5154 {
5255 return staticInstance ;
5356 }
@@ -95,7 +98,7 @@ internal class LaxFilePathMarshaler : LaxUtf8Marshaler
9598 {
9699 private static readonly LaxFilePathMarshaler staticInstance = new LaxFilePathMarshaler ( ) ;
97100
98- public new static ICustomMarshaler GetInstance ( )
101+ public new static ICustomMarshaler GetInstance ( string cookie )
99102 {
100103 return staticInstance ;
101104 }
0 commit comments