1
1楼 grayhoundd 2007-04-26 20:38:44 C#调用winio.dll出现错误。尝试读取或写入受保护的内存。这通常指示其他内存已损坏。
[DllImport( "winio.dll ")] public static extern bool GetPortVal(int wPortAddr, Int32 pdwPortVal, byte bSize); int dwVal = 0; bool flag = GetPortVal(0x64, dwVal , 1); 估计是参数类型设置有问题, 非托管函数原型如下: bool _stdcall GetPortVal( WORD wPortAddr, PDWORD pdwPortVal, BYTE bSize ); Parameters wPortAddr [in] I/O port address pdwPortVal [out] Pointer to a DWORD variable that receives the value obtained from the port. bSize [in] Number of bytes to read. Can be 1 (BYTE), 2 (WORD) or 4 (DWORD).
搜索墙@2009 www.pkwall.com all rights reserved QQ:276471788 [京ICP备09111534号]
声明:本站部分数据来源于网络,仅供参考,如有版权问题,请联系我们,我们将及时删除!转载本站请注明来源
| ||||||||||||||||||||||||||||||||||||||||