int uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen);
我在C#中写的代码为
[DllImport (zlib1.dll)]public static extern uncompress(Byte [] dest,uint destLen,ref Byte [] source,uint sourceLen)调用时报错“尝试读取或写入受保护的内存。 这通常指示其他内存已损坏”,网上说是参数转化有问题,请问正确的转化应该怎么写?不胜感激!
我在C#中写的代码为
[DllImport (zlib1.dll)]public static extern uncompress(Byte [] dest,uint destLen,ref Byte [] source,uint sourceLen)调用时报错“尝试读取或写入受保护的内存。 这通常指示其他内存已损坏”,网上说是参数转化有问题,请问正确的转化应该怎么写?不胜感激!
public static extern uncompress(Byte[] dest,ref uint destLen,Byte[] source,uint sourceLen)
public static extern uncompress([In,Out]Byte[] dest,ref uint destLen,Byte[] source,uint sourceLen);
编译通过了,你调用的时候返回z_OK吗?我每次都错误,要么是data error 要么是buffer error
求解。