0

次のシグネチャを持つ関数を持つネイティブ ライブラリがあります。

int git_remote_download(char **filename, git_remote *remote);

私は次のようにマネージコードからそれを消費しようとしています:(他のコードから盲目的にコピーされた)

    [DllImport(libgit2)]
    public static extern int git_remote_download(
        [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof (Utf8Marshaler))] out string filename,
        RemoteSafeHandle remote);

AccessViolationException を取得しているので、何か間違っているように見えます。どうすれば適切に宣言できますか?

4

0 に答える 0