阅读:1648回复:0
为什么得到的Capabilities.OutputReportByteLength值为零哪?
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 |
|