| 
					阅读:2015回复:6
				 难道没人遇到这样常见的问题吗,PCI 卡读写数据的问题。
					pci 卡读写 使用readfile( ) writefile() 时,如何指定要读写的地址段的初始地址,
 在readfile() 里面只有个读的长度的参数,难道必须一次全读完? 我本来打算使用readfile() 最后一个参数,overlapped, overlapped 有2个成员 offset和offsethigh, 但是我始终不明白这个参数到了 irp 变成了什么东西,为了应付老板的交工期限,我采用了最最弱智的办法先用deviceiocrl 传入一个起始地址,再用readfile()来读, 现在,大虾,出手指点一下我这棵巨菜吧。 | |
| 
 | 
| 沙发#发布于:2002-07-17 18:13 
					这么老的都被翻出来?pfpf				 | |
| 板凳#发布于:2002-07-17 17:14 
					如果是同步的请求可以使用 SetFilePointer设置初始地址, 但是不能用于一个nonseeking设备如COM口。
 如果是overlapped请求可以使用OVERLAPPED结构传入起始地址 详细情况参看MSDN。 You cannot use the SetFilePointer function with a handle to a nonseeking device such as a pipe or a communications device. To determine the file type for hFile,use the GetFileType function. To specify the offset for overlapped operations, use the Offset and OffsetHigh members of the OVERLAPPED structure. | |
| 
 | 
| 地板#发布于:2002-07-17 17:08 pci 卡读写 使用readfile( ) writefile() 时,如何指定要读写的地址段的初始地址, 你可以只用deviceiocrl 来完成。deviceiocrl 传入内核层两个长度 stack->Parameters.DeviceIoControl.InputBufferLength; stack->Parameters.DeviceIoControl.OutputBufferLength; 那你就可以定义一个为偏移长度,一个为读取数据长度 | |
| 地下室#发布于:2002-07-17 16:16 
					readfile用处不大
 只作简单的IO | |
| 
 | 
| 5楼#发布于:2002-07-17 16:05 
					deviceiocontrol并不弱智
 它可以完成数据读写的功能 甚至可以代替readfile | |
| 6楼#发布于:2001-08-17 15:35 
					你可以用deviceiocontrol来传递参数,控制IO				 | |
| 
 | 
 
							
 
				 
				
 
				 
				