文件名称:FANGWENUSB
- 所属分类:
- 其它资源
- 资源属性:
- [Text]
- 上传时间:
- 2008-10-13
- 文件大小:
- 1.77kb
- 下载次数:
- 0次
- 提 供 者:
- lanxi*****
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
//打开 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,
(系统自动生成,下载前可以参看下载内容)
下载文件列表
压缩包 : 107215771fangwenusb.rar 列表 FANGWENUSB.txt