C#: - P/invoke签名

Man*_*oor 3 c c# c++ pinvoke

我在C++中有一个带有以下签名的dll.它在c ++中工作;

    void Decompress(unsigned char *in,int in_len,unsigned char * out,
unsigned *o_len,int *e);
Run Code Online (Sandbox Code Playgroud)

参数说明

  1. *in :传递给函数的字节数组.
  2. in_len:第一个参数中的字节长度.
  3. *out:这将是字节数组的输出.
  4. *o_len:第三个参数中没有字节
  5. *e:返回错误代码

我怎样才能从c#中调用它?

什么是P/Invoke声明?

lep*_*pie 5

static extern void Decompress(
                byte[] input, 
                int in_len,
                byte[] output, 
                ref int o_len,
                out int e);
Run Code Online (Sandbox Code Playgroud)