阅读:1442回复:2
在驱动中使用结构为何蓝屏
哪位朋友帮忙看一下,我在应用程序中传递一个结构数据给驱动,在驱动中根据结构中的地址和数据进行读写,可就是蓝屏,何故呢?
struct _Write_AD{ ULONG Address; ULONG Data; }; 在DEVICE_EXTENSION中声明一个struct _Write_AD Write_AD变量,然后 case IOCTL_IO_WRITE: ReturnedValue=0; PdcAddress = (ULONG)pdx->PdcMemBase; RtlCopyMemory(&pdx->Write_AD, pIrp->AssociatedIrp.SystemBuffer, sizeof(pdx->Write_AD)); // WRITE_REGISTER_UCHAR((unsigned char *)(PdcAddress + (pdx->Write_AD.Address)&0XFF), (UCHAR)pdx->Write_AD.Data); DebugPrint("Write Data Value is Address=%x.Data=%x.", pdx->Write_AD.Address,pdx->Write_AD.Data); ReturnedValue = 0; 这样就会蓝屏,如果说用数组就不会出错. 运行后其实传递进去的地址(Write_AD.Address)已经正确,但要写的数据(Write_AD.Data)却不对, 请大家看一下,问题出在哪里? |
|
沙发#
发布于:2008-02-27 15:23
楼主是强人, 难题解决了吗?
|
|
板凳#
发布于:2008-03-11 15:27
难道说就没有人能解决吗
|
|