C++:GPSSUPPORT_API int __stdcall ress(unsigned char *compr, unsigned long comprLen, unsigned char **uncompr, unsigned long *uncomprLen);
C#:
public static extern int ZlibUncompress(ref byte[] compr, long comprLen, ref byte[] uncompr, ref long uncomprLen);
调用:
private byte[] Keys = { 0x78, 0xDA, 0x63, 0x60, 0x60, 0x6C, 0x60, 0x6A, 0x63, 0x64, 0x60, 0x16, 0x06, 0x00, 0x06, 0x59, 0x01, 0x21 };
byte[] b=new byte[255];
long blen=a.Length;
int Err = XWAPI.ZlibUncompress(ref a, (long)a.Length, ref b, ref blen);
提示:尝试读取或写入受保护的内存。这通常指示其他内存已损坏"
如何处理,谢谢.
尝试读取或写入受保护的内存。这通常指示其他内存已损坏。
C#:
public static extern int ZlibUncompress(ref byte[] compr, long comprLen, ref byte[] uncompr, ref long uncomprLen);
调用:
private byte[] Keys = { 0x78, 0xDA, 0x63, 0x60, 0x60, 0x6C, 0x60, 0x6A, 0x63, 0x64, 0x60, 0x16, 0x06, 0x00, 0x06, 0x59, 0x01, 0x21 };
byte[] b=new byte[255];
long blen=a.Length;
int Err = XWAPI.ZlibUncompress(ref a, (long)a.Length, ref b, ref blen);
提示:尝试读取或写入受保护的内存。这通常指示其他内存已损坏"
如何处理,谢谢.
尝试读取或写入受保护的内存。这通常指示其他内存已损坏。
解决方案 »
- 关于程序未处理的几个异常,找不到位置,没有头绪..
- WCF传递强类型参数(.xsd)?
- path对象能脱离canvas/inkcanvas显示吗?
- 急!程序注册为windows服务后,File.copy拷贝到远程共享目录提示拒绝访问
- 请教网页数据抓取的问题?
- 移动Web控件TextBox中无法显示中文问题,外一则~~~
- socket访问问题
- ADO.NET
- Vatti polygon clip图形学多边形裁剪算法
- 请问如何遍历comboBox中的item
- C# WPF 里有播放3D电影相关的类吗 ?
- Devxpress GridControl 修改 出现 band 和 column 挂不在一起,求助有没有解决方法?
public static extern int ZlibUncompress(byte[] compr,uint comprLen,ref byte[] uncompr,ref uint uncomprLen);
public static extern int ZlibUncompress(byte[] compr,uint comprLen,ref byte[] uncompr,ref uint uncomprLen);
private byte[] Keys = { 0x78, 0xDA, 0x63, 0x60, 0x60, 0x6C, 0x60, 0x6A, 0x63, 0x64, 0x60, 0x16, 0x06, 0x00, 0x06, 0x59, 0x01, 0x21 }; uint blen=0;
uint alen = Convert.ToUInt32(Keys.Length);
byte[] buffer = new byte[128];
int Err = XWAPI.ZlibUncompress(Keys, alen, ref buffer, ref blen);我这样写了.可是blen是对的.但buffer的没值,值不对.请上楼的朋友帮我看看.谢谢.
我在网上查了一下 LZ用的是zlib.dll来压缩解压缩吧 貌似c++的函数原型不是这样的 你再仔细检查检查 压缩 解压缩的别写反了..
public static extern int ZlibUncompress(byte[] compr,uint comprLen,ref byte[] uncompr,ref uint uncomprLen);
public static extern int ZlibUncompress(byte[] compr,uint comprLen,ref byte[] uncompr,ref uint uncomprLen);