请问SetupDiEnumDeviceInterfaces函数返回No more data is available.错误是什么原因?

stewenyang 2012-04-19 10:32:53
    HardwareDeviceInfo = SetupDiGetClassDevs(
InterfaceGuid,
NULL,
NULL,
(DIGCF_PRESENT | DIGCF_DEVICEINTERFACE));

执行成功,但是紧接着的
    bResult = SetupDiEnumDeviceInterfaces(HardwareDeviceInfo,
0,
InterfaceGuid,
19,
&DeviceInterfaceData);

失败。
...全文
661 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
Xomic 2013-08-21
  • 打赏
  • 举报
回复
遇到同样的问题
lulu23260 2013-06-28
  • 打赏
  • 举报
回复
又是一个时隔多年的贴
lulu23260 2013-06-27
  • 打赏
  • 举报
回复
请问楼主,问题有没有解决呢??遇到了同样的问题,求指教
Eleven 2012-04-25
  • 打赏
  • 举报
回复
SetupDiEnumDeviceInterfaces returns TRUE if the function completed without error. If the function completed with an error, FALSE is returned and the error code for the failure can be retrieved by calling GetLastError.
fishion 2012-04-25
  • 打赏
  • 举报
回复
调用了DeviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);没有?
还有就是
MemberIndex
A zero-based index into the list of interfaces in the device information set. The caller should call this function first with MemberIndex set to zero to obtain the first interface. Then, repeatedly increment MemberIndex and retrieve an interface until this function fails and GetLastError returns ERROR_NO_MORE_ITEMS.
stewenyang 2012-04-20
  • 打赏
  • 举报
回复
多谢回复。
wfq0987 2012-04-20
  • 打赏
  • 举报
回复
用Getlasterror函数把errorcode打印出来,对照msdn看看什么问题

2,640

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 硬件/系统
社区管理员
  • 硬件/系统社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧