当前位置: 首页 > news >正文

单位网站怎么制作沈阳网站关键词排名

单位网站怎么制作,沈阳网站关键词排名,辽宁网站建站系统哪家好,比较好的室内设计网站应用程序和驱动程序的通信过程是#xff1a;应用程序使用CreateFile函数打开设备#xff0c;然后用DeviceIoControl与驱动程序进行通信#xff0c;包括读和写两种操作。还可以用ReadFile读数据用WriteFile写数据。操作完毕时用CloseHandle关闭设备。我们比较常用的就是用Dev… 应用程序和驱动程序的通信过程是应用程序使用CreateFile函数打开设备然后用DeviceIoControl与驱动程序进行通信包括读和写两种操作。还可以用ReadFile读数据用WriteFile写数据。操作完毕时用CloseHandle关闭设备。我们比较常用的就是用DeviceIoControl对设备进行读写操作。先看看DeviceIoControl是怎么定义的 BOOL DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped ); Parameters参数 hDevice CreateFile返回的设备句柄[in] Handle to the device that is to perform the operation. To obtain a device handle, call the CreateFile function.dwIoControlCode 应用程序调用驱动程序的控制命令就是IOCTL_XXX IOCTLs [in] IOCTL for the operation. This value identifies the specific operation to perform and the type of device on which to perform the operation. There are no specific values defined for the dwIoControlCode parameter. However, you can define custom IOCTL_XXX IOCTLs with the CTL_CODEmacro. You can then advertise these IOCTLs and an application can use these IOCTLs with DeviceIoControl to perform the driver-specific functions.lpInBuffer 应用程序传递给驱动程序的数据缓冲区地址[in] Long pointer to a buffer that contains the data required to perform the operation. Set to NULL if the dwIoControlCode parameter specifies an operation that does not require input data.nInBufferSize 应用程序传递给驱动程序的数据缓冲区大小字节数[in] Size, in bytes, of the buffer pointed to by lpInBuffer.lpOutBuffer 驱动程序返回给应用程序的数据缓冲区地址[out] Long pointer to a buffer that receives the output data for the operation. Set to NULL if the dwIoControlCode parameter specifies an operation that does not produce output data.nOutBufferSize 驱动程序返回给应用程序的数据缓冲区大小字节数[out] Size, in bytes, of the buffer pointed to by lpOutBuffer.lpBytesReturned 驱动程序实际返回给应用程序的数据字节数地址[out] Long pointer to a variable that receives the size, in bytes, of the data stored in lpOutBuffer. The DeviceIoControl function may unnecessarily use this parameter. For example, if an operation does not produce data for lpOutBuffer and lpOutBuffer is NULL, the value of lpBytesReturned is meaningless.lpOverlapped 重叠操作结构[in] Ignored; set to NULL.Return Values返回值 Nonzero indicates success. Zero indicates failure. To obtain extended error information, call the GetLastError function. 非0成功0失败 具体使用我们看看列子 1向设备传递数据我们定义一个函数来实现 bool CDeviceOperDlg::SendKeyData(HANDLE handle, BYTE *bData, int iSize) {  ULONG nOutput;  BYTE bTemp[512]; //将数据放置到发送数组  memset(bTemp,0,sizeof(bTemp));  memcpy(bTemp,bData[0],iSize);  //向设备发送  if (!DeviceIoControl(handle,                 ATST2004_IOCTL_WRITE,     //根据具体的设备有相关的定义        bTemp,                                        //向设备传递的数据地址        iSize,                                            //数据大小字节数        NULL,                                          //没有返回的数据置为NULL        0,                                                  //没有返回的数据置为0 nOutput,        NULL)     )  {   return false;  } return true; } 2从设备读取数据 bool CDeviceOperDlg::ReviceKeyData(HANDLE handle, BYTE *bData, int iSize) { ULONG nOutput;  BYTE bTemp[512];  //数组清零  memset(bTemp,0,sizeof(bTemp));  //向设备发送  if (!DeviceIoControl(handle,        ATST2004_IOCTL_READ,           //根据具体的设备有相关的定义        NULL,                                              //没有向设备传递的数据置为NULL        0,                                                      //没有向设备传递的数据置为NULL        bTemp,                                           //读取设备的数据返回地址        iSize,                                               //读取数据的字节数        nOutput,        NULL)     )  {   return false;  }  //放置到公用数组  memcpy(bData[0],bTemp[0],iSize);  return true; }
http://www.zqtcl.cn/news/367387/

相关文章:

  • 网站行业关键词如何建设网站
  • wordpress插件目录504wordpress访问优化插件
  • 固定ip做网站网页源码提取工具
  • php网站模板源码下载公司网络营销推广软件
  • 免费电子版个人简历模板温州快速排名优化
  • 网站修改titlewordpress显示icp备案
  • 中国国际贸易单一窗口登录南京专业网站优化公司
  • 手机网站建设合同wordpress案例分析
  • 深圳做网站什么公司好广州电商小程序开发
  • 郑州高新区做网站的公司如何欣赏网站
  • 网站做维恩图做网站的公司杭州
  • 柳州公司网站制作公司wordpress 网店
  • 网站增加栏目费用在网站开发中如何设置登录
  • 怎样用php做网站百度推广联系人
  • 怎么建立手机网站如何申请公司域名
  • 营销型网站怎么收费邓州企业网站
  • 北京建设官方网站邢台网站维护
  • 新余网站制作网站开发工资咋样
  • 襄阳网站建设外包自己做一个网站
  • 网站域名的后缀wordpress文章归类
  • 查询企业信息的官方网站大连建设网站公司
  • 网站建设 全包专业建设规划方案模板
  • 做网站好还是做微信小程序好浙江建设工程造价信息网站
  • 网站开发怎么报价推广普通话手抄报模板可打印
  • 好的平面网站模板企业网站建设浩森宇特
  • 做网站通过什么赚钱吗公司建设网站的费用
  • 如何做建筑一体化的网站视频网站开发应用到哪些技术
  • 巴中微信网站建设竞价托管一般多少钱
  • 彩票网站开发 违法股票网站排名哪个好
  • 宝格丽网站建设哈尔滨网站建设王道下拉強