I’ve got two unmanaged C++ functions, Compress and Decompress. The arguments and returns go as followed:
unsigned char* Compress (unsigned char*,int)
unsigned char* Decompress (unsigned char*,int)
Where all uchars are arrays of uchars.
Could someone please help me lay out a way to convert these into managed C# code using the Byte[] array instead of unsigned char*? Thank you very much!
You should be able to pass the unsigned char* parameter in as a byte[] and standard P/Invoke marshaller should handle that. You will have to marshal the output unsigned char* yourself, but that should just be a call to Marshall.Copy(). See below for an example of what I think will work.
Two big questions:
Sample: