@@ -10,13 +10,15 @@ namespace LibGit2Sharp.Core
10
10
/// free the native pointer after conversion, because the memory is owned by libgit2.
11
11
///
12
12
/// 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))]
14
16
/// </summary>
15
17
internal class LaxFilePathNoCleanupMarshaler : LaxFilePathMarshaler
16
18
{
17
19
private static readonly LaxFilePathNoCleanupMarshaler staticInstance = new LaxFilePathNoCleanupMarshaler ( ) ;
18
20
19
- public new static ICustomMarshaler GetInstance ( )
21
+ public new static ICustomMarshaler GetInstance ( string cookie )
20
22
{
21
23
return staticInstance ;
22
24
}
@@ -39,15 +41,16 @@ public override void CleanUpNativeData(IntPtr pNativeData)
39
41
///
40
42
/// Use this marshaler for function parameters, for example:
41
43
/// [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);
45
48
/// </summary>
46
49
internal class StrictFilePathMarshaler : StrictUtf8Marshaler
47
50
{
48
51
private static readonly StrictFilePathMarshaler staticInstance = new StrictFilePathMarshaler ( ) ;
49
52
50
- public new static ICustomMarshaler GetInstance ( )
53
+ public new static ICustomMarshaler GetInstance ( string cookie )
51
54
{
52
55
return staticInstance ;
53
56
}
@@ -95,7 +98,7 @@ internal class LaxFilePathMarshaler : LaxUtf8Marshaler
95
98
{
96
99
private static readonly LaxFilePathMarshaler staticInstance = new LaxFilePathMarshaler ( ) ;
97
100
98
- public new static ICustomMarshaler GetInstance ( )
101
+ public new static ICustomMarshaler GetInstance ( string cookie )
99
102
{
100
103
return staticInstance ;
101
104
}
0 commit comments