文件名称:FANGWENUSB
-
所属分类:
- 标签属性:
- 上传时间:2008-10-13
-
文件大小:1.77kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
//打开 USB 口读写, 由驱动程序的 Pipe 名确定
HANDLE hPipe = OpenMyDevPipe(\"MyPipe1\") //驱动程序里面的 Pipe 名, 对应访问某个端点的 I/O, 这里我乱写的, 需要与驱动一致
if(hPipe != INVALID_HANDLE_VALUE) //打开 Pipe 成功
{
ReadFile(hPipe, Buffer, BufSize, &nBytesRead, NULL) //从 hPipe 里读取数据到 Buffer 里
//WriteFile(hPipe, Buffer, BytesToWrite, &nBytesWritten, NULL) //把 Buffer 里面的 BytesToWrite 字节写入 hPipe
CloseHandle(hPipe)
}
//使用 DeviceIoControl 访问 USB 设备
HANDLE hDevice = OpenMyDevice()
if(hDevice != INVALID_HANDLE_VALUE) //打开设备成功
{
//这些 DeviceIoControl 功能都是由设备定义的, 具体看设备和驱动的资料
if(DeviceIoControl(hDevice, IOCTL_READ_xxxx, &IOBlock, sizeof(IOBLOCK), &c, 1, &nBytes, NULL))
{
//成功
}
CloseHandle(hDevice)
}-/ / open USB literacy, Drivers from the Pipe were identified HANDLE hPipe = OpenMyDevPipe ( " MyPipe1 ") / / driver inside Pipe, and a corresponding visit to the endpoint I / O, Here, I write without basis. consistent with the need to drive if (hPipe! = INVALID_HANDLE_VALUE) / / Open Pipe success (ReadFile (hPipe, Buffer, BufSize,
HANDLE hPipe = OpenMyDevPipe(\"MyPipe1\") //驱动程序里面的 Pipe 名, 对应访问某个端点的 I/O, 这里我乱写的, 需要与驱动一致
if(hPipe != INVALID_HANDLE_VALUE) //打开 Pipe 成功
{
ReadFile(hPipe, Buffer, BufSize, &nBytesRead, NULL) //从 hPipe 里读取数据到 Buffer 里
//WriteFile(hPipe, Buffer, BytesToWrite, &nBytesWritten, NULL) //把 Buffer 里面的 BytesToWrite 字节写入 hPipe
CloseHandle(hPipe)
}
//使用 DeviceIoControl 访问 USB 设备
HANDLE hDevice = OpenMyDevice()
if(hDevice != INVALID_HANDLE_VALUE) //打开设备成功
{
//这些 DeviceIoControl 功能都是由设备定义的, 具体看设备和驱动的资料
if(DeviceIoControl(hDevice, IOCTL_READ_xxxx, &IOBlock, sizeof(IOBLOCK), &c, 1, &nBytes, NULL))
{
//成功
}
CloseHandle(hDevice)
}-/ / open USB literacy, Drivers from the Pipe were identified HANDLE hPipe = OpenMyDevPipe ( " MyPipe1 ") / / driver inside Pipe, and a corresponding visit to the endpoint I / O, Here, I write without basis. consistent with the need to drive if (hPipe! = INVALID_HANDLE_VALUE) / / Open Pipe success (ReadFile (hPipe, Buffer, BufSize,
(系统自动生成,下载前可以参看下载内容)
下载文件列表
FANGWENUSB.txt
www.dssz.com.txt
www.dssz.com.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.