C #: - P / invoke signature

I have a dll with the following signature in C ++. It works in C ++;

    void Decompress(unsigned char *in,int in_len,unsigned char * out,
unsigned *o_len,int *e);

Parameter Description

  • * in : an array of bytes passed to the function.
  • in_len : byte length in the first parameter.
  • * out . This will be the output as an array of bytes.
  • * o_len : No bytes in the third parameter
  • * e : error code returned

How can I call it from C #?

What will be the P / Invoke ad?

+3
source share
1 answer
static extern void Decompress(
                byte[] input, 
                int in_len,
                byte[] output, 
                ref int o_len,
                out int e);
+5
source

Source: https://habr.com/ru/post/1736453/


All Articles