jackadandy
驱动牛犊
驱动牛犊
  • 注册日期2004-03-04
  • 最后登录2016-01-09
  • 粉丝1
  • 关注1
  • 积分5分
  • 威望30点
  • 贡献值0点
  • 好评度19点
  • 原创分0分
  • 专家分0分
阅读:1648回复:0

为什么得到的Capabilities.OutputReportByteLength值为零哪?

楼主#
更多 发布于:2005-04-25 14:27
ICC_set_NAD我自编的dll中的一个函数,在执行Result=HidP_GetCaps(PreparseData,&Capabilities);之后,Capabilities.OutputReportByteLength=0;出错了!!为什么哪??帮帮忙,谢谢!!

unsigned _stdcall ICC_set_NAD(HANDLE fd,unsigned char nad)
{
   UCHAR                 OutPutReport[10];
   BOOL                  Result;
   DWORD                 BytesWritten;
   PHIDP_PREPARSED_DATA  PreparseData;
   HIDP_CAPS             Capabilities;

   OutPutReport[0]=0;
   OutPutReport[1]=nad;
   OutPutReport[2]=0x00;
   OutPutReport[3]=0x05;
   OutPutReport[4]=0x00;
   OutPutReport[5]=0x19;
   OutPutReport[6]=0x00;
   OutPutReport[7]=0x00;
   OutPutReport[8]=0x00;

Result=HidD_GetPreparsedData(fd,&PreparseData);

Result=HidP_GetCaps(PreparseData,&Capabilities);

HidD_FreePreparsedData(PreparseData);

  
Result=WriteFile(fd,
      OutPutReport,       Capabilities.OutputReportByteLength,
                  &BytesWritten,
                  NULL);
  if (Result==FALSE)
  return(1);
return(0);

}//for ICC_set_NAD
游客

返回顶部