我想用SetupDiGetDeviceRegistryProperty获取某个指定设备的状态,如果是SPDRP_CLASSGUID等注册表里面东西是读得到
但SPDRP_CAPABILITIES这个却不能读到,返回的devCap都是0?
我是这样写的,
DWORD Type;
DEVICE_CAPABILITIES devCap;
DWORD devCapSize = sizeof(DEVICE_CAPABILITIES);
SetupDiGetDeviceRegistryProperty(hDevInfo, &spDevInfoData, SPDRP_CAPABILITIES, &Type, (PBYTE)&devCap, devCapSize,  &devCapSize);

解决方案 »

  1.   

    MSDN是这样说的DEVICE_CAPABILITIES This structure is returned in response to an IRP_MN_QUERY_CAPABILITIES IRP.
      

  2.   

    用CM_Get_DevNode_Status就可以了哈哈,自己找到答案。。
      

  3.   

    我用了#include <newdev.h> // for the API UpdateDriverForPlugAndPlayDevices().
    编译是报错了,内容是
    C:\Documents and Settings\Administrator\×ÀÃæ\DiSetup\DiSetup.cpp(12) : fatal error C1083: Cannot open include file: 'newdev.h': No such file or directory
    Error executing cl.exe.
    我不知道是怎么回事情的啊
    那位大侠帮帮我了
      

  4.   

    我也用了GetLastError()看返回值了
    可我不知道啊那些返回值都代表什么意思的啊
    那里有那些返回值的说明的啊用CM_Get_DevNode_Status是什么啊?
      

  5.   

    CM_Get_DevNode_Status 
    function obtains the status of a device instance from its device node, in the local machine's device tree.