DDK函数:CM_Locate_DevNode

MSDN原文地址

Windows Driver Kit: Device Installation

CM_Locate_DevNode

The CM_Locate_DevNode function obtains a device instance handle to the device node that is associated with a specified device instance identifier, on the local machine.

CM_Locate_DevNode 函数获得设备节点的设备实例句柄,关联本机指定的设备实例标识符。

CMAPI CONFIGRET WINAPI
  CM_Locate_DevNode(
    OUT PDEVINST  pdnDevInst,
    IN DEVINSTID  pDeviceID,  OPTIONAL
    IN ULONG  ulFlags
    );
Parameters
pdnDevInst
A pointer to a device instance handle that CM_Locate_DevNode retrieves. The retrieved handle is bound to the local machine.
指向CM_Locate_DevNode 取得的设备实例句柄。这个句柄限制在本机。
pDeviceID
A pointer to a NULL-terminated string representing a device instance identifier. If this value is NULL, or if it points to a zero-length string, the function retrieves a device instance handle to the device at the root of the device tree.
指向一个以NULL结尾的字符串,象征设备实例描述符。如果这个值为NULL,或者指向一个零长度的字符串,函数取得的设备实例句柄是设备树的根设备。
ulFlags
A variable of ULONG type that supplies one of the following flag values that apply if the caller supplies a device instance identifier:
CM_LOCATE_DEVNODE_NORMAL
The function retrieves the device instance handle for the specified device only if the device is currently configured in the device tree.
仅仅是currently configured
CM_LOCATE_DEVNODE_PHANTOM
The function retrieves a device instance handle for the specified device if the device is currently configured in the device tree or the device is a nonpresent device that is not currently configured in the device tree.
          currently configured 或者 nonpresent device
CM_LOCATE_DEVNODE_CANCELREMOVE
The function retrieves a device instance handle for the specified device if the device is currently configured in the device tree or in the process of being removed from the device tree. If the device is in the process of being removed, the function cancels the removal of the device.
正在被移除的设备,如果设备正在被移除,这个函数取消移除动作。
CM_LOCATE_DEVNODE_NOVALIDATION
Not used.
Return Value

If the operation succeeds, CM_Locate_DevNode returns CR_SUCCESS. Otherwise, the function returns one of the CR_Xxx error codes that are defined in cfgmgr32.h.

Comments

For information about using device instance handles that are bound to the local machine, see CM_Get_Child.

Requirements

Versions: The CM_Locate_DevNode function is available in Microsoft Windows 2000 and later versions of Windows.

Headers: Declared in cfgmgr32.h. Include cfgmgr32.h.

See Also

CM_Get_Child, CM_Locate_DevNode_Ex

posted on 2008-03-19 15:57 FongLuo 阅读(3629) 评论(5)  编辑 收藏 引用

评论

# re: DDK函数:CM_Locate_DevNode 2009-08-11 14:35 小张

您好,请问一下,我在MFC程序中,使用这个函数时,总是有链接错误,请问是否需要包含什么额外的系统.lib文件啊?麻烦您谈一谈这个函数的使用方法  回复  更多评论   

# re: DDK函数:CM_Locate_DevNode 2009-08-11 15:03 小张

我的邮箱是maomizp2000@yahoo.com.cn,您也可以把意见发到我的邮箱里面  回复  更多评论   

# re: DDK函数:CM_Locate_DevNode[未登录] 2009-08-31 22:05 FongLuo

这是DDK中的函数,在setupapi.dll中被实现,但在setupapi.lib中没有被引出。你需要找到winDDK中的cfgmgr32.h和cfgmgr32.lib。vc6编译时需要更改一下cfgmgr32.h中的几个定义。  回复  更多评论   

# re: DDK函数:CM_Locate_DevNode[未登录] 2009-08-31 22:16 FongLuo

还要一个cfg.h  回复  更多评论   

# re: DDK函数:CM_Locate_DevNode[未登录] 2009-08-31 22:18 FongLuo

小张:给你发送邮件是提示失败了。你只有自己来这里看了。  回复  更多评论   


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


<2008年7月>
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

导航

常用链接

留言簿

随笔分类(11)

随笔档案(79)

文章档案(1)

收藏夹(38)

学习网站

一般网站

最新随笔

搜索

积分与排名

最新评论

阅读排行榜